svg-jquery

1.0.3 • Public • Published

svg-jquery v1.0.3 Build Status

Get svg as jquery object in jsdom env on node.js.

Install

npm install svg-jquery

Usage

var parseSvg = require('svg-jquery')
 
parseSvg('<svg xmlns="http://www.w3.org/2000/svg"><rect fill="black" x="50" y="50" width="100" height="100"></rect></svg>').then(function (res) {
 
    var window = res.window;
    var jQuery = res.window.$;
 
    var svg = res.svg; // This is the same as `res.window.$('svg')`
 
    var rect = svg.find('rect');
 
    // ... any manipulations on svg
 
}).catch(function (err) {
 
    // the case svg is broken
 
});
 

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    1
  • 1.0.2
    0

Package Sidebar

Install

npm i svg-jquery

Weekly Downloads

1

Version

1.0.3

License

MIT

Last publish

Collaborators

  • kt3k