Permalink
Browse files

Merge pull request #2 from ipridian/master

fs.readFile example update in documentation
  • Loading branch information...
2 parents df91e3f + 45be0e5 commit b6f7f0896bb753b56d81ce4a1dbf0a14963fc376 Oliver Morgan committed Sep 10, 2011
Showing with 8 additions and 7 deletions.
  1. +8 −7 README.md
View
@@ -76,13 +76,14 @@ Within your application, you can use parrot like the following:
Where the input variable is a string you would like parrot to render. If you would like to render a file, do the following:
- var parrot = require('./lib/parrot'),
- fs = require('fs');
-
- fs.readFile(file, function(data) {
-
- var output = parrot.render(data);
- });
+```javascript
+var parrot = require('./lib/parrot');
+var fs = require('fs');
+fs.readFile(file, encoding, function(err, data) {
+ if (err) throw err;
+ var output = parrot.render(data);
+});
+```
Where file is a string value of the file you wish to render, and output is the rendered template.

0 comments on commit b6f7f08

Please sign in to comment.