summaryrefslogtreecommitdiffstats
path: root/test/bin/lex.js
blob: c35d3991d16cfc2e865163ef450fd3cca9da9a3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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));