MCPcopy Index your code
hub / github.com/web-push-libs/web-push / printUsageDetails

Function printUsageDetails

src/cli.js:8–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6const webPush = require('../src/index.js');
7
8const printUsageDetails = () => {
9 const actions = [
10 {
11 name: 'send-notification',
12 options: [
13 '--endpoint=<url>',
14 '[--key=<browser key>]',
15 '[--auth=<auth secret>]',
16 '[--payload=<message>]',
17 '[--ttl=<seconds>]',
18 '[--encoding=<encoding type>]',
19 '[--vapid-subject=<vapid subject>]',
20 '[--vapid-pubkey=<public key url base64>]',
21 '[--vapid-pvtkey=<private key url base64>]',
22 '[--proxy=<http proxy uri, e.g: http://127.0.0.1:8889>]',
23 '[--gcm-api-key=<api key>]'
24 ]
25 }, {
26 name: 'generate-vapid-keys',
27 options: [
28 '[--json]'
29 ]
30 }
31 ];
32
33 let usage = '\nUsage: \n\n';
34 actions.forEach(action => {
35 usage += ' web-push ' + action.name;
36 usage += ' ' + action.options.join(' ');
37 usage += '\n\n';
38 });
39
40 console.log(usage);
41 process.exit(1);
42};
43
44const generateVapidKeys = returnJson => {
45 const vapidKeys = webPush.generateVAPIDKeys();

Callers 1

cli.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected