svgo-sync
a sync version package for svgo
Last updated 5 years ago by purplebamboo .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install svgo-sync 
SYNC missed versions from official npm registry.

english | русский


logo

why make this

svgo use a callback to get the parsed data.

but i just want it tobe synchronous.

how

svgo use sax-js to parse svg,because sax-js is asynchronous,then svgo have to be asynchronous too.

so i just change the sax-js to htmlparser2 which support parse svg synchronous.

use

install:

npm install svgo-sync

just add one more api:

SVGO = require('svgo-sync');
svgo = new SVGO(/*{ custom config object }*/);

// sync version for optimize
var result = svgo.optimizeSync(str);

console.log(result)

Current Tags

  • 0.5.1                                ...           latest (5 years ago)

1 Versions

  • 0.5.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 2
Dependencies (7)
Dev Dependencies (5)

Copyright 2014 - 2016 © taobao.org |