https://github.com/lukem512/extract-svg-viewbox
Extracts the viewBox information from an SVG string
https://github.com/lukem512/extract-svg-viewbox
extract-svg-viewbox svg viewbox viewbox-information
Last synced: 5 days ago
JSON representation
Extracts the viewBox information from an SVG string
- Host: GitHub
- URL: https://github.com/lukem512/extract-svg-viewbox
- Owner: lukem512
- Created: 2017-03-30T11:58:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-19T15:40:51.000Z (almost 8 years ago)
- Last Synced: 2025-07-02T05:42:24.325Z (12 days ago)
- Topics: extract-svg-viewbox, svg, viewbox, viewbox-information
- Language: JavaScript
- Size: 3.91 KB
- Stars: 2
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# extract-svg-viewbox
[](https://travis-ci.org/lukem512/extract-svg-viewbox)  [](https://www.npmjs.com/package/extract-svg-viewbox) [](https://www.npmjs.com/package/extract-svg-viewbox) [](https://www.npmjs.com/package/extract-svg-viewbox)
Extracts the viewBox information from an SVG string.
## Install
```
npm i --save extract-svg-viewbox
```## Usage
```js
const extract = require('extract-svg-viewbox')const svg = `
`const viewBox = extract(svg)
console.log(viewBox) // "0 0 460 460"
```## Related Modules
[normalize-svg-coords](https://github.com/lukem512/normalize-svg-coords)
## License
MIT © Luke Mitchell