forked from thom4parisot/polyfill-service-url-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·47 lines (45 loc) · 1.35 KB
/
index.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
#!/usr/bin/env node
'use strict';
require('yargs')
.usage('$0 command')
.command(
'analyse',
'Analyse a JavaScript file and generate a polyfill.io URL based on all the features that are being used from within the JavaScript file.',
{
file: {
array: true,
string: true,
describe: 'The file that should be analysed',
demandOption: true,
},
omit: {
array: true,
string: true,
describe: 'The list of features to omit',
},
cwd: {
string: true,
describe: 'The current working directory. Defaults to process.cwd()',
},
hostname: {
string: true,
describe: 'The hostname to use for the generated URL. Defaults to polyfill.io',
},
useComputeAtEdgeBackend: {
string: true,
describe: 'Defines the compute-at-edge-backend usage policy: `yes` or `no`. If empty the server will decide.',
},
flags: {
array: true,
string: true,
describe: 'Configuration settings for every polyfill being requested. Possible values are `always` and `gated` or both',
},
unknown: {
string: true,
describe: 'Defines the policy for unsupported browsers: `polyfill` or `ignore`. Defaults to `polyfill`',
},
},
require('./src/analyse')
)
.help()
.strict().argv;