-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.js
executable file
·50 lines (43 loc) · 1005 Bytes
/
cli.js
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const updateNotifier = require('update-notifier');
const emoji = require('node-emoji');
const pkg = require('./package.json');
const sync = require('./index');
const cli = meow(
`
Usage
$ npm-sync <input> [options]
Options
-t, --token Your GitHub token.
-i, --id ID of Gist that is used by this module.
-h, --help Show this help message.
-v, --version Show version information.
Examples
$ npm-sync init -t 123e4567f89
$ npm-sync i -t 123e4567f89
$ npm-sync init -t 123e4567f89 -i 123456789
$ npm-sync download
$ npm-sync dl
$ npm-sync upload
$ npm-sync up
Read the more at ${emoji.get(
'book'
)} at https://github.com/riyadhalnur/npm-modules-sync ${emoji.get('rocket')}.
`,
{
flags: {
token: {
type: 'string',
alias: 't',
},
id: {
type: 'string',
alias: 'i',
},
},
}
);
updateNotifier({ pkg }).notify();
sync(cli.input[0], cli.flags);