load-svg

1.0.0 • Public • Published

load-svg

load an svg element over xhr

example

var loadsvg = require('load-svg');
 
loadsvg('wizard_hat.svg', function (err, svg) {
    document.body.appendChild(svg);
});

methods

var loadsvg = require('load-svg')

loadsvg(opts, cb)

Load an svg asynchronously over xhr and construct the svg dom element. cb(err, svg) fires with the svg dom element.

opts can be a string uri or an option argument that is passed through to the xhr module.

install

With npm do:

npm install load-svg

license

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    115
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    115

Package Sidebar

Install

npm i load-svg

Weekly Downloads

30

Version

1.0.0

License

MIT

Last publish

Collaborators

  • nopersonsmodules