Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101471015
README.md
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Feb 10, 18:53
Size
619 B
Mime Type
text/x-java
Expires
Wed, Feb 12, 18:53 (2 d)
Engine
blob
Format
Raw Data
Handle
24157266
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
README.md
View Options
#
svg
-
parser
Take
a
string
representing
an
SVG
document
or
fragment
,
turn
it
into
[
HAST
](
https
:
//github.com/syntax-tree/hast) JavaScript object.
##
Installation
`npm install svg-parser`
,
or
grab
it
from
[
npmcdn
.
com
/
svg
-
parser
](
https
:
//npmcdn.com/svg-parser).
##
Usage
```
js
import
{
parse
}
from
'
svg
-
parser
'
;
const
parsed
=
parse
(
`
<
svg
viewBox
=
'
0
0
100
100
'
>
<!--
stuff
goes
here
...
-->
</
svg
>
`
);
/*
{
type: 'root',
children: [
{
type: 'element',
tagName: 'svg',
properties: {
viewBox: '0 0 100 100'
},
children: [...]
}
]
}
*/
```
##
License
MIT
Event Timeline
Log In to Comment