Created
May 1, 2012 09:49
-
-
Save monolithed/2566882 to your computer and use it in GitHub Desktop.
TSN example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var TSN = require('TSN'); | |
| var fs = require("fs"); | |
| var template = TSN.load('template.xml'); | |
| var file = fs.createWriteStream('template.html', { | |
| flags: 'a', | |
| encoding: 'utf-8', | |
| mode: 0666 | |
| }); | |
| var result = TSN.render(template, file); | |
| file.on('error', function(error) { | |
| console.error(error); | |
| }); | |
| file.write(result); | |
| file.end(function() { | |
| console.log('Ok!'); | |
| }); |
monolithed
commented
May 1, 2012
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment