Skip to content

Commit

Permalink
Merge pull request svg#902 from bnjmn-jns/patch-1
Browse files Browse the repository at this point in the history
Added config example to node example file
  • Loading branch information
GreLI authored Feb 7, 2018
2 parents c47c71b + 3ec6cef commit 981328e
Showing 1 changed file with 73 additions and 1 deletion.
74 changes: 73 additions & 1 deletion examples/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,79 @@ var FS = require('fs'),
PATH = require('path'),
SVGO = require('../lib/svgo'),
filepath = PATH.resolve(__dirname, 'test.svg'),
svgo = new SVGO(/*{ custom config object }*/);
svgo = new SVGO({
plugins: [{
cleanupAttrs: true,
}, {
removeDoctype: true,
},{
removeXMLProcInst: true,
},{
removeComments: true,
},{
removeMetadata: true,
},{
removeTitle: true,
},{
removeDesc: true,
},{
removeUselessDefs: true,
},{
removeEditorsNSData: true,
},{
removeEmptyAttrs: true,
},{
removeHiddenElems: true,
},{
removeEmptyText: true,
},{
removeEmptyContainers: true,
},{
removeViewBox: false,
},{
cleanUpEnableBackground: true,
},{
convertStyleToAttrs: true,
},{
convertColors: true,
},{
convertPathData: true,
},{
convertTransform: true,
},{
removeUnknownsAndDefaults: true,
},{
removeNonInheritableGroupAttrs: true,
},{
removeUselessStrokeAndFill: true,
},{
removeUnusedNS: true,
},{
cleanupIDs: true,
},{
cleanupNumericValues: true,
},{
moveElemsAttrsToGroup: true,
},{
moveGroupAttrsToElems: true,
},{
collapseGroups: true,
},{
removeRasterImages: false,
},{
mergePaths: true,
},{
convertShapeToPath: true,
},{
sortAttrs: true,
},{
transformsWithOnePath: false,
},{
removeDimensions: true,
},{
removeAttrs: {attrs: '(stroke|fill)'},
}]
});

FS.readFile(filepath, 'utf8', function(err, data) {

Expand Down

0 comments on commit 981328e

Please sign in to comment.