Handy utility to convert SVG images to inline Javascript
npm install --save svg2js
Svg2Js API is Promise based
import Svg2Js from 'svg2js'
Svg2Js.create({
source: '/Users/userX/myImage.svg',
destination: '/Users/userX/myImage.js'
}).then(() => console.log('SUCCESS!'))
after conversion JS SVG can be used as regular JS module
var MySvgImage = require('../../../../selectorAssets/runtime/icons/myImage.js')
//USE MySvgImage as inline value for rendering in various tools/libs
import Svg2Js from 'svg2js'
Svg2Js.convert({
source: '/Users/userX/myImage.svg'
}).then((result) => console.log('SUCCESS!', result))
Basicaly clone, change, test, push and pull request.
icon-toolkit is licensed under the MIT license.