-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
36 lines (33 loc) · 711 Bytes
/
Copy pathcli.js
File metadata and controls
36 lines (33 loc) · 711 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
30
31
32
33
34
35
36
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const randomStr = require('r4nd0mstr1ng');
const cli = meow(`
Examples
$ r4nd0mstr1ng
HH9ICHiBSjKnK219w3R6eKgI58ffMW
$ r4nd0mstr1ng --number 7
86mUSdT
$ r4nd0mstr1ng -n 50
GXq0Upu6U7m2qhJqeNZUm36eU123tUIVU7FsHiX92XRrqZIeKU
Options
-n, --number Generate an string with certain length
-h, --help Show this help message
-v, --show Show package version
`, {
flags: {
number: {
type: 'boolean',
alias: 'n'
},
help: {
type: 'boolean',
alias: 'h'
},
version: {
type: 'boolean',
alias: 'v'
}
}
});
console.log(cli.flags.number ? randomStr(cli.input[0]) : randomStr(cli.input[0]));