mirror of
https://github.com/actions/setup-node.git
synced 2025-07-27 08:58:24 +02:00
.
This commit is contained in:
parent
8affe1ed56
commit
760046e9f2
7278 changed files with 0 additions and 1778943 deletions
29
node_modules/optimist/example/line_count_options.js
generated
vendored
29
node_modules/optimist/example/line_count_options.js
generated
vendored
|
@ -1,29 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
var argv = require('optimist')
|
||||
.usage('Count the lines in a file.\nUsage: $0')
|
||||
.options({
|
||||
file : {
|
||||
demand : true,
|
||||
alias : 'f',
|
||||
description : 'Load a file'
|
||||
},
|
||||
base : {
|
||||
alias : 'b',
|
||||
description : 'Numeric base to use for output',
|
||||
default : 10,
|
||||
},
|
||||
})
|
||||
.argv
|
||||
;
|
||||
|
||||
var fs = require('fs');
|
||||
var s = fs.createReadStream(argv.file);
|
||||
|
||||
var lines = 0;
|
||||
s.on('data', function (buf) {
|
||||
lines += buf.toString().match(/\n/g).length;
|
||||
});
|
||||
|
||||
s.on('end', function () {
|
||||
console.log(lines.toString(argv.base));
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue