1.0.4 • Published 8 years ago

metalsmith-svgo v1.0.4

Weekly downloads
7
License
MIT
Repository
github
Last release
8 years ago

metalsmith-svgo Build Status NPM version Dependency Status

Compress SVG with Metalsmith.

If you have any issues with the output of this plugin, please use the svgo tracker.

Install

With npm do:

npm install metalsmith-svgo --save

Example

var svgo       = require('metalsmith-svgo'),
    Metalsmith = require('metalsmith');

Metalsmith('fixtures')
    .use(svgo())
    .build(function (err) {
        if (err) {
            throw err;
        }
    });

With custom options:

Metalsmith('fixtures')
    .use(svgo({
        plugins: [{
            removeDoctype: false
        }, {
            removeComments: false
        }, {
            cleanupNumericValues: {
                floatPrecision: 2
            }
        }, {
            convertColors: {
                names2hex: false,
                rgb2hex: false
            }
        }]
    }))
    .build(function (err) {
        if (err) {
            throw err;
        }
    });

Options

See the svgo documentation.

Contributing

Pull requests are welcome. If you add functionality, then please add unit tests to cover it.

License

MIT © Ben Briggs

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

9 years ago

1.0.0

9 years ago