Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: about 8 hours ago
JSON representation

Extracts the viewBox information from an SVG string

Awesome Lists containing this project

README

        

# extract-svg-viewbox

[![Build Status](https://travis-ci.org/lukem512/extract-svg-viewbox.svg?branch=master)](https://travis-ci.org/lukem512/extract-svg-viewbox) ![Build Status](https://david-dm.org/lukem512/extract-svg-viewbox.svg) [![npm](https://img.shields.io/npm/l/extract-svg-viewbox.svg)](https://www.npmjs.com/package/extract-svg-viewbox) [![npm](https://img.shields.io/npm/v/extract-svg-viewbox.svg)](https://www.npmjs.com/package/extract-svg-viewbox) [![npm](https://img.shields.io/npm/dm/extract-svg-viewbox.svg)](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