Skip to content

Commit 8429ffb

Browse files
author
deepsweet
committed
examples: remake
1 parent 74f4685 commit 8429ffb

File tree

4 files changed

+31
-101
lines changed

4 files changed

+31
-101
lines changed

examples/fromFile.js

-32
This file was deleted.

examples/fromStream.js

-37
This file was deleted.

examples/fromString.js

-32
This file was deleted.

examples/test.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
'use strict';
2+
3+
var FS = require('fs'),
4+
PATH = require('path'),
5+
SVGO = require('../lib/svgo'),
6+
filepath = PATH.resolve(__dirname, 'test.svg'),
7+
svgo = new SVGO(/*{ custom config object }*/);
8+
9+
FS.readFile(filepath, 'utf8', function(err, data) {
10+
11+
if (err) {
12+
throw err;
13+
}
14+
15+
svgo.optimize(data, function(result) {
16+
17+
console.log(result);
18+
19+
// {
20+
// // optimized SVG data string
21+
// data: '<svg width="10" height="20">test</svg>'
22+
// // additional info such as width/height
23+
// info: {
24+
// width: '10',
25+
// height: '20'
26+
// }
27+
// }
28+
29+
});
30+
31+
});

0 commit comments

Comments
 (0)