Skip to content

Commit

Permalink
examples: remake
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsweet committed Apr 12, 2013
1 parent 74f4685 commit 8429ffb
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 101 deletions.
32 changes: 0 additions & 32 deletions examples/fromFile.js

This file was deleted.

37 changes: 0 additions & 37 deletions examples/fromStream.js

This file was deleted.

32 changes: 0 additions & 32 deletions examples/fromString.js

This file was deleted.

31 changes: 31 additions & 0 deletions examples/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use strict';

var FS = require('fs'),
PATH = require('path'),
SVGO = require('../lib/svgo'),
filepath = PATH.resolve(__dirname, 'test.svg'),
svgo = new SVGO(/*{ custom config object }*/);

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

if (err) {
throw err;
}

svgo.optimize(data, function(result) {

console.log(result);

// {
// // optimized SVG data string
// data: '<svg width="10" height="20">test</svg>'
// // additional info such as width/height
// info: {
// width: '10',
// height: '20'
// }
// }

});

});

0 comments on commit 8429ffb

Please sign in to comment.