File: node.js

package info (click to toggle)
rust-scriptisto 2.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 436 kB
  • sloc: python: 25; ansic: 16; java: 11; pascal: 9; cpp: 8; javascript: 8; cs: 7; cobol: 5; lisp: 5; f90: 5; makefile: 4; ml: 4; haskell: 2
file content (21 lines) | stat: -rwxr-xr-x 589 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env scriptisto

// scriptisto-begin
// script_src: script.js
// build_once_cmd: npm install
// target_bin: ./script.js
// target_interpreter: /usr/bin/env node
// files:
//  - path: package.json
//    content: |
//     { "dependencies": { "yargs": "^14.2.0" } }
// scriptisto-end

argv = require('yargs')
    .usage('Usage: $0 [options]')
    .command('script', 'Example script')
    .alias('i', 'input').nargs('i', 1).describe('i', 'Example input')
    .help('h').alias('h', 'help')
    .argv;

console.log("Hello, JavaScript on Node!. Input: " + (argv.input || "<not set>"));