forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli-entry.js
More file actions
29 lines (26 loc) · 808 Bytes
/
Copy pathcli-entry.js
File metadata and controls
29 lines (26 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';
const engine = require('unified-engine');
const options = require('unified-args/lib/options');
const extensions = require('markdown-extensions');
const processor = require('remark');
const proc = require('remark/package.json');
const cli = require('../package.json');
const { plugins } = require('remark-preset-lint-node');
const args = {
processor: processor,
name: proc.name,
description: cli.description,
version: [
proc.name + ': ' + proc.version,
cli.name + ': ' + cli.version
].join(', '),
ignoreName: '.' + proc.name + 'ignore',
extensions: extensions
};
const config = options(process.argv.slice(2), args);
config.detectConfig = false;
config.plugins = plugins;
engine(config, function done(err, code) {
if (err) console.error(err);
process.exit(code);
});