-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ea2cd7
commit fc5332f
Showing
22 changed files
with
879 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
node_modules/init-package-json/node_modules/mute-stream/LICENSE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
The ISC License | ||
|
||
Copyright (c) Isaac Z. Schlueter and Contributors | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR | ||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
File renamed without changes.
29 changes: 29 additions & 0 deletions
29
node_modules/init-package-json/node_modules/mute-stream/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "mute-stream", | ||
"version": "0.0.8", | ||
"main": "mute.js", | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"devDependencies": { | ||
"tap": "^12.1.1" | ||
}, | ||
"scripts": { | ||
"test": "tap test/*.js --cov" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/isaacs/mute-stream" | ||
}, | ||
"keywords": [ | ||
"mute", | ||
"stream", | ||
"pipe" | ||
], | ||
"author": "Isaac Z. Schlueter <[email protected]> (http://blog.izs.me/)", | ||
"license": "ISC", | ||
"description": "Bytes go in, but they don't come out (when muted).", | ||
"files": [ | ||
"mute.js" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
The ISC License | ||
|
||
Copyright (c) Isaac Z. Schlueter and Contributors | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR | ||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
113 changes: 113 additions & 0 deletions
113
node_modules/init-package-json/node_modules/read/lib/read.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
|
||
module.exports = read | ||
|
||
var readline = require('readline') | ||
var Mute = require('mute-stream') | ||
|
||
function read (opts, cb) { | ||
if (opts.num) { | ||
throw new Error('read() no longer accepts a char number limit') | ||
} | ||
|
||
if (typeof opts.default !== 'undefined' && | ||
typeof opts.default !== 'string' && | ||
typeof opts.default !== 'number') { | ||
throw new Error('default value must be string or number') | ||
} | ||
|
||
var input = opts.input || process.stdin | ||
var output = opts.output || process.stdout | ||
var prompt = (opts.prompt || '').trim() + ' ' | ||
var silent = opts.silent | ||
var editDef = false | ||
var timeout = opts.timeout | ||
|
||
var def = opts.default || '' | ||
if (def) { | ||
if (silent) { | ||
prompt += '(<default hidden>) ' | ||
} else if (opts.edit) { | ||
editDef = true | ||
} else { | ||
prompt += '(' + def + ') ' | ||
} | ||
} | ||
var terminal = !!(opts.terminal || output.isTTY) | ||
|
||
var m = new Mute({ replace: opts.replace, prompt: prompt }) | ||
m.pipe(output, {end: false}) | ||
output = m | ||
var rlOpts = { input: input, output: output, terminal: terminal } | ||
|
||
if (process.version.match(/^v0\.6/)) { | ||
var rl = readline.createInterface(rlOpts.input, rlOpts.output) | ||
} else { | ||
var rl = readline.createInterface(rlOpts) | ||
} | ||
|
||
|
||
output.unmute() | ||
rl.setPrompt(prompt) | ||
rl.prompt() | ||
if (silent) { | ||
output.mute() | ||
} else if (editDef) { | ||
rl.line = def | ||
rl.cursor = def.length | ||
rl._refreshLine() | ||
} | ||
|
||
var called = false | ||
rl.on('line', onLine) | ||
rl.on('error', onError) | ||
|
||
rl.on('SIGINT', function () { | ||
rl.close() | ||
onError(new Error('canceled')) | ||
}) | ||
|
||
var timer | ||
if (timeout) { | ||
timer = setTimeout(function () { | ||
onError(new Error('timed out')) | ||
}, timeout) | ||
} | ||
|
||
function done () { | ||
called = true | ||
rl.close() | ||
|
||
if (process.version.match(/^v0\.6/)) { | ||
rl.input.removeAllListeners('data') | ||
rl.input.removeAllListeners('keypress') | ||
rl.input.pause() | ||
} | ||
|
||
clearTimeout(timer) | ||
output.mute() | ||
output.end() | ||
} | ||
|
||
function onError (er) { | ||
if (called) return | ||
done() | ||
return cb(er) | ||
} | ||
|
||
function onLine (line) { | ||
if (called) return | ||
if (silent && terminal) { | ||
output.unmute() | ||
output.write('\r\n') | ||
} | ||
done() | ||
// truncate the \n at the end. | ||
line = line.replace(/\r?\n$/, '') | ||
var isDefault = !!(editDef && line === def) | ||
if (def && !line) { | ||
isDefault = true | ||
line = def | ||
} | ||
cb(null, line, isDefault) | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
node_modules/init-package-json/node_modules/read/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "read", | ||
"version": "1.0.7", | ||
"main": "lib/read.js", | ||
"dependencies": { | ||
"mute-stream": "~0.0.4" | ||
}, | ||
"devDependencies": { | ||
"tap": "^1.2.0" | ||
}, | ||
"engines": { | ||
"node": ">=0.8" | ||
}, | ||
"author": "Isaac Z. Schlueter <[email protected]> (http://blog.izs.me/)", | ||
"description": "read(1) for node programs", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/isaacs/read.git" | ||
}, | ||
"license": "ISC", | ||
"scripts": { | ||
"test": "tap test/*.js" | ||
}, | ||
"files": [ | ||
"lib/read.js" | ||
] | ||
} |
Oops, something went wrong.