diff options
author | Rebecca Turner <me@re-becca.org> | 2015-08-27 02:09:34 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-08-27 02:51:13 +0300 |
commit | e7b8315b0ffa6efd29065b71a632a905d3450fc7 (patch) | |
tree | b8e3b30e621120b8b3a707286799418004b250f7 /node_modules/read | |
parent | f4a578424b1f9d12f58210c229e7af633d952587 (diff) |
read@1.0.7
Diffstat (limited to 'node_modules/read')
-rw-r--r-- | node_modules/read/.npmignore | 2 | ||||
-rw-r--r-- | node_modules/read/LICENCE | 25 | ||||
-rw-r--r-- | node_modules/read/example/example.js | 13 | ||||
-rw-r--r-- | node_modules/read/package.json | 38 | ||||
-rw-r--r-- | node_modules/read/rs.js | 4 | ||||
-rw-r--r-- | node_modules/read/test/basic.js | 60 | ||||
-rw-r--r-- | node_modules/read/test/defaults.js | 60 | ||||
-rw-r--r-- | node_modules/read/test/many.js | 83 |
8 files changed, 21 insertions, 264 deletions
diff --git a/node_modules/read/.npmignore b/node_modules/read/.npmignore deleted file mode 100644 index 0db216bfa..000000000 --- a/node_modules/read/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -npm-debug.log -node_modules diff --git a/node_modules/read/LICENCE b/node_modules/read/LICENCE deleted file mode 100644 index 74489e2e2..000000000 --- a/node_modules/read/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) Isaac Z. Schlueter -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/read/example/example.js b/node_modules/read/example/example.js deleted file mode 100644 index cf213bf88..000000000 --- a/node_modules/read/example/example.js +++ /dev/null @@ -1,13 +0,0 @@ -var read = require("../lib/read.js") - -read({prompt: "Username: ", default: "test-user" }, function (er, user) { - read({prompt: "Password: ", default: "test-pass", silent: true }, function (er, pass) { - read({prompt: "Password again: ", default: "test-pass", silent: true }, function (er, pass2) { - console.error({user: user, - pass: pass, - verify: pass2, - passMatch: (pass === pass2)}) - console.error("the program should exit now") - }) - }) -}) diff --git a/node_modules/read/package.json b/node_modules/read/package.json index ce369b368..04f845955 100644 --- a/node_modules/read/package.json +++ b/node_modules/read/package.json @@ -1,38 +1,38 @@ { "_args": [ [ - "read@~1.0.6", + "read@1.0.7", "/Users/rebecca/code/npm" ] ], - "_from": "read@>=1.0.6 <1.1.0", - "_id": "read@1.0.6", + "_from": "read@1.0.7", + "_id": "read@1.0.7", "_inCache": true, "_location": "/read", - "_nodeVersion": "2.0.1", + "_nodeVersion": "2.2.1", "_npmUser": { "email": "isaacs@npmjs.com", "name": "isaacs" }, - "_npmVersion": "2.10.0", + "_npmVersion": "3.2.2", "_phantomChildren": {}, "_requested": { "name": "read", - "raw": "read@~1.0.6", - "rawSpec": "~1.0.6", + "raw": "read@1.0.7", + "rawSpec": "1.0.7", "scope": null, - "spec": ">=1.0.6 <1.1.0", - "type": "range" + "spec": "1.0.7", + "type": "version" }, "_requiredBy": [ "/", "/init-package-json", "/promzard" ], - "_resolved": "https://registry.npmjs.org/read/-/read-1.0.6.tgz", - "_shasum": "09873c14ecc114d063fad43b8ca5a33d304721c8", + "_resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "_shasum": "b3da19bd052431a97671d44a42634adf710b40c4", "_shrinkwrap": null, - "_spec": "read@~1.0.6", + "_spec": "read@1.0.7", "_where": "/Users/rebecca/code/npm", "author": { "email": "i@izs.me", @@ -47,18 +47,22 @@ }, "description": "read(1) for node programs", "devDependencies": { - "tap": "*" + "tap": "^1.2.0" }, "directories": {}, "dist": { - "shasum": "09873c14ecc114d063fad43b8ca5a33d304721c8", - "tarball": "http://registry.npmjs.org/read/-/read-1.0.6.tgz" + "shasum": "b3da19bd052431a97671d44a42634adf710b40c4", + "tarball": "http://registry.npmjs.org/read/-/read-1.0.7.tgz" }, "engines": { "node": ">=0.8" }, - "gitHead": "2f5101c8e41332a033e5aa4e27e33fd6e09598e2", + "files": [ + "lib/read.js" + ], + "gitHead": "b14516b9236c40140fd0666567f5d0c588a09a62", "homepage": "https://github.com/isaacs/read#readme", + "installable": true, "license": "ISC", "main": "lib/read.js", "maintainers": [ @@ -76,5 +80,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "1.0.6" + "version": "1.0.7" } diff --git a/node_modules/read/rs.js b/node_modules/read/rs.js deleted file mode 100644 index d9f7f48dd..000000000 --- a/node_modules/read/rs.js +++ /dev/null @@ -1,4 +0,0 @@ -var read = require('read'); -read({ silent: true, prompt: 'stars: ' }, function(er, data) { - console.log(er, data) -}) diff --git a/node_modules/read/test/basic.js b/node_modules/read/test/basic.js deleted file mode 100644 index f0926f3f2..000000000 --- a/node_modules/read/test/basic.js +++ /dev/null @@ -1,60 +0,0 @@ -var tap = require('tap') -var read = require('../lib/read.js') - -if (process.argv[2] === 'child') { - return child() -} - -var CLOSE = 'close' -if (process.version.match(/^v0\.6/)) { - CLOSE = 'exit' -} - -var spawn = require('child_process').spawn - -tap.test('basic', function (t) { - var child = spawn(process.execPath, [__filename, 'child']) - var output = '' - var write = child.stdin.write.bind(child.stdin) - child.stdout.on('data', function (c) { - console.error('data %s', c) - output += c - if (output.match(/Username: \(test-user\) $/)) { - process.nextTick(write.bind(null, 'a user\n')) - } else if (output.match(/Password: \(<default hidden>\) $/)) { - process.nextTick(write.bind(null, 'a password\n')) - } else if (output.match(/Password again: \(<default hidden>\) $/)) { - process.nextTick(write.bind(null, 'a password\n')) - } else { - console.error('prompts done, output=%j', output) - } - }) - - var result = '' - child.stderr.on('data', function (c) { - result += c - console.error('result %j', c.toString()) - }) - - child.on(CLOSE, function () { - result = JSON.parse(result) - t.same(result, {"user":"a user","pass":"a password","verify":"a password","passMatch":true}) - t.equal(output, 'Username: (test-user) Password: (<default hidden>) Password again: (<default hidden>) ') - t.end() - }) -}) - -function child () { - read({prompt: "Username: ", default: "test-user" }, function (er, user) { - read({prompt: "Password: ", default: "test-pass", silent: true }, function (er, pass) { - read({prompt: "Password again: ", default: "test-pass", silent: true }, function (er, pass2) { - console.error(JSON.stringify({user: user, - pass: pass, - verify: pass2, - passMatch: (pass === pass2)})) - if (process.stdin.unref) - process.stdin.unref() - }) - }) - }) -} diff --git a/node_modules/read/test/defaults.js b/node_modules/read/test/defaults.js deleted file mode 100644 index e3d2ac710..000000000 --- a/node_modules/read/test/defaults.js +++ /dev/null @@ -1,60 +0,0 @@ -var tap = require('tap') -var read = require('../lib/read.js') - -if (process.argv[2] === 'child') { - return child() -} - -var CLOSE = 'close' -if (process.version.match(/^v0\.6/)) { - CLOSE = 'exit' -} - -var spawn = require('child_process').spawn - -tap.test('defaults', function (t) { - var child = spawn(process.execPath, [__filename, 'child']) - var output = '' - var write = child.stdin.write.bind(child.stdin) - child.stdout.on('data', function (c) { - console.error('data %s', c) - output += c - if (output.match(/Username: \(test-user\) $/)) { - process.nextTick(write.bind(null, '\n')) - } else if (output.match(/Password: \(<default hidden>\) $/)) { - process.nextTick(write.bind(null, '\n')) - } else if (output.match(/Password again: \(<default hidden>\) $/)) { - process.nextTick(write.bind(null, '\n')) - } else { - console.error('prompts done, output=%j', output) - } - }) - - var result = '' - child.stderr.on('data', function (c) { - result += c - console.error('result %j', c.toString()) - }) - - child.on(CLOSE, function () { - result = JSON.parse(result) - t.same(result, {"user":"test-user","pass":"test-pass","verify":"test-pass","passMatch":true}) - t.equal(output, 'Username: (test-user) Password: (<default hidden>) Password again: (<default hidden>) ') - t.end() - }) -}) - -function child () { - read({prompt: "Username: ", default: "test-user" }, function (er, user) { - read({prompt: "Password: ", default: "test-pass", silent: true }, function (er, pass) { - read({prompt: "Password again: ", default: "test-pass", silent: true }, function (er, pass2) { - console.error(JSON.stringify({user: user, - pass: pass, - verify: pass2, - passMatch: (pass === pass2)})) - if (process.stdin.unref) - process.stdin.unref() - }) - }) - }) -} diff --git a/node_modules/read/test/many.js b/node_modules/read/test/many.js deleted file mode 100644 index 6a2f87b86..000000000 --- a/node_modules/read/test/many.js +++ /dev/null @@ -1,83 +0,0 @@ -var tap = require('tap') -var read = require('../lib/read.js') - -var CLOSE = 'close' -if (process.version.match(/^v0\.6/)) { - CLOSE = 'exit' -} - -if (process.argv[2] === 'child') { - return child() -} - -var spawn = require('child_process').spawn -function child () { - read({prompt:'1'}, function (er, r1) {if (er) throw er - read({prompt:'2'}, function (er, r2) {if (er) throw er - read({prompt:'3'}, function (er, r3) {if (er) throw er - read({prompt:'4'}, function (er, r4) {if (er) throw er - read({prompt:'5'}, function (er, r5) {if (er) throw er - read({prompt:'6'}, function (er, r6) {if (er) throw er - read({prompt:'7'}, function (er, r7) {if (er) throw er - read({prompt:'8'}, function (er, r8) {if (er) throw er - read({prompt:'9'}, function (er, r9) {if (er) throw er - read({prompt:'10'}, function (er, r10) {if (er) throw er - read({prompt:'11'}, function (er, r11) {if (er) throw er - read({prompt:'12'}, function (er, r12) {if (er) throw er - read({prompt:'13'}, function (er, r13) {if (er) throw er - read({prompt:'14'}, function (er, r14) {if (er) throw er - read({prompt:'15'}, function (er, r15) {if (er) throw er - read({prompt:'16'}, function (er, r16) {if (er) throw er - read({prompt:'17'}, function (er, r17) {if (er) throw er - read({prompt:'18'}, function (er, r18) {if (er) throw er - console.log(r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, - r11, r12, r13, r14, r15, r16, r17, r18) - if (process.stdin.unref) - process.stdin.unref() - })})})})})})})})})})})})})})})})})}) -} - -tap.test('many reads', function (t) { - var child = spawn(process.execPath, [__filename, 'child']) - var n = 0 - var output = '' - var expect = '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ' + - '16 17 18 1 2 3 4 5 6 7 8 9 10 11 12 ' + - '13 14 15 16 17 18\n' - var write = child.stdin.write.bind(child.stdin) - var answers = - [ '1\n', - '2\n', - '3\n', - '4\n', - '5\n', - '6\n', - '7\n', - '8\n', - '9\n', - '10\n', - '11\n', - '12\n', - '13\n', - '14\n', - '15\n', - '16\n', - '17\n', - '18\n' ] - child.stdout.on('data', function (c) { - n++; - output += c - if (answers.length) { - write(answers.shift()) - } - }) - child.stderr.on('data', function (c) { - output += c - console.error('' + c) - }) - child.on(CLOSE, function (c) { - t.equal(output, expect) - t.equal(n, 19) - t.end() - }) -}) |