mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-25 14:26:29 +00:00
17 lines
433 B
JavaScript
Executable File
17 lines
433 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
var documentation = require('../'),
|
|
JSONStream = require('JSONStream'),
|
|
argv = require('minimist')(process.argv.slice(2));
|
|
|
|
/**
|
|
* A CLI utility that accepts a file path as input and emits a JSON
|
|
* array of parsed documentation headers
|
|
*/
|
|
|
|
if (!argv._.length) throw new Error('usage: documentation [entry files]');
|
|
|
|
documentation(argv._[0])
|
|
.pipe(JSONStream.stringify())
|
|
.pipe(process.stdout);
|