flex-svg
A Node.js module to create SVG files of flexible width and height
↓
If width
and height
attributes of outermost svg elements are not specified, they are regarded as 100%
according to SVG 1.1 Specification.
Used by
- grunt-flex-svg (Grunt plugin)
- gulp-flex-svg (gulp plugin)
Installation
npm install flex-svg
API
const flexSvg = ;
flexSvg(SVGdata [, options], callback)
SVGdata: string
Buffer
(SVG)
options: Object
(directly passed to the xml2js.Parser options and the xml2js.Builder options)
callback: Function
callback(error, result)
error: Error
if it fails to parse SVG, otherwise null
result: String
of SVG without width
and height
attributes
const fs = ;const flexSvg = ; fs;
flexSvg.FlexSvg([options])
Return: Function
Create a function to which options are binded. This is more efficient way in the case when the program repeatedly runs flexSvg
function with the same options.
License
Copyright (c) 2014 - 2017 Shinnosuke Watanabe
Licensed under the MIT License