mirror of https://github.com/lukechilds/node.git
Browse Source
Conflicts: ChangeLog deps/uv/ChangeLog deps/uv/src/unix/stream.c deps/uv/src/version.c deps/v8/build/common.gypi deps/v8/src/frames.h deps/v8/src/runtime.cc deps/v8/test/mjsunit/debug-set-variable-value.js lib/http.js src/node_version.hv0.11.3-release
isaacs
12 years ago
68 changed files with 2187 additions and 96 deletions
@ -0,0 +1,42 @@ |
|||
module.exports = visnup |
|||
var npm = require("./npm.js") |
|||
|
|||
var handsomeFace = [ |
|||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 237, 236, 236, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
|||
,[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 235, 236, 235, 233, 237, 235, 233, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
|||
,[0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 235, 233, 232, 235, 235, 234, 233, 236, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
|||
,[0, 0, 0, 0, 0, 0, 0, 0, 237, 235, 232, 232, 234, 233, 233, 232, 232, 233, 232, 232, 235, 232, 233, 234, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
|||
,[0, 0, 0, 0, 0, 0, 0, 232, 232, 232, 239, 238, 235, 233, 232, 232, 232, 232, 232, 232, 232, 233, 235, 232, 233, 233, 232, 0, 0, 0, 0, 0, 0, 0] |
|||
,[0, 0, 0, 0, 234, 234, 232, 233, 234, 233, 234, 235, 233, 235, 60, 238, 238, 234, 234, 233, 234, 233, 238, 251, 246, 233, 233, 232, 0, 0, 0, 0, 0, 0] |
|||
,[0, 0, 233, 233, 233, 232, 232, 239, 249, 251, 252, 231, 231, 188, 250, 254, 59, 60, 255, 231, 231, 231, 252, 235, 239, 235, 232, 233, 0, 0, 0, 0, 0, 0] |
|||
,[0, 0, 232, 233, 232, 232, 232, 248, 231, 231, 231, 231, 231, 231, 231, 254, 238, 254, 231, 231, 231, 231, 231, 252, 233, 235, 237, 233, 234, 0, 0, 0, 0, 0] |
|||
,[0, 0, 233, 232, 232, 232, 248, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 251, 233, 233, 233, 236, 233, 0, 0, 0, 0] |
|||
,[232, 233, 233, 232, 232, 246, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 249, 233, 234, 234, 0, 0, 0, 0] |
|||
,[232, 232, 232, 232, 233, 249, 231, 255, 255, 255, 255, 254, 109, 60, 239, 237, 238, 237, 235, 235, 235, 235, 236, 235, 235, 235, 234, 232, 232, 232, 232, 232, 233, 0] |
|||
,[0, 232, 232, 233, 233, 233, 233, 233, 233, 233, 233, 233, 235, 236, 238, 238, 235, 188, 254, 254, 145, 236, 252, 254, 254, 254, 254, 249, 236, 235, 232, 232, 233, 0] |
|||
,[0, 0, 233, 237, 249, 239, 233, 252, 231, 231, 231, 231, 231, 231, 254, 235, 235, 254, 231, 231, 251, 235, 237, 231, 231, 231, 231, 7, 237, 235, 232, 233, 233, 0] |
|||
,[0, 0, 0, 0, 233, 248, 239, 233, 231, 231, 231, 231, 254, 233, 233, 235, 254, 255, 231, 254, 237, 236, 254, 239, 235, 235, 233, 233, 232, 232, 233, 232, 0, 0] |
|||
,[0, 0, 0, 232, 233, 246, 255, 255, 236, 236, 236, 236, 236, 255, 231, 231, 231, 231, 231, 231, 252, 234, 248, 231, 231, 231, 231, 248, 232, 232, 232, 0, 0, 0] |
|||
,[0, 0, 0, 0, 235, 237, 7, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 255, 238, 235, 7, 231, 231, 231, 246, 232, 0, 0, 0, 0, 0] |
|||
,[0, 0, 0, 0, 0, 235, 103, 188, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 252, 232, 238, 231, 231, 255, 244, 232, 0, 0, 0, 0, 0] |
|||
,[0, 0, 0, 0, 0, 235, 236, 103, 146, 253, 255, 231, 231, 231, 231, 231, 253, 251, 250, 250, 250, 246, 232, 235, 152, 255, 146, 66, 233, 0, 0, 0, 0, 0] |
|||
,[0, 0, 0, 0, 0, 0, 233, 103, 146, 146, 146, 146, 254, 231, 231, 231, 109, 103, 146, 255, 188, 239, 240, 103, 255, 253, 103, 238, 234, 0, 0, 0, 0, 0] |
|||
,[0, 0, 0, 0, 0, 0, 232, 235, 109, 146, 146, 146, 146, 146, 252, 152, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 103, 235, 233, 0, 0, 0, 0, 0] |
|||
,[0, 0, 0, 0, 0, 0, 0, 235, 235, 103, 146, 146, 146, 146, 146, 146, 188, 188, 188, 188, 188, 188, 152, 146, 146, 146, 66, 235, 0, 0, 0, 0, 0, 0] |
|||
,[0, 0, 0, 0, 0, 0, 0, 0, 233, 235, 66, 146, 146, 146, 146, 152, 255, 146, 240, 239, 241, 109, 146, 146, 146, 103, 233, 0, 0, 0, 0, 0, 0, 0] |
|||
,[0, 0, 0, 0, 0, 0, 0, 0, 0, 234, 237, 109, 146, 146, 146, 146, 146, 254, 231, 231, 188, 146, 146, 146, 103, 233, 0, 0, 0, 0, 0, 0, 0, 0] |
|||
,[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 233, 237, 60, 103, 146, 146, 146, 146, 146, 103, 66, 60, 235, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
|||
,[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 233, 233, 236, 235, 237, 235, 237, 237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]] |
|||
|
|||
|
|||
function visnup (args, cb) { |
|||
handsomeFace.forEach(function (line) { |
|||
console.log(line.map(function (ch) { |
|||
return "\033[" + (ch ? "48;5;" + ch : ch) + "m" |
|||
}).join(' ')) |
|||
}) |
|||
|
|||
var c = args.shift() |
|||
if (c) npm.commands[c](args, cb) |
|||
else cb() |
|||
} |
@ -0,0 +1,158 @@ |
|||
var test = require('tap').test |
|||
|
|||
// simulated ulimit
|
|||
// this is like graceful-fs, but in reverse
|
|||
var fs_ = require('fs') |
|||
var fs = require('../graceful-fs.js') |
|||
var files = fs.readdirSync(__dirname) |
|||
|
|||
// Ok, no more actual file reading!
|
|||
|
|||
var fds = 0 |
|||
var nextFd = 60 |
|||
var limit = 8 |
|||
fs_.open = function (path, flags, mode, cb) { |
|||
process.nextTick(function() { |
|||
++fds |
|||
if (fds >= limit) { |
|||
--fds |
|||
var er = new Error('EMFILE Curses!') |
|||
er.code = 'EMFILE' |
|||
er.path = path |
|||
return cb(er) |
|||
} else { |
|||
cb(null, nextFd++) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
fs_.openSync = function (path, flags, mode) { |
|||
if (fds >= limit) { |
|||
var er = new Error('EMFILE Curses!') |
|||
er.code = 'EMFILE' |
|||
er.path = path |
|||
throw er |
|||
} else { |
|||
++fds |
|||
return nextFd++ |
|||
} |
|||
} |
|||
|
|||
fs_.close = function (fd, cb) { |
|||
process.nextTick(function () { |
|||
--fds |
|||
cb() |
|||
}) |
|||
} |
|||
|
|||
fs_.closeSync = function (fd) { |
|||
--fds |
|||
} |
|||
|
|||
fs_.readdir = function (path, cb) { |
|||
process.nextTick(function() { |
|||
if (fds >= limit) { |
|||
var er = new Error('EMFILE Curses!') |
|||
er.code = 'EMFILE' |
|||
er.path = path |
|||
return cb(er) |
|||
} else { |
|||
++fds |
|||
process.nextTick(function () { |
|||
--fds |
|||
cb(null, [__filename, "some-other-file.js"]) |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
fs_.readdirSync = function (path) { |
|||
if (fds >= limit) { |
|||
var er = new Error('EMFILE Curses!') |
|||
er.code = 'EMFILE' |
|||
er.path = path |
|||
throw er |
|||
} else { |
|||
return [__filename, "some-other-file.js"] |
|||
} |
|||
} |
|||
|
|||
|
|||
test('open emfile autoreduce', function (t) { |
|||
fs.MIN_MAX_OPEN = 4 |
|||
t.equal(fs.MAX_OPEN, 1024) |
|||
|
|||
var max = 12 |
|||
for (var i = 0; i < max; i++) { |
|||
fs.open(__filename, 'r', next(i)) |
|||
} |
|||
|
|||
var phase = 0 |
|||
|
|||
var expect = |
|||
[ [ 0, 60, null, 1024, 4, 12, 1 ], |
|||
[ 1, 61, null, 1024, 4, 12, 2 ], |
|||
[ 2, 62, null, 1024, 4, 12, 3 ], |
|||
[ 3, 63, null, 1024, 4, 12, 4 ], |
|||
[ 4, 64, null, 1024, 4, 12, 5 ], |
|||
[ 5, 65, null, 1024, 4, 12, 6 ], |
|||
[ 6, 66, null, 1024, 4, 12, 7 ], |
|||
[ 7, 67, null, 6, 4, 5, 1 ], |
|||
[ 8, 68, null, 6, 4, 5, 2 ], |
|||
[ 9, 69, null, 6, 4, 5, 3 ], |
|||
[ 10, 70, null, 6, 4, 5, 4 ], |
|||
[ 11, 71, null, 6, 4, 5, 5 ] ] |
|||
|
|||
var actual = [] |
|||
|
|||
function next (i) { return function (er, fd) { |
|||
if (er) |
|||
throw er |
|||
actual.push([i, fd, er, fs.MAX_OPEN, fs.MIN_MAX_OPEN, fs._curOpen, fds]) |
|||
|
|||
if (i === max - 1) { |
|||
t.same(actual, expect) |
|||
t.ok(fs.MAX_OPEN < limit) |
|||
t.end() |
|||
} |
|||
|
|||
fs.close(fd) |
|||
} } |
|||
}) |
|||
|
|||
test('readdir emfile autoreduce', function (t) { |
|||
fs.MAX_OPEN = 1024 |
|||
var max = 12 |
|||
for (var i = 0; i < max; i ++) { |
|||
fs.readdir(__dirname, next(i)) |
|||
} |
|||
|
|||
var expect = |
|||
[ [0,[__filename,"some-other-file.js"],null,7,4,7,7], |
|||
[1,[__filename,"some-other-file.js"],null,7,4,7,6], |
|||
[2,[__filename,"some-other-file.js"],null,7,4,7,5], |
|||
[3,[__filename,"some-other-file.js"],null,7,4,7,4], |
|||
[4,[__filename,"some-other-file.js"],null,7,4,7,3], |
|||
[5,[__filename,"some-other-file.js"],null,7,4,6,2], |
|||
[6,[__filename,"some-other-file.js"],null,7,4,5,1], |
|||
[7,[__filename,"some-other-file.js"],null,7,4,4,0], |
|||
[8,[__filename,"some-other-file.js"],null,7,4,3,3], |
|||
[9,[__filename,"some-other-file.js"],null,7,4,2,2], |
|||
[10,[__filename,"some-other-file.js"],null,7,4,1,1], |
|||
[11,[__filename,"some-other-file.js"],null,7,4,0,0] ] |
|||
|
|||
var actual = [] |
|||
|
|||
function next (i) { return function (er, files) { |
|||
if (er) |
|||
throw er |
|||
var line = [i, files, er, fs.MAX_OPEN, fs.MIN_MAX_OPEN, fs._curOpen, fds ] |
|||
actual.push(line) |
|||
|
|||
if (i === max - 1) { |
|||
t.ok(fs.MAX_OPEN < limit) |
|||
t.same(actual, expect) |
|||
t.end() |
|||
} |
|||
} } |
|||
}) |
@ -0,0 +1 @@ |
|||
/node_modules/ |
@ -0,0 +1,4 @@ |
|||
language: node_js |
|||
node_js: |
|||
- "0.10" |
|||
- "0.8" |
@ -0,0 +1,3 @@ |
|||
# Names sorted by how much code was originally theirs. |
|||
Isaac Z. Schlueter <i@izs.me> |
|||
Meryn Stol <merynstol@gmail.com> |
@ -0,0 +1,30 @@ |
|||
This package contains code originally written by Isaac Z. Schlueter. |
|||
Used with permission. |
|||
|
|||
Copyright (c) Meryn Stol ("Author") |
|||
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 AUTHOR 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 AUTHOR 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. |
@ -0,0 +1,81 @@ |
|||
# normalize-package-data [![Build Status](https://travis-ci.org/meryn/normalize-package-data.png?branch=master)](https://travis-ci.org/meryn/normalize-package-data) |
|||
|
|||
normalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry. |
|||
|
|||
normalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools. |
|||
|
|||
## Installation |
|||
|
|||
``` |
|||
npm install normalize-package-data |
|||
``` |
|||
|
|||
## Usage |
|||
|
|||
Basic usage is really simple. You call the function that normalize-package-data exports. Let's call it `normalizeData`. |
|||
|
|||
```javascript |
|||
normalizeData = require('normalize-package-data') |
|||
packageData = fs.readfileSync("package.json") |
|||
normalizeData(packageData) |
|||
// packageData is now normalized |
|||
``` |
|||
|
|||
Optionally, you may pass a "warning" function. It gets called whenever the normalizeData function encounters something that doesn't look right. It indicates less than perfect input data. |
|||
|
|||
```javascript |
|||
normalizeData = require('normalize-package-data') |
|||
packageData = fs.readfileSync("package.json") |
|||
warnFn = function(msg) { console.error(msg) } |
|||
normalizeData(packageData, warnFn) |
|||
// packageData is now normalized. Any number of warnings may have been logged. |
|||
``` |
|||
|
|||
If you don't provide a warning function, `normalizeData` functions silently. |
|||
|
|||
### Potential exceptions |
|||
|
|||
If the supplied data has an invalid name or version vield, `normalizeData` will throw an error. Depending on where you call `normalizeData`, you may want to catch these errors so can pass them to a callback. |
|||
|
|||
## What normalization (currently) entails |
|||
|
|||
* The value of `name` field gets trimmed. |
|||
* The value of the `version` field gets cleaned by `semver.clean`. See [documentation for the semver module](https://github.com/isaacs/node-semver). |
|||
* If `name` and/or `version` fields are missing, they are set to empty strings. |
|||
* If `files` field is not an array, it will be removed. |
|||
* If `bin` field is a string, then `bin` field will become an object with `name` set to the value of the `name` field, and `bin` set to the original string value. |
|||
* If `man` field is a string, it will become an array with the original string as its sole member. |
|||
* If `keywords` field is string, it is considered to be a list of keywords separated by one or more white-space characters. It gets converted to an array by splitting on `\s+`. |
|||
* All people fields (`author`, `maintainers`, `contributors`) get converted into objects with name, email and url properties. |
|||
* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`. |
|||
* If the value of any of the dependencies fields (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs. |
|||
* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched. |
|||
* If `description` field does not exists, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`. |
|||
* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `"git"`. |
|||
* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value. |
|||
* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen. |
|||
* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed. |
|||
* If `homepage` field is not a string, it will be removed. |
|||
* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`. |
|||
|
|||
### Rules for name field |
|||
|
|||
If `name` field is given, the value of the name field must be a string. The string may not: |
|||
|
|||
* start with a period. |
|||
* contain the following characters: `/@\s+%` |
|||
* contain and characters that would need to be encoded for use in urls. |
|||
* resemble the word `node_modules` or `favicon.ico` (case doesn't matter). |
|||
|
|||
### Rules for version field |
|||
|
|||
If `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver). |
|||
|
|||
## Credits |
|||
|
|||
This package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permisson. |
|||
|
|||
## License |
|||
|
|||
normalize-package-data is released under the [BSD 2-Clause License](http://opensource.org/licenses/MIT). |
|||
Copyright (c) 2013 Meryn Stol |
@ -0,0 +1,13 @@ |
|||
module.exports = extractDescription |
|||
|
|||
// Extracts description from contents of a readme file in markdown format
|
|||
function extractDescription (d) { |
|||
if (!d) return; |
|||
// the first block of text before the first heading
|
|||
// that isn't the first line heading
|
|||
d = d.trim().split('\n') |
|||
for (var s = 0; d[s] && d[s].trim().match(/^(#|$)/); s ++); |
|||
var l = d.length |
|||
for (var e = s + 1; e < l && d[e].trim(); e ++); |
|||
return d.slice(s, e).join(' ').trim() |
|||
} |
@ -0,0 +1,253 @@ |
|||
var semver = require("semver") |
|||
var parseGitHubURL = require("github-url-from-git") |
|||
var depTypes = ["dependencies","devDependencies","optionalDependencies"] |
|||
var extractDescription = require("./extract_description") |
|||
var url = require("url") |
|||
|
|||
var fixer = module.exports = { |
|||
fixRepositoryField: function(data) { |
|||
if (data.repositories) { |
|||
this.warn("'repositories' (plural) Not supported.\n" + |
|||
"Please pick one as the 'repository' field"); |
|||
data.repository = data.repositories[0] |
|||
} |
|||
if (!data.repository) return; |
|||
if (typeof data.repository === "string") { |
|||
data.repository = { |
|||
type: "git", |
|||
url: data.repository |
|||
} |
|||
} |
|||
var r = data.repository.url || "" |
|||
if (r) { |
|||
var ghurl = parseGitHubURL(r) |
|||
if (ghurl) { |
|||
r = ghurl.replace(/^https?:\/\//, 'git://') |
|||
} |
|||
} |
|||
|
|||
if (r.match(/github.com\/[^\/]+\/[^\/]+\.git\.git$/)) { |
|||
this.warn("Probably broken git url: " + r) |
|||
} |
|||
} |
|||
|
|||
, fixFilesField: function(data) { |
|||
var files = data.files |
|||
if (files && !Array.isArray(files)) { |
|||
this.warn("Invalid 'files' member") |
|||
delete data.files |
|||
} |
|||
} |
|||
|
|||
, fixBinField: function(data) { |
|||
if (!data.bin) return; |
|||
if (typeof data.bin === "string") { |
|||
var b = {} |
|||
b[data.name] = data.bin |
|||
data.bin = b |
|||
} |
|||
} |
|||
|
|||
, fixManField: function(data) { |
|||
if (!data.man) return; |
|||
if (typeof data.man === "string") { |
|||
data.man = [ data.man ] |
|||
} |
|||
} |
|||
, fixBundleDependenciesField: function(data) { |
|||
var bdd = "bundledDependencies" |
|||
var bd = "bundleDependencies" |
|||
if (data[bdd] && !data[bd]) { |
|||
data[bd] = data[bdd] |
|||
delete data[bdd] |
|||
} |
|||
} |
|||
|
|||
, fixDependencies: function(data) { |
|||
objectifyDeps(data, this.warn) |
|||
addOptionalDepsToDeps(data, this.warn) |
|||
this.fixBundleDependenciesField(data) |
|||
} |
|||
|
|||
, fixKeywordsField: function (data, warn) { |
|||
if (typeof data.keywords === "string") { |
|||
data.keywords = data.keywords.split(/,\s+/) |
|||
} |
|||
} |
|||
|
|||
, fixVersionField: function(data) { |
|||
if (!data.version) { |
|||
data.version = "" |
|||
return true |
|||
} |
|||
if (!semver.valid(data.version)) { |
|||
throw new Error("invalid version: "+ data.version) |
|||
} |
|||
data.version = semver.clean(data.version) |
|||
return true |
|||
} |
|||
|
|||
, fixPeople: function(data) { |
|||
modifyPeople(data, unParsePerson) |
|||
modifyPeople(data, parsePerson) |
|||
} |
|||
|
|||
, fixNameField: function(data) { |
|||
if (!data.name) { |
|||
data.name = "" |
|||
return true |
|||
} |
|||
if (typeof data.name !== "string") { |
|||
throw new Error("name field must be a string.") |
|||
} |
|||
data.name = data.name.trim() |
|||
ensureValidName(data.name) |
|||
} |
|||
|
|||
|
|||
, fixDescriptionField: function (data) { |
|||
if (data.description && typeof data.description !== 'string') { |
|||
this.warn("'description' field should be a string") |
|||
delete data.description |
|||
} |
|||
if (data.readme && !data.description) |
|||
data.description = extractDescription(data.readme) |
|||
} |
|||
|
|||
, fixReadmeField: function (data) { |
|||
if (!data.readme) data.readme = "ERROR: No README data found!" |
|||
} |
|||
|
|||
, fixBugsField: function(data) { |
|||
if (!data.bugs && data.repository && data.repository.url) { |
|||
var gh = parseGitHubURL(data.repository.url) |
|||
if(gh) { |
|||
if(gh.match(/^https:\/\/github.com\//)) |
|||
data.bugs = {url: gh + "/issues"} |
|||
else // gist url
|
|||
data.bugs = {url: gh} |
|||
} |
|||
} |
|||
else if(data.bugs) { |
|||
var emailRe = /^.+@.*\..+$/ |
|||
if(typeof data.bugs == "string") { |
|||
if(emailRe.test(data.bugs)) |
|||
data.bugs = {email:data.bugs} |
|||
else if(url.parse(data.bugs).protocol) |
|||
data.bugs = {url: data.bugs} |
|||
else |
|||
this.warn("Bug string field must be url, email, or {email,url}") |
|||
} |
|||
else { |
|||
var oldBugs = data.bugs |
|||
data.bugs = {} |
|||
if(oldBugs.url) { |
|||
if(typeof(oldBugs.url) == "string" && url.parse(oldBugs.url).protocol) |
|||
data.bugs.url = oldBugs.url |
|||
else |
|||
this.warn("bugs.url field must be a string url. Deleted.") |
|||
} |
|||
if(oldBugs.email) { |
|||
if(typeof(oldBugs.email) == "string" && emailRe.test(oldBugs.email)) |
|||
data.bugs.email = oldBugs.email |
|||
else |
|||
this.warn("bugs.email field must be a string email. Deleted.") |
|||
} |
|||
} |
|||
if(!data.bugs.email && !data.bugs.url) { |
|||
delete data.bugs |
|||
this.warn("Normalized value of bugs field is an empty object. Deleted.") |
|||
} |
|||
} |
|||
} |
|||
|
|||
, fixHomepageField: function(data) { |
|||
if(!data.homepage) return true; |
|||
if(typeof data.homepage !== "string") { |
|||
this.warn("homepage field must be a string url. Deleted.") |
|||
return delete data.homepage |
|||
} |
|||
if(!url.parse(data.homepage).protocol) { |
|||
this.warn("homepage field must start with a protocol.") |
|||
data.homepage = "http://" + data.homepage |
|||
} |
|||
} |
|||
} |
|||
|
|||
function ensureValidName (name) { |
|||
if (name.charAt(0) === "." || |
|||
name.match(/[\/@\s\+%:]/) || |
|||
name !== encodeURIComponent(name) || |
|||
name.toLowerCase() === "node_modules" || |
|||
name.toLowerCase() === "favicon.ico") { |
|||
throw new Error("Invalid name: " + JSON.stringify(name)) |
|||
} |
|||
} |
|||
|
|||
function modifyPeople (data, fn) { |
|||
if (data.author) data.author = fn(data.author) |
|||
;["maintainers", "contributors"].forEach(function (set) { |
|||
if (!Array.isArray(data[set])) return; |
|||
data[set] = data[set].map(fn) |
|||
}) |
|||
return data |
|||
} |
|||
|
|||
function unParsePerson (person) { |
|||
if (typeof person === "string") return person |
|||
var name = person.name || "" |
|||
var u = person.url || person.web |
|||
var url = u ? (" ("+u+")") : "" |
|||
var e = person.email || person.mail |
|||
var email = e ? (" <"+e+">") : "" |
|||
return name+email+url |
|||
} |
|||
|
|||
function parsePerson (person) { |
|||
if (typeof person !== "string") return person |
|||
var name = person.match(/^([^\(<]+)/) |
|||
var url = person.match(/\(([^\)]+)\)/) |
|||
var email = person.match(/<([^>]+)>/) |
|||
var obj = {} |
|||
if (name && name[0].trim()) obj.name = name[0].trim() |
|||
if (email) obj.email = email[1]; |
|||
if (url) obj.url = url[1]; |
|||
return obj |
|||
} |
|||
|
|||
function addOptionalDepsToDeps (data, warn) { |
|||
var o = data.optionalDependencies |
|||
if (!o) return; |
|||
var d = data.dependencies || {} |
|||
Object.keys(o).forEach(function (k) { |
|||
d[k] = o[k] |
|||
}) |
|||
data.dependencies = d |
|||
} |
|||
|
|||
function depObjectify (deps) { |
|||
if (!deps) return {} |
|||
if (typeof deps === "string") { |
|||
deps = deps.trim().split(/[\n\r\s\t ,]+/) |
|||
} |
|||
if (!Array.isArray(deps)) return deps |
|||
var o = {} |
|||
deps.filter(function (d) { |
|||
return typeof d === "string" |
|||
}).forEach(function(d) { |
|||
d = d.trim().split(/(:?[@\s><=])/) |
|||
var dn = d.shift() |
|||
var dv = d.join("") |
|||
dv = dv.trim() |
|||
dv = dv.replace(/^@/, "") |
|||
o[dn] = dv |
|||
}) |
|||
return o |
|||
} |
|||
|
|||
function objectifyDeps (data, warn) { |
|||
depTypes.forEach(function (type) { |
|||
if (!data[type]) return; |
|||
data[type] = depObjectify(data[type]) |
|||
}) |
|||
} |
@ -0,0 +1,58 @@ |
|||
// a warning for deprecated or likely-incorrect fields
|
|||
|
|||
module.exports = isValid |
|||
|
|||
var typos = require("./typos") |
|||
|
|||
function isValid (data, warnFunc) { |
|||
var hasWarned = false |
|||
function warn(msg) { |
|||
hasWarned = true |
|||
if(warnFunc) warnFunc(msg) |
|||
} |
|||
if (data.modules) warn("'modules' is deprecated") |
|||
Object.keys(typos.topLevel).forEach(function (d) { |
|||
if (data.hasOwnProperty(d)) { |
|||
warn(makeTypoWarning(d, typos.topLevel[d])) |
|||
} |
|||
}) |
|||
checkBugsField(data.bugs, warn) |
|||
checkScriptsField(data.scripts, warn) |
|||
if (!data.repository) warn("No repository field.") |
|||
if (!data.readme) warn("No readme data.") |
|||
if (data.description && typeof data.description !== 'string') { |
|||
warn("'description' field should be a string") |
|||
} |
|||
if (data[data.bundledDependencies] && |
|||
!Array.isArray(data.bundleDependencies)) { |
|||
warn("bundleDependencies must be an array") |
|||
} |
|||
return !hasWarned |
|||
} |
|||
|
|||
function checkBugsField (bugs, warn) { |
|||
if (!bugs || typeof bugs !== "object") return |
|||
Object.keys(bugs).forEach(function (k) { |
|||
if (typos.bugs[k]) { |
|||
bugs[typos.bugs[k]] = bugs[k] |
|||
delete bugs[k] |
|||
} |
|||
}) |
|||
} |
|||
|
|||
function checkScriptsField (scripts, warn) { |
|||
if (!scripts || typeof scripts !== "object") return |
|||
Object.keys(scripts).forEach(function (k) { |
|||
if (typos.script[k]) { |
|||
warn(makeTypoWarning(k, typos.script[k], "scripts")) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
function makeTypoWarning (providedName, probableName, field) { |
|||
if (field) { |
|||
providedName = field + "['" + providedName + "']" |
|||
probableName = field + "['" + probableName + "']" |
|||
} |
|||
return providedName + " should probably be " + probableName + "." |
|||
} |
@ -0,0 +1,36 @@ |
|||
module.exports = normalize |
|||
|
|||
var isValid = require("./is_valid") |
|||
var fixer = require("./fixer") |
|||
|
|||
var fieldsToFix = ['name','version','description','repository' |
|||
,'files','bin','man','bugs','keywords','readme','homepage'] |
|||
var otherThingsToFix = ['dependencies','people'] |
|||
|
|||
var thingsToFix = fieldsToFix.map(function(fieldName) { |
|||
return ucFirst(fieldName) + "Field" |
|||
}) |
|||
// two ways to do this in CoffeeScript on only one line, sub-70 chars:
|
|||
// thingsToFix = fieldsToFix.map (name) -> ucFirst(name) + "Field"
|
|||
// thingsToFix = (ucFirst(name) + "Field" for name in fieldsToFix)
|
|||
thingsToFix = thingsToFix.concat(otherThingsToFix) |
|||
|
|||
function normalize (data, warn) { |
|||
if(!warn) warn = function(msg) { /* noop */ } |
|||
isValid(data, warn) // don't care if it's valid, we'll make it valid
|
|||
if (data.scripts && |
|||
data.scripts.install === "node-gyp rebuild" && |
|||
!data.scripts.preinstall) { |
|||
data.gypfile = true |
|||
} |
|||
fixer.warn = warn |
|||
thingsToFix.forEach(function(thingName) { |
|||
fixer["fix" + ucFirst(thingName)](data) |
|||
}) |
|||
data._id = data.name + "@" + data.version |
|||
if (data.modules) delete data.modules // modules field is deprecated
|
|||
} |
|||
|
|||
function ucFirst (string) { |
|||
return string.charAt(0).toUpperCase() + string.slice(1); |
|||
} |
@ -0,0 +1,23 @@ |
|||
{ |
|||
"topLevel": { |
|||
"dependancies": "dependencies" |
|||
,"dependecies": "dependencies" |
|||
,"depdenencies": "dependencies" |
|||
,"devEependencies": "devDependencies" |
|||
,"depends": "dependencies" |
|||
,"dev-dependencies": "devDependencies" |
|||
,"devDependences": "devDependencies" |
|||
,"devDepenencies": "devDependencies" |
|||
,"devdependencies": "devDependencies" |
|||
,"repostitory": "repository" |
|||
,"prefereGlobal": "preferGlobal" |
|||
,"hompage": "homepage" |
|||
,"hampage": "homepage" |
|||
,"autohr": "author" |
|||
,"autor": "author" |
|||
,"contributers": "contributors" |
|||
,"publicationConfig": "publishConfig" |
|||
}, |
|||
"bugs": { "web": "url", "name": "url" }, |
|||
"script": { "server": "start", "tests": "test" } |
|||
} |
@ -0,0 +1 @@ |
|||
node_modules |
@ -0,0 +1,10 @@ |
|||
|
|||
1.1.1 / 2013-04-23 |
|||
================== |
|||
|
|||
* package.json: Move test stuff to devDeps |
|||
|
|||
1.1.0 / 2013-04-19 |
|||
================== |
|||
|
|||
* Add support for gist urls |
@ -0,0 +1,5 @@ |
|||
|
|||
test: |
|||
@./node_modules/.bin/mocha test.js --reporter spec --require should |
|||
|
|||
.PHONY: test |
@ -0,0 +1,41 @@ |
|||
|
|||
# github-url-from-git |
|||
|
|||
```js |
|||
describe('parse(url)', function(){ |
|||
it('should support git://*', function(){ |
|||
var url = 'git://github.com/jamesor/mongoose-versioner'; |
|||
parse(url).should.equal('https://github.com/jamesor/mongoose-versioner'); |
|||
}) |
|||
|
|||
it('should support git://*.git', function(){ |
|||
var url = 'git://github.com/treygriffith/cellar.git'; |
|||
parse(url).should.equal('https://github.com/treygriffith/cellar'); |
|||
}) |
|||
|
|||
it('should support https://*', function(){ |
|||
var url = 'https://github.com/Empeeric/i18n-node'; |
|||
parse(url).should.equal('https://github.com/Empeeric/i18n-node'); |
|||
}) |
|||
|
|||
it('should support https://*.git', function(){ |
|||
var url = 'https://jpillora@github.com/banchee/tranquil.git'; |
|||
parse(url).should.equal('https://github.com/banchee/tranquil'); |
|||
}) |
|||
|
|||
it('should return undefined on failure', function(){ |
|||
var url = 'git://github.com/justgord/.git'; |
|||
assert(null == parse(url)); |
|||
}) |
|||
|
|||
it('should parse git@gist urls', function() { |
|||
var url = 'git@gist.github.com:3135914.git'; |
|||
parse(url).should.equal('https://gist.github.com/3135914') |
|||
}) |
|||
|
|||
it('should parse https://gist urls', function() { |
|||
var url = 'https://gist.github.com/3135914.git'; |
|||
parse(url).should.equal('https://gist.github.com/3135914') |
|||
}) |
|||
}) |
|||
``` |
@ -0,0 +1,12 @@ |
|||
var re = /^(?:https?:\/\/|git:\/\/)?(?:[^@]+@)?(gist.github.com|github.com)[:\/]([^\/]+\/[^\/]+?|[0-9]+)$/ |
|||
|
|||
module.exports = function(url){ |
|||
try { |
|||
var m = re.exec(url.replace(/\.git$/, '')); |
|||
var host = m[1]; |
|||
var path = m[2]; |
|||
return 'https://' + host + '/' + path; |
|||
} catch (err) { |
|||
// ignore
|
|||
} |
|||
}; |
@ -0,0 +1,27 @@ |
|||
{ |
|||
"name": "github-url-from-git", |
|||
"version": "1.1.1", |
|||
"description": "Parse a github git url and return the github repo url", |
|||
"main": "index.js", |
|||
"scripts": { |
|||
"test": "mocha test.js --reporter spec --require should" |
|||
}, |
|||
"repository": "", |
|||
"keywords": [ |
|||
"github", |
|||
"git", |
|||
"url", |
|||
"parser" |
|||
], |
|||
"author": "", |
|||
"license": "MIT", |
|||
"devDependencies": { |
|||
"better-assert": "~1.0.0", |
|||
"mocha": "~1.9.0", |
|||
"should": "~1.2.2" |
|||
}, |
|||
"readme": "\n# github-url-from-git\n\n```js\ndescribe('parse(url)', function(){\n it('should support git://*', function(){\n var url = 'git://github.com/jamesor/mongoose-versioner';\n parse(url).should.equal('https://github.com/jamesor/mongoose-versioner');\n })\n\n it('should support git://*.git', function(){\n var url = 'git://github.com/treygriffith/cellar.git';\n parse(url).should.equal('https://github.com/treygriffith/cellar');\n })\n\n it('should support https://*', function(){\n var url = 'https://github.com/Empeeric/i18n-node';\n parse(url).should.equal('https://github.com/Empeeric/i18n-node');\n })\n\n it('should support https://*.git', function(){\n var url = 'https://jpillora@github.com/banchee/tranquil.git';\n parse(url).should.equal('https://github.com/banchee/tranquil');\n })\n\n it('should return undefined on failure', function(){\n var url = 'git://github.com/justgord/.git';\n assert(null == parse(url));\n })\n\n it('should parse git@gist urls', function() {\n var url = 'git@gist.github.com:3135914.git';\n parse(url).should.equal('https://gist.github.com/3135914')\n })\n\n it('should parse https://gist urls', function() {\n var url = 'https://gist.github.com/3135914.git';\n parse(url).should.equal('https://gist.github.com/3135914')\n })\n})\n```\n", |
|||
"readmeFilename": "Readme.md", |
|||
"_id": "github-url-from-git@1.1.1", |
|||
"_from": "github-url-from-git@~1.1.1" |
|||
} |
@ -0,0 +1,40 @@ |
|||
|
|||
var parse = require('./'); |
|||
var assert = require('better-assert'); |
|||
|
|||
describe('parse(url)', function(){ |
|||
it('should support git://*', function(){ |
|||
var url = 'git://github.com/jamesor/mongoose-versioner'; |
|||
parse(url).should.equal('https://github.com/jamesor/mongoose-versioner'); |
|||
}) |
|||
|
|||
it('should support git://*.git', function(){ |
|||
var url = 'git://github.com/treygriffith/cellar.git'; |
|||
parse(url).should.equal('https://github.com/treygriffith/cellar'); |
|||
}) |
|||
|
|||
it('should support https://*', function(){ |
|||
var url = 'https://github.com/Empeeric/i18n-node'; |
|||
parse(url).should.equal('https://github.com/Empeeric/i18n-node'); |
|||
}) |
|||
|
|||
it('should support https://*.git', function(){ |
|||
var url = 'https://jpillora@github.com/banchee/tranquil.git'; |
|||
parse(url).should.equal('https://github.com/banchee/tranquil'); |
|||
}) |
|||
|
|||
it('should return undefined on failure', function(){ |
|||
var url = 'git://github.com/justgord/.git'; |
|||
assert(null == parse(url)); |
|||
}) |
|||
|
|||
it('should parse git@gist urls', function() { |
|||
var url = 'git@gist.github.com:3135914.git'; |
|||
parse(url).should.equal('https://gist.github.com/3135914') |
|||
}) |
|||
|
|||
it('should parse https://gist urls', function() { |
|||
var url = 'https://gist.github.com/3135914.git'; |
|||
parse(url).should.equal('https://gist.github.com/3135914') |
|||
}) |
|||
}) |
File diff suppressed because one or more lines are too long
@ -0,0 +1,34 @@ |
|||
var tap = require("tap") |
|||
var normalize = require("../lib/normalize") |
|||
var path = require("path") |
|||
var fs = require("fs") |
|||
|
|||
tap.test("basic test", function (t) { |
|||
var p = path.resolve(__dirname, "./fixtures/read-package-json.json") |
|||
fs.readFile (p, function (err, contents) { |
|||
if (err) throw err; |
|||
var originalData = JSON.parse(contents.toString()) |
|||
var data = JSON.parse(contents.toString()) |
|||
normalize(data) |
|||
t.ok(data) |
|||
verifyFields(t, data, originalData) |
|||
t.end() |
|||
}) |
|||
}) |
|||
|
|||
function verifyFields (t, normalized, original) { |
|||
t.equal(normalized.version, original.version, "Version field stays same") |
|||
t.equal(normalized._id, normalized.name + "@" + normalized.version, "It gets good id.") |
|||
t.equal(normalized.name, original.name, "Name stays the same.") |
|||
t.type(normalized.author, "object", "author field becomes object") |
|||
t.deepEqual(normalized.scripts, original.scripts, "scripts field (object) stays same") |
|||
t.equal(normalized.main, original.main) |
|||
// optional deps are folded in.
|
|||
t.deepEqual(normalized.optionalDependencies, |
|||
original.optionalDependencies) |
|||
t.has(normalized.dependencies, original.optionalDependencies, "opt depedencies are copied into dependencies") |
|||
t.has(normalized.dependencies, original.dependencies, "regular depedencies stay in place") |
|||
t.deepEqual(normalized.devDependencies, original.devDependencies) |
|||
t.type(normalized.bugs, "object", "bugs should become object") |
|||
t.equal(normalized.bugs.url, "https://github.com/isaacs/read-package-json/issues") |
|||
} |
@ -0,0 +1,36 @@ |
|||
var tap = require("tap") |
|||
var normalize = require("../lib/normalize") |
|||
var path = require("path") |
|||
var fs = require("fs") |
|||
var _ = require("underscore") |
|||
var async = require("async") |
|||
|
|||
var data, clonedData |
|||
var warn |
|||
|
|||
tap.test("consistent normalization", function(t) { |
|||
path.resolve(__dirname, "./fixtures/read-package-json.json") |
|||
fs.readdir (__dirname + "/fixtures", function (err, entries) { |
|||
// entries = ['coffee-script.json'] // uncomment to limit to a specific file
|
|||
verifyConsistency = function(entryName, next) { |
|||
warn = function(msg) { |
|||
// t.equal("",msg) // uncomment to have some kind of logging of warnings
|
|||
} |
|||
filename = __dirname + "/fixtures/" + entryName |
|||
fs.readFile(filename, function(err, contents) { |
|||
if (err) return next(err) |
|||
data = JSON.parse(contents.toString()) |
|||
normalize(data, warn) |
|||
clonedData = _.clone(data) |
|||
normalize(data, warn) |
|||
t.deepEqual(clonedData, data, |
|||
"Normalization of " + entryName + "is consistent.") |
|||
next(null) |
|||
}) // fs.readFile
|
|||
} // verifyConsistency
|
|||
async.forEach(entries, verifyConsistency, function(err) { |
|||
if (err) throw err |
|||
t.end() |
|||
}) |
|||
}) // fs.readdir
|
|||
}) // tap.test
|
@ -0,0 +1,36 @@ |
|||
{ |
|||
"name": "async", |
|||
"description": "Higher-order functions and common patterns for asynchronous code", |
|||
"main": "./lib/async", |
|||
"author": "Caolan McMahon", |
|||
"version": "0.2.6", |
|||
"repository" : { |
|||
"type" : "git", |
|||
"url" : "http://github.com/caolan/async.git" |
|||
}, |
|||
"bugs" : { |
|||
"url" : "http://github.com/caolan/async/issues" |
|||
}, |
|||
"licenses" : [ |
|||
{ |
|||
"type" : "MIT", |
|||
"url" : "http://github.com/caolan/async/raw/master/LICENSE" |
|||
} |
|||
], |
|||
"devDependencies": { |
|||
"nodeunit": ">0.0.0", |
|||
"uglify-js": "1.2.x", |
|||
"nodelint": ">0.0.0" |
|||
}, |
|||
"jam": { |
|||
"main": "lib/async.js", |
|||
"include": [ |
|||
"lib/async.js", |
|||
"README.md", |
|||
"LICENSE" |
|||
] |
|||
}, |
|||
"scripts": { |
|||
"test": "nodeunit test/test-async.js" |
|||
} |
|||
} |
@ -0,0 +1,56 @@ |
|||
{ |
|||
"name": "bcrypt", |
|||
"description": "A bcrypt library for NodeJS.", |
|||
"keywords": [ |
|||
"bcrypt", |
|||
"password", |
|||
"auth", |
|||
"authentication", |
|||
"encryption", |
|||
"crypt", |
|||
"crypto" |
|||
], |
|||
"main": "./bcrypt", |
|||
"version": "0.7.5", |
|||
"author": "Nick Campbell (http://github.com/ncb000gt)", |
|||
"engines": { |
|||
"node": ">= 0.6.0" |
|||
}, |
|||
"repository": { |
|||
"type": "git", |
|||
"url": "http://github.com/ncb000gt/node.bcrypt.js.git" |
|||
}, |
|||
"licenses": [ |
|||
{ |
|||
"type": "MIT" |
|||
} |
|||
], |
|||
"bugs": { |
|||
"url": "http://github.com/ncb000gt/node.bcrypt.js/issues" |
|||
}, |
|||
"scripts": { |
|||
"test": "node-gyp configure build && nodeunit test" |
|||
}, |
|||
"dependencies": { |
|||
"bindings": "1.0.0" |
|||
}, |
|||
"devDependencies": { |
|||
"nodeunit": ">=0.6.4" |
|||
}, |
|||
"contributors": [ |
|||
"Antonio Salazar Cardozo <savedfastcool@gmail.com> (https://github.com/Shadowfiend)", |
|||
"Van Nguyen <the.gol.effect@gmail.com> (https://github.com/thegoleffect)", |
|||
"David Trejo <david@dtrejo.com> (https://github.com/dtrejo)", |
|||
"Ben Glow <glen.low@pixelglow.com> (https://github.com/pixelglow)", |
|||
"NewITFarmer.com <> (https://github.com/newitfarmer)", |
|||
"Alfred Westerveld <alfredwesterveld@gmail.com> (https://github.com/alfredwesterveld)", |
|||
"Vincent Côté-Roy <vincentcr@gmail.com> (https://github.com/vincentcr)", |
|||
"Lloyd Hilaiel <lloyd@hilaiel.com> (https://github.com/lloyd)", |
|||
"Roman Shtylman <shtylman@gmail.com> (https://github.com/shtylman)", |
|||
"Vadim Graboys <dimva13@gmail.com> (https://github.com/vadimg)", |
|||
"Ben Noorduis <> (https://github.com/bnoordhuis)", |
|||
"Nate Rajlich <nathan@tootallnate.net> (https://github.com/tootallnate)", |
|||
"Sean McArthur <sean.monstar@gmail.com> (https://github.com/seanmonstar)", |
|||
"Fanie Oosthuysen <fanie.oosthuysen@gmail.com> (https://github.com/weareu)" |
|||
] |
|||
} |
@ -0,0 +1,35 @@ |
|||
{ |
|||
"name": "coffee-script", |
|||
"description": "Unfancy JavaScript", |
|||
"keywords": ["javascript", "language", "coffeescript", "compiler"], |
|||
"author": "Jeremy Ashkenas", |
|||
"version": "1.6.2", |
|||
"licenses": [{ |
|||
"type": "MIT", |
|||
"url": "https://raw.github.com/jashkenas/coffee-script/master/LICENSE" |
|||
}], |
|||
"engines": { |
|||
"node": ">=0.8.0" |
|||
}, |
|||
"directories" : { |
|||
"lib" : "./lib/coffee-script" |
|||
}, |
|||
"main" : "./lib/coffee-script/coffee-script", |
|||
"bin": { |
|||
"coffee": "./bin/coffee", |
|||
"cake": "./bin/cake" |
|||
}, |
|||
"scripts": { |
|||
"test": "node ./bin/cake test" |
|||
}, |
|||
"homepage": "http://coffeescript.org", |
|||
"bugs": "https://github.com/jashkenas/coffee-script/issues", |
|||
"repository": { |
|||
"type": "git", |
|||
"url": "git://github.com/jashkenas/coffee-script.git" |
|||
}, |
|||
"devDependencies": { |
|||
"uglify-js": "~2.2", |
|||
"jison": ">=0.2.0" |
|||
} |
|||
} |
@ -0,0 +1,53 @@ |
|||
{ |
|||
"name": "http-server", |
|||
"preferGlobal": true, |
|||
"version": "0.3.0", |
|||
"author": "Nodejitsu <support@nodejitsu.com>", |
|||
"description": "a simple zero-configuration command-line http server", |
|||
"contributors": [ |
|||
{ |
|||
"name": "Marak Squires", |
|||
"email": "marak@nodejitsu.com" |
|||
} |
|||
], |
|||
"bin": { |
|||
"http-server": "./bin/http-server" |
|||
}, |
|||
"scripts": { |
|||
"start": "node ./bin/http-server", |
|||
"test": "vows --spec --isolate", |
|||
"predeploy": "echo This will be run before deploying the app", |
|||
"postdeploy": "echo This will be run after deploying the app" |
|||
}, |
|||
"main": "./lib/http-server", |
|||
"repository": { |
|||
"type": "git", |
|||
"url": "https://github.com/nodejitsu/http-server.git" |
|||
}, |
|||
"keywords": [ |
|||
"cli", |
|||
"http", |
|||
"server" |
|||
], |
|||
"dependencies" : { |
|||
"colors" : "*", |
|||
"flatiron" : "0.1.x", |
|||
"optimist" : "0.2.x", |
|||
"union" : "0.1.x", |
|||
"ecstatic" : "0.1.x", |
|||
"plates" : "https://github.com/flatiron/plates/tarball/master" |
|||
}, |
|||
"analyze": false, |
|||
"devDependencies": { |
|||
"vows" : "0.5.x", |
|||
"request" : "2.1.x" |
|||
}, |
|||
"bundledDependencies": [ |
|||
"union", |
|||
"ecstatic" |
|||
], |
|||
"license": "MIT", |
|||
"engines": { |
|||
"node": ">=0.6" |
|||
} |
|||
} |
@ -0,0 +1,21 @@ |
|||
{ |
|||
"name": "movefile", |
|||
"description": "rename implementation working over devices", |
|||
"version": "0.2.0", |
|||
"author": "yazgazan <yazgazan@gmail.com>", |
|||
"main": "./build/Release/movefile", |
|||
"keywords": ["move", "file", "rename"], |
|||
"repository": "git://github.com/yazgazan/movefile.git", |
|||
"directories": { |
|||
"lib": "./build/Release/" |
|||
}, |
|||
"scripts": { |
|||
"install": "./node_modules/node-gyp/bin/node-gyp.js configure && ./node_modules/node-gyp/bin/node-gyp.js build" |
|||
}, |
|||
"engines": { |
|||
"node": "*" |
|||
}, |
|||
"dependencies": { |
|||
"node-gyp": "~0.9.1" |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
{ |
|||
"name": "node-module_exist", |
|||
"description": "Find if a NodeJS module is available to require or not", |
|||
"version": "0.0.1", |
|||
"main": "module_exist.js", |
|||
"scripts": { |
|||
"test": "echo \"Error: no test specified\" && exit 1" |
|||
}, |
|||
"repository": { |
|||
"type": "git", |
|||
"url": "git@gist.github.com:3135914.git" |
|||
}, |
|||
"homepage": "https://github.com/FGRibreau", |
|||
"author": { |
|||
"name": "Francois-Guillaume Ribreau", |
|||
"url": "http://fgribreau.com.com/" |
|||
}, |
|||
"devDependencies": { |
|||
"nodeunit": "~0.7.4" |
|||
}, |
|||
"keywords": [ |
|||
"core", |
|||
"modules" |
|||
], |
|||
"license": "MIT" |
|||
} |
@ -0,0 +1,135 @@ |
|||
{ |
|||
"version": "1.2.17", |
|||
"name": "npm", |
|||
"publishConfig": { |
|||
"proprietary-attribs": false |
|||
}, |
|||
"description": "A package manager for node", |
|||
"keywords": [ |
|||
"package manager", |
|||
"modules", |
|||
"install", |
|||
"package.json" |
|||
], |
|||
"preferGlobal": true, |
|||
"config": { |
|||
"publishtest": false |
|||
}, |
|||
"homepage": "https://npmjs.org/doc/", |
|||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)", |
|||
"repository": { |
|||
"type": "git", |
|||
"url": "https://github.com/isaacs/npm" |
|||
}, |
|||
"bugs": { |
|||
"email": "npm-@googlegroups.com", |
|||
"url": "http://github.com/isaacs/npm/issues" |
|||
}, |
|||
"directories": { |
|||
"doc": "./doc", |
|||
"man": "./man", |
|||
"lib": "./lib", |
|||
"bin": "./bin" |
|||
}, |
|||
"main": "./lib/npm.js", |
|||
"bin": "./bin/npm-cli.js", |
|||
"dependencies": { |
|||
"semver": "~1.1.2", |
|||
"ini": "~1.1.0", |
|||
"slide": "1", |
|||
"abbrev": "~1.0.4", |
|||
"graceful-fs": "~1.2.0", |
|||
"minimatch": "~0.2.11", |
|||
"nopt": "~2.1.1", |
|||
"rimraf": "2", |
|||
"request": "~2.9", |
|||
"which": "1", |
|||
"tar": "~0.1.17", |
|||
"fstream": "~0.1.22", |
|||
"block-stream": "*", |
|||
"inherits": "1", |
|||
"mkdirp": "~0.3.3", |
|||
"read": "~1.0.4", |
|||
"lru-cache": "~2.3.0", |
|||
"node-gyp": "~0.9.3", |
|||
"fstream-npm": "~0.1.3", |
|||
"uid-number": "0", |
|||
"archy": "0", |
|||
"chownr": "0", |
|||
"npmlog": "0", |
|||
"ansi": "~0.1.2", |
|||
"npm-registry-client": "~0.2.18", |
|||
"read-package-json": "~0.3.0", |
|||
"read-installed": "0", |
|||
"glob": "~3.1.21", |
|||
"init-package-json": "0.0.6", |
|||
"osenv": "0", |
|||
"lockfile": "~0.3.0", |
|||
"retry": "~0.6.0", |
|||
"once": "~1.1.1", |
|||
"npmconf": "0", |
|||
"opener": "~1.3.0", |
|||
"chmodr": "~0.1.0", |
|||
"cmd-shim": "~1.1.0" |
|||
}, |
|||
"bundleDependencies": [ |
|||
"semver", |
|||
"ini", |
|||
"slide", |
|||
"abbrev", |
|||
"graceful-fs", |
|||
"minimatch", |
|||
"nopt", |
|||
"rimraf", |
|||
"request", |
|||
"which", |
|||
"tar", |
|||
"fstream", |
|||
"block-stream", |
|||
"inherits", |
|||
"mkdirp", |
|||
"read", |
|||
"lru-cache", |
|||
"node-gyp", |
|||
"fstream-npm", |
|||
"uid-number", |
|||
"archy", |
|||
"chownr", |
|||
"npmlog", |
|||
"ansi", |
|||
"npm-registry-client", |
|||
"read-package-json", |
|||
"read-installed", |
|||
"glob", |
|||
"init-package-json", |
|||
"osenv", |
|||
"lockfile", |
|||
"retry", |
|||
"once", |
|||
"npmconf", |
|||
"opener", |
|||
"chmodr", |
|||
"cmd-shim" |
|||
], |
|||
"devDependencies": { |
|||
"ronn": "~0.3.6", |
|||
"tap": "~0.4.0" |
|||
}, |
|||
"engines": { |
|||
"node": ">=0.6", |
|||
"npm": "1" |
|||
}, |
|||
"scripts": { |
|||
"test": "node ./test/run.js && tap test/tap/*.js", |
|||
"tap": "tap test/tap/*.js", |
|||
"prepublish": "node bin/npm-cli.js prune ; rm -rf test/*/*/node_modules ; make -j4 doc", |
|||
"dumpconf": "env | grep npm | sort | uniq", |
|||
"echo": "node bin/npm-cli.js" |
|||
}, |
|||
"licenses": [ |
|||
{ |
|||
"type": "MIT +no-false-attribs", |
|||
"url": "https://github.com/isaacs/npm/raw/master/LICENSE" |
|||
} |
|||
] |
|||
} |
@ -0,0 +1,27 @@ |
|||
{ |
|||
"name": "read-package-json", |
|||
"version": "0.1.1", |
|||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)", |
|||
"description": "The thing npm uses to read package.json files with semantics and defaults and validation", |
|||
"repository": { |
|||
"type": "git", |
|||
"url": "git://github.com/isaacs/read-package-json.git" |
|||
}, |
|||
"main": "read-json.js", |
|||
"scripts": { |
|||
"test": "tap test/*.js" |
|||
}, |
|||
"dependencies": { |
|||
"glob": "~3.1.9", |
|||
"lru-cache": "~1.1.0", |
|||
"semver": "~1.0.14", |
|||
"slide": "~1.1.3" |
|||
}, |
|||
"devDependencies": { |
|||
"tap": "~0.2.5" |
|||
}, |
|||
"optionalDependencies": { |
|||
"npmlog": "0", |
|||
"graceful-fs": "~1.1.8" |
|||
} |
|||
} |
@ -0,0 +1,39 @@ |
|||
{ |
|||
"name": "request", |
|||
"description": "Simplified HTTP request client.", |
|||
"tags": [ |
|||
"http", |
|||
"simple", |
|||
"util", |
|||
"utility" |
|||
], |
|||
"version": "2.16.7", |
|||
"author": "Mikeal Rogers <mikeal.rogers@gmail.com>", |
|||
"repository": { |
|||
"type": "git", |
|||
"url": "http://github.com/mikeal/request.git" |
|||
}, |
|||
"bugs": { |
|||
"url": "http://github.com/mikeal/request/issues" |
|||
}, |
|||
"engines": [ |
|||
"node >= 0.8.0" |
|||
], |
|||
"main": "index.js", |
|||
"dependencies": { |
|||
"form-data": "~0.0.3", |
|||
"mime": "~1.2.7", |
|||
"hawk": "~0.10.2", |
|||
"node-uuid": "~1.4.0", |
|||
"cookie-jar": "~0.2.0", |
|||
"aws-sign": "~0.2.0", |
|||
"oauth-sign": "~0.2.0", |
|||
"forever-agent": "~0.2.0", |
|||
"tunnel-agent": "~0.2.0", |
|||
"json-stringify-safe": "~3.0.0", |
|||
"qs": "~0.5.4" |
|||
}, |
|||
"scripts": { |
|||
"test": "node tests/run.js" |
|||
} |
|||
} |
@ -0,0 +1,17 @@ |
|||
{ |
|||
"name" : "underscore", |
|||
"description" : "JavaScript's functional programming helper library.", |
|||
"homepage" : "http://underscorejs.org", |
|||
"keywords" : ["util", "functional", "server", "client", "browser"], |
|||
"author" : "Jeremy Ashkenas <jeremy@documentcloud.org>", |
|||
"repository" : {"type": "git", "url": "git://github.com/documentcloud/underscore.git"}, |
|||
"main" : "underscore.js", |
|||
"version" : "1.4.4", |
|||
"devDependencies": { |
|||
"phantomjs": "1.9.0-1" |
|||
}, |
|||
"scripts": { |
|||
"test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true" |
|||
}, |
|||
"license" : "MIT" |
|||
} |
@ -0,0 +1,46 @@ |
|||
var tap = require("tap") |
|||
var normalize = require("../lib/normalize") |
|||
var path = require("path") |
|||
var fs = require("fs") |
|||
var _ = require("underscore") |
|||
var async = require("async") |
|||
|
|||
var data, clonedData |
|||
var warn |
|||
|
|||
tap.test("consistent normalization", function(t) { |
|||
entries = [ |
|||
'read-package-json.json', |
|||
'http-server.json', |
|||
"movefile.json", |
|||
"node-module_exist.json" |
|||
] |
|||
verifyConsistency = function(entryName, next) { |
|||
warn = function(msg) { |
|||
// t.equal("",msg) // uncomment to have some kind of logging of warnings
|
|||
} |
|||
filename = __dirname + "/fixtures/" + entryName |
|||
fs.readFile(filename, function(err, contents) { |
|||
if (err) return next(err) |
|||
data = JSON.parse(contents.toString()) |
|||
normalize(data, warn) |
|||
if(data.name == "node-module_exist") { |
|||
t.same(data.bugs.url, "https://gist.github.com/3135914") |
|||
} |
|||
if(data.name == "read-package-json") { |
|||
t.same(data.bugs.url, "https://github.com/isaacs/read-package-json/issues") |
|||
} |
|||
if(data.name == "http-server") { |
|||
t.same(data.bugs.url, "https://github.com/nodejitsu/http-server/issues") |
|||
} |
|||
if(data.name == "movefile") { |
|||
t.same(data.bugs.url, "https://github.com/yazgazan/movefile/issues") |
|||
} |
|||
next(null) |
|||
}) // fs.readFile
|
|||
} // verifyConsistency
|
|||
async.forEach(entries, verifyConsistency, function(err) { |
|||
if (err) throw err |
|||
t.end() |
|||
}) |
|||
}) // tap.test
|
@ -0,0 +1,129 @@ |
|||
var tap = require("tap") |
|||
var fs = require("fs") |
|||
var path = require("path") |
|||
|
|||
var globals = Object.keys(global) |
|||
|
|||
var normalize = require("../lib/normalize") |
|||
|
|||
var rpjPath = path.resolve(__dirname,"./fixtures/read-package-json.json") |
|||
tap.test("normalize some package data", function(t) { |
|||
var packageData = require(rpjPath) |
|||
var warnings = [] |
|||
normalize(packageData, function(warning) { |
|||
warnings.push(warning) |
|||
}) |
|||
// there's no readme data in this particular object
|
|||
t.equal( warnings.length, 1, "There's exactly one warning.") |
|||
fs.readFile(rpjPath, function(err, data) { |
|||
if(err) throw err |
|||
// Various changes have been made
|
|||
t.notEqual(packageData, JSON.parse(data), "Output is different from input.") |
|||
t.end() |
|||
}) |
|||
}) |
|||
|
|||
tap.test("runs without passing warning function", function(t) { |
|||
var packageData = require(rpjPath) |
|||
fs.readFile(rpjPath, function(err, data) { |
|||
if(err) throw err |
|||
normalize(JSON.parse(data)) |
|||
t.ok(true, "If you read this, this means I'm still alive.") |
|||
t.end() |
|||
}) |
|||
}) |
|||
|
|||
tap.test("empty object", function(t) { |
|||
var packageData = {} |
|||
var expect = |
|||
{ name: '', |
|||
version: '', |
|||
readme: 'ERROR: No README data found!', |
|||
_id: '@' } |
|||
|
|||
var warnings = [] |
|||
function warn(m) { |
|||
warnings.push(m) |
|||
} |
|||
normalize(packageData, warn) |
|||
t.same(packageData, expect) |
|||
t.same(warnings, ["No repository field.","No readme data."]) |
|||
t.end() |
|||
}) |
|||
|
|||
tap.test("urls required", function(t) { |
|||
var warnings = [] |
|||
function warn(w) { |
|||
warnings.push(w) |
|||
} |
|||
normalize({ |
|||
bugs: { |
|||
url: "/1", |
|||
email: "not an email address" |
|||
} |
|||
}, warn) |
|||
var a |
|||
normalize(a={ |
|||
readme: "read yourself how about", |
|||
homepage: 123, |
|||
bugs: "what is this i don't even", |
|||
repository: "Hello." |
|||
}, warn) |
|||
|
|||
console.error(a) |
|||
|
|||
var expect = |
|||
[ 'No repository field.', |
|||
'No readme data.', |
|||
'bugs.url field must be a string url. Deleted.', |
|||
'bugs.email field must be a string email. Deleted.', |
|||
'Normalized value of bugs field is an empty object. Deleted.', |
|||
'Bug string field must be url, email, or {email,url}', |
|||
'Normalized value of bugs field is an empty object. Deleted.', |
|||
'homepage field must be a string url. Deleted.' ] |
|||
t.same(warnings, expect) |
|||
t.end() |
|||
}) |
|||
|
|||
tap.test("homepage field must start with a protocol.", function(t) { |
|||
var warnings = [] |
|||
function warn(w) { |
|||
warnings.push(w) |
|||
} |
|||
var a |
|||
normalize(a={ |
|||
homepage: 'example.org' |
|||
}, warn) |
|||
|
|||
console.error(a) |
|||
|
|||
var expect = |
|||
[ 'No repository field.', |
|||
'No readme data.', |
|||
'homepage field must start with a protocol.' ] |
|||
t.same(warnings, expect) |
|||
t.same(a.homepage, 'http://example.org') |
|||
t.end() |
|||
}) |
|||
|
|||
tap.test("gist bugs url", function(t) { |
|||
var d = { |
|||
repository: "git@gist.github.com:123456.git" |
|||
} |
|||
normalize(d) |
|||
t.same(d.repository, { type: 'git', url: 'git@gist.github.com:123456.git' }) |
|||
t.same(d.bugs, { url: 'https://gist.github.com/123456' }) |
|||
t.end(); |
|||
}); |
|||
|
|||
tap.test('no new globals', function(t) { |
|||
t.same(Object.keys(global), globals) |
|||
t.end() |
|||
}) |
|||
|
|||
tap.test("singularize repositories", function(t) { |
|||
d = {repositories:["git@gist.github.com:123456.git"]} |
|||
normalize(d) |
|||
t.same(d.repository, { type: 'git', url: 'git@gist.github.com:123456.git' }) |
|||
t.end() |
|||
}); |
@ -0,0 +1,67 @@ |
|||
var test = require('tap').test |
|||
var normalize = require('../') |
|||
var typos = require('../lib/typos.json') |
|||
|
|||
test('typos', function(t) { |
|||
var warnings = [] |
|||
function warn(m) { |
|||
warnings.push(m) |
|||
} |
|||
|
|||
var expect = |
|||
[ 'dependancies should probably be dependencies.', |
|||
'dependecies should probably be dependencies.', |
|||
'depdenencies should probably be dependencies.', |
|||
'devEependencies should probably be devDependencies.', |
|||
'depends should probably be dependencies.', |
|||
'dev-dependencies should probably be devDependencies.', |
|||
'devDependences should probably be devDependencies.', |
|||
'devDepenencies should probably be devDependencies.', |
|||
'devdependencies should probably be devDependencies.', |
|||
'repostitory should probably be repository.', |
|||
'prefereGlobal should probably be preferGlobal.', |
|||
'hompage should probably be homepage.', |
|||
'hampage should probably be homepage.', |
|||
'autohr should probably be author.', |
|||
'autor should probably be author.', |
|||
'contributers should probably be contributors.', |
|||
'publicationConfig should probably be publishConfig.', |
|||
'No repository field.', |
|||
'No repository field.', |
|||
'No readme data.', |
|||
'bugs.url field must be a string url. Deleted.', |
|||
'Normalized value of bugs field is an empty object. Deleted.', |
|||
'No repository field.', |
|||
'No readme data.' ] |
|||
|
|||
normalize({"dependancies": "dependencies" |
|||
,"dependecies": "dependencies" |
|||
,"depdenencies": "dependencies" |
|||
,"devEependencies": "devDependencies" |
|||
,"depends": "dependencies" |
|||
,"dev-dependencies": "devDependencies" |
|||
,"devDependences": "devDependencies" |
|||
,"devDepenencies": "devDependencies" |
|||
,"devdependencies": "devDependencies" |
|||
,"repostitory": "repository" |
|||
,"prefereGlobal": "preferGlobal" |
|||
,"hompage": "homepage" |
|||
,"hampage": "homepage" |
|||
,"autohr": "author" |
|||
,"autor": "author" |
|||
,"contributers": "contributors" |
|||
,"publicationConfig": "publishConfig" |
|||
,readme:"asdf" |
|||
,name:"name" |
|||
,version:"1.2.5"}, warn) |
|||
|
|||
normalize({name:"name" |
|||
,version:"1.2.5" |
|||
,bugs:{web:"url",name:"url"}}, warn) |
|||
|
|||
normalize({name:"name" |
|||
,version:"1.2.5" |
|||
,script:{server:"start",tests:"test"}}, warn) |
|||
t.same(warnings, expect) |
|||
t.end(); |
|||
}) |
@ -0,0 +1,4 @@ |
|||
language: node_js |
|||
node_js: |
|||
- "0.8" |
|||
- "0.10" |
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,70 @@ |
|||
date: Thu Jun 13 11:34:24 PDT 2013 |
|||
version: 0.10.11 |
|||
category: release |
|||
title: Node v0.10.11 (Stable) |
|||
slug: node-v0-10-11-stable |
|||
|
|||
2013.06.13, Version 0.10.11 (Stable) |
|||
|
|||
* uv: upgrade to 0.10.11 |
|||
|
|||
* npm: Upgrade to 1.2.30 |
|||
|
|||
* openssl: add missing configuration pieces for MIPS (Andrei Sedoi) |
|||
|
|||
* Revert "http: remove bodyHead from 'upgrade' events" (isaacs) |
|||
|
|||
* v8: fix pointer arithmetic undefined behavior (Trevor Norris) |
|||
|
|||
* crypto: fix utf8/utf-8 encoding check (Ben Noordhuis) |
|||
|
|||
* net: Fix busy loop on POLLERR|POLLHUP on older linux kernels (Ben Noordhuis, isaacs) |
|||
|
|||
|
|||
|
|||
Source Code: http://nodejs.org/dist/v0.10.11/node-v0.10.11.tar.gz |
|||
|
|||
Macintosh Installer (Universal): http://nodejs.org/dist/v0.10.11/node-v0.10.11.pkg |
|||
|
|||
Windows Installer: http://nodejs.org/dist/v0.10.11/node-v0.10.11-x86.msi |
|||
|
|||
Windows x64 Installer: http://nodejs.org/dist/v0.10.11/x64/node-v0.10.11-x64.msi |
|||
|
|||
Windows x64 Files: http://nodejs.org/dist/v0.10.11/x64/ |
|||
|
|||
Linux 32-bit Binary: http://nodejs.org/dist/v0.10.11/node-v0.10.11-linux-x86.tar.gz |
|||
|
|||
Linux 64-bit Binary: http://nodejs.org/dist/v0.10.11/node-v0.10.11-linux-x64.tar.gz |
|||
|
|||
Solaris 32-bit Binary: http://nodejs.org/dist/v0.10.11/node-v0.10.11-sunos-x86.tar.gz |
|||
|
|||
Solaris 64-bit Binary: http://nodejs.org/dist/v0.10.11/node-v0.10.11-sunos-x64.tar.gz |
|||
|
|||
Other release files: http://nodejs.org/dist/v0.10.11/ |
|||
|
|||
Website: http://nodejs.org/docs/v0.10.11/ |
|||
|
|||
Documentation: http://nodejs.org/docs/v0.10.11/api/ |
|||
|
|||
Shasums: |
|||
|
|||
``` |
|||
c460678436e513ef5b8b8513abd74c75d8ebf7bb node-v0.10.11-darwin-x64.tar.gz |
|||
edd321fc6d7525774a12433e943db3a7817a19b9 node-v0.10.11-darwin-x86.tar.gz |
|||
1388e8a2b6b4b2043db4fc382959d43e7c32e28e node-v0.10.11-linux-x64.tar.gz |
|||
2923e08deeb08a5ce1a29607c00f8b8e4fbd16c8 node-v0.10.11-linux-x86.tar.gz |
|||
4d12e60a9bf4c9c418d88951733a6a51201b789d node-v0.10.11-sunos-x64.tar.gz |
|||
842e283ea724a6d69a17e18426c32e6fd4b0734b node-v0.10.11-sunos-x86.tar.gz |
|||
bbc874e7ad72d980a19ee76dc1d9012d801f1d8f node-v0.10.11-x86.msi |
|||
05d0a697a183f809a949832a0fd98e1e30d53e72 node-v0.10.11.pkg |
|||
4f646bb3418d1c177ce28cdbc61e71de35b38aea node-v0.10.11.tar.gz |
|||
e2eec3e170e1d26622231ee3f0b632485756a5f0 node.exe |
|||
8957dd0c31c115819f9387250f038a1e6259cfa9 node.exp |
|||
930ba687c31f09dd199c0cfb2ac492f57c0f640f node.lib |
|||
6bd963cff4baba07cb05d7e6aa566aebe8db5519 node.pdb |
|||
016356e656ac8091900637e3fb64ddc3dd53cfb5 x64/node-v0.10.11-x64.msi |
|||
a845f30c9f0100b6f4d79080c72068ff497c5c23 x64/node.exe |
|||
00719da33432ae9a264407c89239ce5a76e21df0 x64/node.exp |
|||
1f96e883134197c27aada23847b049491dd46b13 x64/node.lib |
|||
83989e612f56b0a8e90e4fad8cb1a7d8b0bdfcd0 x64/node.pdb |
|||
``` |
@ -0,0 +1,67 @@ |
|||
date: Tue Jun 18 11:12:19 PDT 2013 |
|||
version: 0.10.12 |
|||
category: release |
|||
title: Node v0.10.12 (Stable) |
|||
slug: node-v0-10-12-stable |
|||
|
|||
2013.06.18, Version 0.10.12 (Stable) |
|||
|
|||
* npm: Upgrade to 1.2.32 |
|||
|
|||
* readline: make `ctrl + L` clear the screen (Yuan Chuan) |
|||
|
|||
* v8: add setVariableValue debugger command (Ben Noordhuis) |
|||
|
|||
* net: Do not destroy socket mid-write (isaacs) |
|||
|
|||
* v8: fix build for mips32r2 architecture (Andrei Sedoi) |
|||
|
|||
* configure: fix cross-compilation host_arch_cc() (Andrei Sedoi) |
|||
|
|||
|
|||
Source Code: http://nodejs.org/dist/v0.10.12/node-v0.10.12.tar.gz |
|||
|
|||
Macintosh Installer (Universal): http://nodejs.org/dist/v0.10.12/node-v0.10.12.pkg |
|||
|
|||
Windows Installer: http://nodejs.org/dist/v0.10.12/node-v0.10.12-x86.msi |
|||
|
|||
Windows x64 Installer: http://nodejs.org/dist/v0.10.12/x64/node-v0.10.12-x64.msi |
|||
|
|||
Windows x64 Files: http://nodejs.org/dist/v0.10.12/x64/ |
|||
|
|||
Linux 32-bit Binary: http://nodejs.org/dist/v0.10.12/node-v0.10.12-linux-x86.tar.gz |
|||
|
|||
Linux 64-bit Binary: http://nodejs.org/dist/v0.10.12/node-v0.10.12-linux-x64.tar.gz |
|||
|
|||
Solaris 32-bit Binary: http://nodejs.org/dist/v0.10.12/node-v0.10.12-sunos-x86.tar.gz |
|||
|
|||
Solaris 64-bit Binary: http://nodejs.org/dist/v0.10.12/node-v0.10.12-sunos-x64.tar.gz |
|||
|
|||
Other release files: http://nodejs.org/dist/v0.10.12/ |
|||
|
|||
Website: http://nodejs.org/docs/v0.10.12/ |
|||
|
|||
Documentation: http://nodejs.org/docs/v0.10.12/api/ |
|||
|
|||
Shasums: |
|||
|
|||
``` |
|||
e3c28629938d70dac535dca0b78199ae7e4e7cf6 node-v0.10.12-darwin-x64.tar.gz |
|||
d777c8c50270b7c834ee9ca95c186d30e181f885 node-v0.10.12-darwin-x86.tar.gz |
|||
c5b9cbb9b6329767f11a89c14e09afa795e3f9e9 node-v0.10.12-linux-x64.tar.gz |
|||
f7a7ac317ab3a8406ec11ec118c38971d5e4c508 node-v0.10.12-linux-x86.tar.gz |
|||
c5f446d6768298ad0d917f920f422a1e82d92fce node-v0.10.12-sunos-x64.tar.gz |
|||
05725a5255f762193838dac7175cbba418ef77c7 node-v0.10.12-sunos-x86.tar.gz |
|||
3403fed2cedf23764de50e17d0eeb5c960e88b79 node-v0.10.12-x86.msi |
|||
8e7cfecf737886014616d7c683bbb8a5ef38f4f7 node-v0.10.12.pkg |
|||
3e4f692fb9156c0cee4dd35bd8a6be4ff89a29de node-v0.10.12.tar.gz |
|||
d1cb17e753a5e0370c9ffe7f753e5c9b1d5bb9ff node.exe |
|||
af802e62b0da817543f5a4d51304d7fc49b4e56c node.exp |
|||
737eb43e0daed76112e8371f85176151dc380ac5 node.lib |
|||
b273075995dba44e7ae02641c3c8ba4c6301be8d node.pdb |
|||
e109532cc9d83599d7ebe18c325d14bdc7087ae8 x64/node-v0.10.12-x64.msi |
|||
1d902d66ecfd78c5bfef4181bab075119377006d x64/node.exe |
|||
3d79a1f3a94c31f73c095d9b3fd83ae80e14042f x64/node.exp |
|||
80295d8b0cb4922dbae01d85a0726f2721f0db00 x64/node.lib |
|||
2b5663f50946b13a1df4d9fcf7f9edd9605e130c x64/node.pdb |
|||
``` |
@ -0,0 +1,59 @@ |
|||
date: Thu Jun 13 13:18:09 PDT 2013 |
|||
version: 0.8.25 |
|||
category: release |
|||
title: Node v0.8.25 (Maintenance) |
|||
slug: node-v0-8-25-maintenance |
|||
|
|||
2013.06.13, Version 0.8.25 (maintenance) |
|||
|
|||
* npm: Upgrade to 1.2.30 |
|||
|
|||
* child_process: fix handle delivery (Ben Noordhuis) |
|||
|
|||
|
|||
Source Code: http://nodejs.org/dist/v0.8.25/node-v0.8.25.tar.gz |
|||
|
|||
Macintosh Installer (Universal): http://nodejs.org/dist/v0.8.25/node-v0.8.25.pkg |
|||
|
|||
Windows Installer: http://nodejs.org/dist/v0.8.25/node-v0.8.25-x86.msi |
|||
|
|||
Windows x64 Installer: http://nodejs.org/dist/v0.8.25/x64/node-v0.8.25-x64.msi |
|||
|
|||
Windows x64 Files: http://nodejs.org/dist/v0.8.25/x64/ |
|||
|
|||
Linux 32-bit Binary: http://nodejs.org/dist/v0.8.25/node-v0.8.25-linux-x86.tar.gz |
|||
|
|||
Linux 64-bit Binary: http://nodejs.org/dist/v0.8.25/node-v0.8.25-linux-x64.tar.gz |
|||
|
|||
Solaris 32-bit Binary: http://nodejs.org/dist/v0.8.25/node-v0.8.25-sunos-x86.tar.gz |
|||
|
|||
Solaris 64-bit Binary: http://nodejs.org/dist/v0.8.25/node-v0.8.25-sunos-x64.tar.gz |
|||
|
|||
Other release files: http://nodejs.org/dist/v0.8.25/ |
|||
|
|||
Website: http://nodejs.org/docs/v0.8.25/ |
|||
|
|||
Documentation: http://nodejs.org/docs/v0.8.25/api/ |
|||
|
|||
Shasums: |
|||
|
|||
``` |
|||
c650dca3031ea09535a5cb95648a9edf43dcb23a node-v0.8.25-darwin-x64.tar.gz |
|||
d479e24f693331bd09b7a29e9cb2b2140f5f0606 node-v0.8.25-darwin-x86.tar.gz |
|||
5fbf6e7718cb8576682479e002081c23b5ebb299 node-v0.8.25-linux-x64.tar.gz |
|||
c037c589f77e597503a606d66c5ab7a0d1e1b3fb node-v0.8.25-linux-x86.tar.gz |
|||
ed5709fbd80c167183ca60cf4c435caa49d35034 node-v0.8.25-sunos-x64.tar.gz |
|||
6c2914ec896330e9f6eba65cbec738b042712663 node-v0.8.25-sunos-x86.tar.gz |
|||
26cc19bc19e344e4b51ab33775d00e811bf9b1eb node-v0.8.25-x86.msi |
|||
4c7ec87036616ec6e96f8c4b7242c86c3380231e node-v0.8.25.pkg |
|||
df91c9de8f3f14efb4cbe52d3ca8beb754b2a39a node-v0.8.25.tar.gz |
|||
d111ef9ac2b2cb4d3126f147c2714ce2441d37aa node.exe |
|||
a8cd86993a6dcf8a22d1cfda2fcd6c4865aac1da node.exp |
|||
5f8538ebd80078a1eee7dfe11f1b6d21d32f38f8 node.lib |
|||
bc4b361c1594a47902e94dddf8308be5b48b4f81 node.pdb |
|||
a6a559c81802f43cd220b83e13712f71d5f13484 x64/node-v0.8.25-x64.msi |
|||
fb004a281f3914961ce2c08e859c007b5c7d61a5 x64/node.exe |
|||
8954509d45e6a9d160130acc4313a8cb4ee870f4 x64/node.exp |
|||
cc332ca7a4b34ed834e5ad07abdbe1ce79bba5a6 x64/node.lib |
|||
24511046a8504ef65f77cbd30e5bad6b18751148 x64/node.pdb |
|||
``` |
@ -0,0 +1,79 @@ |
|||
// Copyright Joyent, Inc. and other Node contributors.
|
|||
//
|
|||
// Permission is hereby granted, free of charge, to any person obtaining a
|
|||
// copy of this software and associated documentation files (the
|
|||
// "Software"), to deal in the Software without restriction, including
|
|||
// without limitation the rights to use, copy, modify, merge, publish,
|
|||
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|||
// persons to whom the Software is furnished to do so, subject to the
|
|||
// following conditions:
|
|||
//
|
|||
// The above copyright notice and this permission notice shall be included
|
|||
// in all copies or substantial portions of the Software.
|
|||
//
|
|||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|||
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
|||
var common = require('../common'); |
|||
var assert = require('assert'); |
|||
var BUFSIZE = 1024; |
|||
|
|||
switch (process.argv[2]) { |
|||
case undefined: |
|||
return parent(); |
|||
case 'child': |
|||
return child(); |
|||
default: |
|||
throw new Error('wtf?'); |
|||
} |
|||
|
|||
function parent() { |
|||
var spawn = require('child_process').spawn; |
|||
var child = spawn(process.execPath, [__filename, 'child']); |
|||
var sent = 0; |
|||
|
|||
var n = ''; |
|||
child.stdout.setEncoding('ascii'); |
|||
child.stdout.on('data', function(c) { |
|||
n += c; |
|||
}); |
|||
child.stdout.on('end', function() { |
|||
assert.equal(+n, sent); |
|||
console.log('ok'); |
|||
}); |
|||
|
|||
// Write until the buffer fills up.
|
|||
do { |
|||
var buf = new Buffer(BUFSIZE); |
|||
buf.fill('.'); |
|||
sent += BUFSIZE; |
|||
} while (child.stdin.write(buf)); |
|||
|
|||
// then write a bunch more times.
|
|||
for (var i = 0; i < 100; i++) { |
|||
var buf = new Buffer(BUFSIZE); |
|||
buf.fill('.'); |
|||
sent += BUFSIZE; |
|||
child.stdin.write(buf); |
|||
} |
|||
|
|||
// now end, before it's all flushed.
|
|||
child.stdin.end(); |
|||
|
|||
// now we wait...
|
|||
} |
|||
|
|||
function child() { |
|||
var received = 0; |
|||
process.stdin.on('data', function(c) { |
|||
received += c.length; |
|||
}); |
|||
process.stdin.on('end', function() { |
|||
console.log(received); |
|||
}); |
|||
} |
@ -0,0 +1,92 @@ |
|||
// Copyright Joyent, Inc. and other Node contributors.
|
|||
//
|
|||
// Permission is hereby granted, free of charge, to any person obtaining a
|
|||
// copy of this software and associated documentation files (the
|
|||
// "Software"), to deal in the Software without restriction, including
|
|||
// without limitation the rights to use, copy, modify, merge, publish,
|
|||
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|||
// persons to whom the Software is furnished to do so, subject to the
|
|||
// following conditions:
|
|||
//
|
|||
// The above copyright notice and this permission notice shall be included
|
|||
// in all copies or substantial portions of the Software.
|
|||
//
|
|||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|||
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
|||
// Create an ssl server. First connection, validate that not resume.
|
|||
// Cache session and close connection. Use session on second connection.
|
|||
// ASSERT resumption.
|
|||
|
|||
if (!process.versions.openssl) { |
|||
console.error('Skipping because node compiled without OpenSSL.'); |
|||
process.exit(0); |
|||
} |
|||
|
|||
var common = require('../common'); |
|||
var assert = require('assert'); |
|||
var https = require('https'); |
|||
var tls = require('tls'); |
|||
var fs = require('fs'); |
|||
|
|||
var options = { |
|||
key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'), |
|||
cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem') |
|||
}; |
|||
|
|||
var connections = 0; |
|||
|
|||
// create server
|
|||
var server = https.createServer(options, function(res, res) { |
|||
res.end('Goodbye'); |
|||
connections++; |
|||
}); |
|||
|
|||
// start listening
|
|||
server.listen(common.PORT, function() { |
|||
|
|||
var session1 = null; |
|||
var client1 = tls.connect({ |
|||
port: common.PORT, |
|||
rejectUnauthorized: false |
|||
}, function() { |
|||
console.log('connect1'); |
|||
assert.ok(!client1.isSessionReused(), 'Session *should not* be reused.'); |
|||
session1 = client1.getSession(); |
|||
client1.write('GET / HTTP/1.0\r\n' + |
|||
'Server: 127.0.0.1\r\n' + |
|||
'\r\n'); |
|||
}); |
|||
|
|||
client1.on('close', function() { |
|||
console.log('close1'); |
|||
|
|||
var opts = { |
|||
port: common.PORT, |
|||
rejectUnauthorized: false, |
|||
session: session1 |
|||
}; |
|||
|
|||
var client2 = tls.connect(opts, function() { |
|||
console.log('connect2'); |
|||
assert.ok(client2.isSessionReused(), 'Session *should* be reused.'); |
|||
client2.write('GET / HTTP/1.0\r\n' + |
|||
'Server: 127.0.0.1\r\n' + |
|||
'\r\n'); |
|||
}); |
|||
|
|||
client2.on('close', function() { |
|||
console.log('close2'); |
|||
server.close(); |
|||
}); |
|||
}); |
|||
}); |
|||
|
|||
process.on('exit', function() { |
|||
assert.equal(2, connections); |
|||
}); |
@ -0,0 +1 @@ |
|||
V8 JavaScript for clients and servers (nodejs.org package) |
@ -0,0 +1,7 @@ |
|||
Node.js is an evented I/O framework for the V8 JavaScript engine. It is |
|||
intended for writing scalable network programs such as web servers. |
|||
|
|||
Packaged by nodejs.org |
|||
|
|||
Homepage: |
|||
http://nodejs.org/ |
Loading…
Reference in new issue