Skip to content

Commit

Permalink
Improved usage pattern example (closes #177)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkphl committed Aug 11, 2016
1 parent a0acc4e commit 09a66cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,6 +1,7 @@
## 1.3.4 Bugfix release (unreleased)
* Updated dependencies
* Extended the ID generator callback signature ([#176](https://github.com/jkphl/svg-sprite/issues/176))
* Improved usage pattern example ([#177](https://github.com/jkphl/svg-sprite/issues/177))

## 1.3.3 Bugfix release (2016-04-28)
* Fixed CLI regression bug ([#173](https://github.com/jkphl/svg-sprite/issues/173))
Expand Down
8 changes: 7 additions & 1 deletion README.md
Expand Up @@ -82,7 +82,13 @@ spriter.add('assets/svg-2.svg', null, fs.readFileSync('assets/svg-2.svg', {encod

// Compile the sprite
spriter.compile(function(error, result) {
/* ... Write `result` files to disk or do whatever with them ... */
/* Write `result` files to disk (or do whatever with them ...) */
for (var mode in result) {
for (var resource in result[mode]) {
mkdirp.sync(path.dirname(result[mode][resource].path));
fs.writeFileSync(result[mode][resource].path, result[mode][resource].contents);
}
}
});
```

Expand Down

0 comments on commit 09a66cd

Please sign in to comment.