summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@friendco.de>2015-01-14 21:56:57 +0100
committerAaron O'Mullan <aaron.omullan@friendco.de>2015-01-14 21:56:57 +0100
commit3f36d83bfbeda5b60e5bbf24ac27d3ab8939f421 (patch)
treedd87780a1007b3a00a042fc46945a3e543bd4333 /test
parentc7e3370ac0794ebebb19146aa53bed03d58c8165 (diff)
downloadgitbook-3f36d83bfbeda5b60e5bbf24ac27d3ab8939f421.zip
gitbook-3f36d83bfbeda5b60e5bbf24ac27d3ab8939f421.tar.gz
gitbook-3f36d83bfbeda5b60e5bbf24ac27d3ab8939f421.tar.bz2
Add test/bin/lex.js utility
Helpful binary when developing / debugging
Diffstat (limited to 'test')
-rwxr-xr-xtest/bin/lex.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/bin/lex.js b/test/bin/lex.js
new file mode 100755
index 0000000..c35d399
--- /dev/null
+++ b/test/bin/lex.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.lex(content);
+
+console.log(JSON.stringify(lexed, null, 2));