summaryrefslogtreecommitdiffstats
path: root/test/bin/summary.js
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@friendco.de>2015-01-14 22:16:37 +0100
committerAaron O'Mullan <aaron.omullan@friendco.de>2015-01-14 22:16:37 +0100
commitf88951546d59776c9be30973c782347ba125d3aa (patch)
treea13bd4dca66bde9b6b4e6c929232fbb0cb0bba84 /test/bin/summary.js
parent3f36d83bfbeda5b60e5bbf24ac27d3ab8939f421 (diff)
downloadgitbook-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-xtest/bin/summary.js16
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));