diff options
author | Aaron O'Mullan <aaron.omullan@friendco.de> | 2015-01-14 22:16:37 +0100 |
---|---|---|
committer | Aaron O'Mullan <aaron.omullan@friendco.de> | 2015-01-14 22:16:37 +0100 |
commit | f88951546d59776c9be30973c782347ba125d3aa (patch) | |
tree | a13bd4dca66bde9b6b4e6c929232fbb0cb0bba84 /test/bin/summary.js | |
parent | 3f36d83bfbeda5b60e5bbf24ac27d3ab8939f421 (diff) | |
download | gitbook-f88951546d59776c9be30973c782347ba125d3aa.zip gitbook-f88951546d59776c9be30973c782347ba125d3aa.tar.gz gitbook-f88951546d59776c9be30973c782347ba125d3aa.tar.bz2 |
Add test/bin/summary.js
Another small useful tool
Diffstat (limited to 'test/bin/summary.js')
-rwxr-xr-x | test/bin/summary.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/bin/summary.js b/test/bin/summary.js new file mode 100755 index 0000000..78c20dc --- /dev/null +++ b/test/bin/summary.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node + +var fs = require('fs'); + +var gitbook = require('../../'); + +if(process.argv < 3) { + console.error('Please specify a filename'); + process.exit(1); +} + +var content = fs.readFileSync(process.argv[2], 'utf8'); + +var lexed = gitbook.parse.summary(content); + +console.log(JSON.stringify(lexed, null, 2)); |