Compare commits

...

582 Commits

Author SHA1 Message Date
Paulo McNally
c681f8c994 doc: add link to workflow in api docs menu
Added link to workflow guidelines page in API docs' navigation menu.

Fixes https://github.com/joyent/node-website/issues/102.
2015-04-10 11:29:59 -07:00
James M Snell
02a549ed2b tls: make the --enable-legacy-cipher-list help less verbose
Per feedback on the commit, make the PrintHelp for
--enable-legacy-cipher-list less verbose.

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/joyent/node/pull/14413
2015-04-08 12:00:19 -07:00
James M Snell
67d9a56251 tls: disable RC4, add --cipher-list command line switch
Disable RC4 in the default cipher list

Add the `--cipher-list` command line switch and `NODE_CIPHER_LIST`
environment variable to completely override the default cipher list.

Add the `--enable-legacy-cipher-list` and `NODE_LEGACY_CIPHER_LIST`
environment variable to selectively enable the default cipher list from
previous node.js releases.

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/joyent/node/pull/14413
2015-04-08 12:00:18 -07:00
Julien Gilli
7edfd5f6d1 Now working on 0.10.39 2015-03-23 14:44:18 -07:00
Julien Gilli
0b4e67f861 Merge branch 'v0.10.38-release' into v0.10 2015-03-23 14:43:55 -07:00
Julien Gilli
0b5731a63c 2015.03.23, Version 0.10.38 (Maintenance)
* openssl: upgrade to 1.0.1m (Addressing multiple CVEs)
2015-03-23 12:23:33 -07:00
Shigeki Ohtsu
4b69c72b8b openssl: fix keypress requirement in apps on win32
reapply b910613792dac946b295855963869933a9089044

PR: #9451
PR-URL: https://github.com/joyent/node/pull/9451
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2015-03-23 11:34:12 -07:00
Shigeki Ohtsu
1fc3fdf892 deps: remove unused backup file in openssl asm
deps/openssl/asm/x64-win32-masm/x86_64cpuid.asm.orig was accidentally
committed before.

PR: #9451
PR-URL: https://github.com/joyent/node/pull/9451
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2015-03-23 11:33:48 -07:00
Shigeki Ohtsu
15cdeb7d99 deps: remove vpaesni-x86_64.asm in x64-win32-masm
It is no longer used.

PR: #9451
PR-URL: https://github.com/joyent/node/pull/9451
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2015-03-23 11:33:30 -07:00
Fedor Indutny
63377ec3c3 deps: fix openssl assembly error on ia32 win32
`x86masm.pl` was mistakenly using .486 instruction set, why `cpuid` (and
perhaps others) are requiring .686 .

PR: #9451
PR-URL: https://github.com/joyent/node/pull/9451
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2015-03-23 11:33:13 -07:00
Shigeki Ohtsu
2b21c45f75 deps: separate sha256/sha512-x86_64.pl for openssl
sha256-x86_64.pl does not exist in the origin openssl distribution. It
was copied from sha512-x86_64.pl and both sha256/sha512 scripts were
modified so as to generates only one asm file specified as its key
hash length.

PR: #9451
PR-URL: https://github.com/joyent/node/pull/9451
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2015-03-23 11:32:50 -07:00
Shigeki Ohtsu
10717f659b deps: replace all headers in openssl
change all openssl/include/openssl/*.h to include resolved symbolic
links and openssl/crypto/opensslconf.h to refer config/opensslconf.h

PR: #9451
PR-URL: https://github.com/joyent/node/pull/9451
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2015-03-23 11:32:34 -07:00
James M Snell
c6e8a2c920 deps: upgrade to openssl-1.0.1m
Extract the tarball into deps/openssl/openssl

PR: #9451
PR-URL: https://github.com/joyent/node/pull/9451
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2015-03-23 11:31:29 -07:00
Julien Gilli
4332c77bf7 Now working on 0.10.38 2015-03-11 21:13:15 -07:00
Julien Gilli
50c23fb381 Merge branch 'v0.10.37-release' into v0.10 2015-03-11 21:12:00 -07:00
Julien Gilli
7d6b5b1d5b 2015.03.11, Version 0.10.37 (Maintenance)
* uv: update to 0.10.36 (CVE-2015-0278)

* domains: fix stack clearing after error handled (Jonas Dohse)

* buffer: reword Buffer.concat error message (Chris Dickinson)

* console: allow Object.prototype fields as labels (Julien Gilli)

* V8: log version in profiler log file (Ben Noordhuis)

* http: fix performance regression for GET requests (Florin-Cristian Gavrila)
2015-03-11 16:30:44 -07:00
Julien Gilli
219c80d099 build: allow custom PackageMaker path
Make PACKAGEMAKER customizable because PackageMaker is not necessarily
installed in /Developer on OSX anymore.

PR: #9377
PR-URL: https://github.com/joyent/node/pull/9377
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
2015-03-11 16:25:36 -07:00
Jonas Dohse
f2a45caf2e domains: fix stack clearing after error handled
caeb67735b introduced a regression where
the domains stack would not be cleared after an error had been handled
by the top-level domain.

This change clears the domains stack regardless of the position of the
active domain in the stack.

PR: #9364
PR-URL: https://github.com/joyent/node/pull/9364
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2015-03-10 23:22:16 -07:00
Tyler Anton
51fe319faf docs: add return value for sync fs functions
Clarify that synchronous functions in fs with no return value return
undefined.

Specify that fs.openSync() returns an integer and fs.existsSync()
returns true or false.

Fixes #9313

PR: #9359
PR-URL: https://github.com/joyent/node/pull/9359
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2015-03-10 16:33:57 -07:00
Julien Gilli
a5be84fe9b url: revert reslove urls with . and ..
This reverts commit ad0684807c.

Initially, this bug fix targeted master, and I pushed to have it
included in v0.10. In retrospect, I'm not sure it should have made into
v0.10 as it seems it could break a lot of existing working code.

In my opinion, this change is still a bug fix, and it is not backward
incompatible per se. However, I'm not sure that taking the risk to break
a lot of users with a new 0.10.x release that would include this fix is
reasonable, especially now that 0.10.x releases are entering
maintenance mode.

PR-URL: https://github.com/joyent/node/pull/9257
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-03-06 12:44:06 -08:00
Saúl Ibarra Corretgé
dcff5d565c deps: update libuv to 0.10.36
PR: #9274
PR-URL: https://github.com/joyent/node/pull/9274
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2015-03-06 11:37:40 -08:00
Florin-Cristian Gavrila
8bcd0a4c4a http: fix performance regression for GET requests
A significant performance regressions has been introduced in 1fddc1f for
GET requests which send data through response.end(). The number of
requests per second dropped to somewhere around 6% of their previous
level.

The fix consists of removing a part of the lines added by 1fddc1f,
lines which were supposed to affect only HEAD requests, but interfered
with GET requests instead.

The lines removed would not have affected the behaviour in the case of
a HEAD request as this._hasBody would always be false. Therefore, they
were not required to fix the issue reported in #8361.

Fixes #8940.

PR: #9026
PR-URL: https://github.com/joyent/node/pull/9026
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2015-03-05 11:16:52 -08:00
Chris Dickinson
d01a900078 buffer: reword Buffer.concat error message
this brings the error messaging in line with
other node TypeError messages.

fixes joyent/node#7766.

PR: #8723
PR-URL: https://github.com/joyent/node/pull/8723
Reviewed-By: James M Snell <jasnell@users.noreply.github.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-03-04 17:44:53 -08:00
Julien Gilli
c8239c08d7 console: allow Object.prototype fields as labels
This is a backport of 6c3647c38d from
v0.12 to v0.10.

Console.prototype.timeEnd() returns NaN if the timer label
corresponds to a property on Object.prototype. In v0.12, this was fixed
by using Object.create(null) to construct the _times object

However, the version of V8 in the v0.10 branch makes this fix not work
as expected. In v0.10, this commit changes the _times object into a
array of objects of the form:

{ label: someLabel, time: staringWallClockTime }

someLabel can thus be any string, including any string that represents
any Object.prototype field.

Fixes #9116.

PR: #9215
PR-URL: https://github.com/joyent/node/pull/9215
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-02-17 18:08:11 -08:00
Amir Saboury
ad0684807c url: reslove urls with . and ..
'.' and '..' are directory specs and resolving urls with or without the
hostname with '.' and '..' should add a trailing slash to the end of the
url.

Fixes: https://github.com/joyent/node/issues/8992
PR-URL: https://github.com/joyent/node/pull/9010
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2015-02-09 14:49:10 -07:00
Ben Noordhuis
431eb172f9 deps: log V8 version in profiler log file
Patch from issue 800293002 authored by ben@strongloop.com

Review URL: https://codereview.chromium.org/806143002

PR-URL: https://github.com/joyent/node/pull/9043
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
2015-02-04 12:46:17 -07:00
Timothy J Fontaine
ff32b81516 Now working on 0.10.37 2015-01-26 12:28:48 -08:00
Timothy J Fontaine
6b264dd1f9 Merge branch 'v0.10.36-release' into v0.10 2015-01-26 12:28:08 -08:00
Timothy J Fontaine
09b482886b 2015.01.26, Version 0.10.36 (Stable)
* openssl: update to 1.0.1l

* v8: Fix debugger and strict mode regression (Julien Gilli)

* v8: don't busy loop in cpu profiler thread (Ben Noordhuis)
2015-01-26 10:28:23 -08:00
Timothy J Fontaine
6168fe6720 build: add win32 convenience build rule
PR-URL: https://github.com/joyent/node/pull/9085
PR: #9085

Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
2015-01-23 15:17:05 -08:00
Fedor Indutny
9e387fb611 test: fix crypto-stream after openssl update
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2015-01-21 11:39:55 -08:00
Fedor Indutny
f5e9b6e84a build: remove vanished masm file from openssl build
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2015-01-21 11:39:54 -08:00
James M Snell
deef605085 deps: update openssl to 1.0.1l
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2015-01-21 11:39:54 -08:00
Fedor Indutny
b28c76e9d2 deps: update openssl to 1.0.1k
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2015-01-21 11:39:54 -08:00
Andrei Sedoi
e45c52c573 doc: use correct signature for assert()
The message argument is optional for both assert() and
assert.ok(). This commit makes message optional for assert().

PR-URL: https://github.com/joyent/node/pull/9003
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-01-20 10:39:10 -05:00
Robert Kowalski
0c50195071 docs: delete unused/duplicate css files
- `sh.css` already exists in `api_assets`
 - `sh_vim-dark.css` is unused, but used in the repo `node-website`
        now

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Signed-off-by: Julien Gilli <julien.gilli@joyent.com>
2015-01-14 15:26:48 -08:00
cjihrig
0a430b9aec test: backport use executable in spawn() test
Backport 10703774f0 from the v0.12 branch.

Currently, the test-child-process-spawn-typeerror.js is
calling execFile() on a JavaScript source file, which is
causing failures on Windows. This commit switches to calling
spawn() on an actual executable.

Fixes #8930.

Signed-off-by: Julien Gilli <julien.gilli@joyent.com>
2015-01-13 14:54:44 -08:00
Julien Gilli
31051e5c7b deps: revert backport b593aa8 from v8 upstream
This reverts commit 45f1330425.

45f1330425 was basically breaking
node-inspector. V8 landed a patch upstream that would probably fix these
issues (see https://codereview.chromium.org/813873007), but without the
ability to properly test it in the wild, it's safer to just revert the
breaking change.

Fixes #8948.

Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2015-01-13 11:25:09 -08:00
Ben Noordhuis
6ebd85e105 v8: don't busy loop in cpu profiler thread
Reduce the overhead of the CPU profiler by replacing sched_yield() with
nanosleep() in V8's tick event processor thread.  The former only yields
the CPU when there is another process scheduled on the same CPU.

Before this commit, the thread would effectively busy loop and consume
100% CPU time.  By forcing a one nanosecond sleep period rounded up to
the task scheduler's granularity (about 50 us on Linux), CPU usage for
the processor thread now hovers around 10-20% for a busy application.

PR-URL: https://github.com/joyent/node/pull/8789
Ref: https://github.com/strongloop/strong-agent/issues/3
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2015-01-12 16:49:07 -08:00
Timothy J Fontaine
fe2019699a Now working on 0.10.36 2014-12-23 17:31:00 -08:00
Timothy J Fontaine
cd6dff9728 Merge branch 'v0.10.35-release' into v0.10 2014-12-23 17:30:32 -08:00
Timothy J Fontaine
a363f61ca8 2014.12.22, Version 0.10.35 (Stable)
* tls: re-add 1024-bit SSL certs removed by f9456a2 (Chris Dickinson)

* timers: don't close interval timers when unrefd (Julien Gilli)

* timers: don't mutate unref list while iterating it (Julien Gilli)
2014-12-22 13:22:32 -08:00
James M Snell
102a861ec2 doc: clarify buffer api documentation
Better wording for start and end parameters, also document .length
should be considered readonly.

RE: #8857, #8859, #8913
PR: #8910
PR-URL: https://github.com/joyent/node/pull/8910

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-12-22 12:24:28 -08:00
James M Snell
48536394c9 doc: clarify add/removeListener semantics
Clarify that adding or removing a listener is not idempotent.

RE: #8853
PR: #8911
PR-URL: https://github.com/joyent/node/pull/8911
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-12-22 12:12:48 -08:00
Julien Gilli
fd2cb7c611 timers: don't mutate unref list while iterating it
Commit 934bfe23a1 had introduced a
regression where node would crash trying to access a null unref timer if
a given unref timer's callback would remove other unref timers set to
fire in the future.

More generally, it makes the unrefTimeout function more solid by not
mutating the unrefList while traversing it.

Fixes #8897.

Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2014-12-22 11:45:31 -08:00
Chris Dickinson
1425ccd1b2 src: re-add 1024-bit SSL certs removed by f9456a2
this fixes a problem where connecting to AWS services
would report an untrusted cert error.

Fixes: https://github.com/joyent/node/issues/8894
PR-URL: https://github.com/joyent/node/pull/8904
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
2014-12-19 17:11:40 -08:00
Julien Gilli
78db74dd88 timers: don't close interval timers when unrefd
This change fixes a regression introduced by commit
0d051238be, which contained a typo that
would cause every unrefd interval to fire only once.

Fixes #8900.

Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-12-19 15:41:55 -08:00
Timothy J Fontaine
1b81ea8276 Now working on 0.10.35 2014-12-17 14:39:51 -08:00
Timothy J Fontaine
a6757fb9d0 Merge branch 'v0.10.34-release' into v0.10 2014-12-17 14:39:24 -08:00
Timothy J Fontaine
52795f8fcc 2014.12.17, Version 0.10.34 (Stable)
* uv: update to v0.10.30

* zlib: upgrade to v1.2.8

* child_process: check execFile args is an array (Sam Roberts)

* child_process: check fork args is an array (Sam Roberts)

* crypto: update root certificates (Ben Noordhuis)

* domains: fix issues with abort on uncaught (Julien Gilli)

* timers: Avoid linear scan in _unrefActive. (Julien Gilli)

* timers: fix unref() memory leak (Trevor Norris)

* v8: add api for aborting on uncaught exception (Julien Gilli)

* debugger: fix when using "use strict" (Julien Gilli)
2014-12-17 13:21:23 -08:00
Trevor Norris
afb488db86 Revert "src: reduce cpu profiler overhead"
This reverts commit 1eb1e0a9af.
2014-12-17 12:45:23 -08:00
Ben Noordhuis
1eb1e0a9af src: reduce cpu profiler overhead
Reduce the overhead of the CPU profiler by suppressing SIGPROF signals
when sleeping / polling for events. Avoids unnecessary wakeups when the
CPU profiler is active. Depends on https://github.com/libuv/libuv#15.

Ref: https://github.com/strongloop/strong-agent/issues/3
PR-URL: https://github.com/joyent/node/pull/8791
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-12-17 12:37:30 -08:00
cjihrig
f75a8ad723 test: remove redundant code in test
A block of asserts were duplicated in
test/simple/test-child-process-spawn-typeerror.js. This commit
removes the duplicated asserts.

Fixes: https://github.com/joyent/node/pull/8454
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2014-12-17 15:08:22 -05:00
Julien Gilli
542234ad98 doc: improve dns module's documentation
Make the difference between dns.lookup and other functions even clearer.

PR: #8747
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-12-17 11:54:31 -08:00
Julien Gilli
45f1330425 deps: backport b593aa8 from v8 upstream
Original commit message:

Enable "strict mode"; for debugger scripts

BUG=v8:3708

Review URL: https://codereview.chromium.org/736583007

Cr-Commit-Position: refs/heads/master@{#25420}
2014-12-17 11:47:26 -08:00
Julien Gilli
0ff51c6e06 deps: backport 2ad2237 from v8 upstream
Original commit message:

Fix Unhandled ReferenceError in debug-debugger.js

This fixes following exception in Sky on attempt to set a breakpoint
"Unhandled: Uncaught ReferenceError: break_point is not defined"
I think this happens in Sky but not in Chrome because Sky scripts are executed in strict mode.

BUG=None
LOG=N
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/741683002

Cr-Commit-Position: refs/heads/master@{#25415}
2014-12-17 11:47:26 -08:00
Shigeki Ohtsu
bddea12026 doc: Update LICENSE for zlib 1.2.8 2014-12-16 15:35:09 -08:00
Shigeki Ohtsu
710845cfd3 deps: fix zlib.gyp for zlib upgrade to 1.2.8
This adds new sources for gzip files and defines a new flag for mac and freebsd.
They are taken from third_party/zlib/zlib.gyp in Chromium repository.
2014-12-16 15:35:09 -08:00
Shigeki Ohtsu
33f74bbd90 deps: upgrade zlib to 1.2.8 2014-12-16 15:35:09 -08:00
Julien Gilli
934bfe23a1 timers: Avoid linear scan in _unrefActive.
Before this change, _unrefActive would keep the unrefList sorted when
adding a new timer.

Because _unrefActive is called extremely frequently, this linear scan
(O(n) at worse) would make _unrefActive show high in the list of
contributors when profiling CPU usage.

This commit changes _unrefActive so that it doesn't try to keep the
unrefList sorted. The insertion thus happens in constant time.

However, when a timer expires, unrefTimeout has to go through the whole
unrefList because it's not ordered anymore.

It is usually not large enough to have a significant impact on
performance because:
- Most of the time, the timers will be removed before unrefTimeout is
  called because their users (sockets mainly) cancel them when an I/O
  operation takes place.
- If they're not, it means that some I/O took a long time to happen, and
  the initiator of subsequents I/O operations that would add more timers
  has to wait for them to complete.

With this change, _unrefActive does not show as a significant
contributor in CPU profiling reports anymore.

Fixes #8160.
PR-URL: #8751

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-12-16 11:44:23 -08:00
Trevor Norris
813114dab0 src: remove icu_config
ICU support in v0.12 generates a new icu_config.gypi. This was
accidentally committed after switching branches. The file has been removed
and added to .gitignore.

Fixes: 0d051238 "timers: fix unref() memory leak"
2014-12-15 15:36:00 -08:00
Steven R. Loomis
69b122a642 build: configure return exit status from gyp
Previously, 'configure' would not return an exit status
if gyp blows up. This can be tested via:

    date >> node.gyp ; ./configure && echo A-OK

You will get "A-OK" even though gyp had failed.

Signed-off-by: Julien Gilli <julien.gilli@joyent.com>
2014-12-15 13:55:11 -08:00
Julien Gilli
0603c8345b docs: clarify url.format documentation
The original documentation was slightly confusing. It seemed that the
list of items described the properties of the urlObj object, while it
was actually describing the formatting process. This change makes this
clearer.

Fixes #8796.

Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-12-15 12:29:36 -08:00
silverwind
d230fa9eb7 doc: fix typo secureOptions in tls
Documentation mentioned 'securityOptions', where it should have read
'secureOptions'.

Fixes #8608.

Signed-off-by: Julien Gilli <julien.gilli@joyent.com>
2014-12-11 23:27:49 -08:00
Saúl Ibarra Corretgé
1c031c84d2 deps: update libuv to 0.10.30
PR-URL: https://github.com/joyent/node/pull/8849
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-12-09 12:41:46 -08:00
pkcs
8120015f40 doc: clearer log messages in net code samples
Code examples in documentation for net.createServer and
net.createConnection contained confusing log messages. This change makes
them clearer.

Signed-off-by: Julien Gilli <julien.gilli@joyent.com>
2014-12-08 15:23:22 -08:00
Alejandro Oviedo
f5cb330ab1 docs: fix streams example for write() after end()
Currently there's an example using http.ServerResponse stream, which
has a known bug and will not throw an error while writing after end().
Changed to a writable stream from fs which behaves as expected.

fix #8814

Signed-off-by: Julien Gilli <julien.gilli@joyent.com>
2014-12-06 19:27:05 -08:00
Brendan Ashworth
5e503f45d2 doc: fix grammar in tls and timers
Replace 'a' with 'an' where appropriate.
2014-12-05 14:12:48 -08:00
Fedor Indutny
8c868989be zlib: do not Unref() if wasn't Ref()ed
In very unlikely case, where `deflateInit2()` may return error (right
now happening only on exhausting all memory), the `ZCtx::Error()` will
be called and will try to `Unref()` the handle. But the problem is that
this handle was never `Ref()`ed, so it will trigger an assertion error
and crash the program.

Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/joyent/node/pull/8687
2014-12-04 18:10:13 +03:00
Ben Noordhuis
f9456a2d36 crypto: update root certificates
Update tools/certdata.txt to [0] (last updated on 2014-11-14) and
rebuild src/node_root_certs.h.

Refs joyent/node#8679 and joyent/node#8709.

[0] https://hg.mozilla.org/mozilla-central/raw-file/64206634959a/security/nss/lib/ckfw/builtins/certdata.txt
2014-12-04 16:57:48 +03:00
Ben Noordhuis
479b0b4e54 tools: customize mk-ca-bundle.pl
Remove unneeded functionality and tweak the generated output so we
can #include it in C++ source code.

This is a back-port of commit e159073 from the master branch.
2014-12-04 16:57:48 +03:00
Ben Noordhuis
3c9c920f57 tools: bundle mk-ca-bundle.pl from upstream curl
This is a back-port of commit 5ab863d from the master branch.
2014-12-04 16:57:48 +03:00
Trevor Norris
0d051238be timers: fix unref() memory leak
The destructor isn't being called for timers that have been unref'd.

Fixes: https://github.com/joyent/node/issues/8364
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-11-26 12:27:57 -08:00
Sam Roberts
3a08b7c3e0 doc: cover stdio option in child_process
- Add hyperlinks from spawn options to subsections detailing what
those options do.
- Clarify some verbiage around ChildProcess.prototype.std{in,out,err}.
- Remove second-person pronoun.

PR-URL: https://github.com/joyent/node/pull/8639
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-11-18 19:28:46 -08:00
Trevor Norris
a1b2875afd lint: fix lint issues
Forgot to fix these before landing the patch.

Fixes: e17c5a72
2014-11-18 16:42:10 -08:00
Julien Gilli
caeb67735b domains: fix issues with abort on uncaught
Do not abort the process if an error is thrown from within a domain, an
error handler is setup for the domain and --abort-on-uncaught-exception
was passed on the command line.

However, if an error is thrown from within the top-level domain's error
handler and --abort-on-uncaught-exception was passed on the command
line, make the process abort.

Fixes: https://github.com/joyent/node/issues/8631
Fixes: https://github.com/joyent/node/issues/8630
PR-URL: https://github.com/joyent/node/pull/8666
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-18 16:39:39 -08:00
Trevor Norris
fbff7054a4 v8: add api for aborting on uncaught exception
Add v8::Isolate::SetAbortOnUncaughtException() so the user can be
notified when an uncaught exception has bubbled.

PR-URL: https://github.com/joyent/node/pull/8666
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-18 16:37:54 -08:00
Sam Roberts
8032a21025 test: test all spawn parameter positions
PR-URL: https://github.com/joyent/node/pull/8454
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-18 16:20:31 -08:00
Sam Roberts
70dafa7b62 child_process: check fork args is an array
Optional fork args should be type-checked with same behaviour as the
equivalent argument to spawn.

PR-URL: https://github.com/joyent/node/pull/8454
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-18 16:20:21 -08:00
Sam Roberts
e17c5a72b2 child_process: check execFile args is an array
execFile and spawn have same API signature with respect to optional arg
array and optional options object, they should have same behaviour with
respect to argument validation.

PR-URL: https://github.com/joyent/node/pull/8454
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-18 16:20:06 -08:00
Sam Roberts
2ff29cc7e3 test: use assert.throw to test exceptions
The test wasn't checking directly that an assertion was thrown. Instead,
it was checking that spawn did not sucessfully spawn a non-existent
command.

However, the command chosen, dir, exists in GNU coreutils, so it exists
on Linux (though not on BSD derived OS X). The test as written passed on
Linux, even with the TypeError it is supposed to be checking for deleted
from spawn(). It would also pass on Windows if a ls.exe existed.

The approach is unnecessarily obscure, assert.throw() is for asserting
code throws, using it is more clear and works regardless of what
commands do or do not exist.

PR-URL: https://github.com/joyent/node/pull/8454
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-18 16:19:52 -08:00
Sam Roberts
13a992b1c2 doc: document the fds behind stdin/out/err
Its common knowledge on unix, but node documentation depends on knowing
this, as it exposes both streams named after stdio, and the fd numbers,
so make this explicit.

Fixes: https://github.com/joyent/node/pull/8624
PR-URL: https://github.com/joyent/node/pull/8454
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-18 16:19:21 -08:00
Julien Gilli
5ff59453a4 doc: clarify dns.lookup vs dns.resolve
Clarify and emphasize the differences between dns.lookup and the rest of
the functions in the dns module.

PR-URL: https://github.com/joyent/node/pull/8726
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-11-14 12:33:34 -08:00
Eric Mill
88bd95cfef doc: update openssl commands to use best practices
This updates key size to 2048 and default hash function to sha256.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8690
2014-11-11 20:39:57 +03:00
Fedor Indutny
d435f4b3eb Merge remote-tracking branch 'joyent/v0.10' into v0.10 2014-11-04 00:11:23 -05:00
Emmanuel Odeke
523929c927 repl: Private Buffer object in lib/* files
Fixes usage of global object 'Buffer' in lib/* files by ensuring that
each file does an explicit require('buffer').Buffer.  Previously, when
running a repl, due to usage of global 'Buffer', any redefinition of
Buffer would cause a crash eg var Buffer = {}.

Fixes: https://github.com/joyent/node/issues/8588
PR-URL: https://github.com/joyent/node/pull/8603
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-10-25 00:36:04 -07:00
Timothy J Fontaine
ea69dd7584 Now working on 0.10.34 2014-10-23 12:13:05 -07:00
Timothy J Fontaine
e59eca58ad Merge branch 'v0.10.33-release' into v0.10 2014-10-23 12:12:52 -07:00
Julien Gilli
8d045a30e9 tests: add TLS tests matrix
Add a test that goes through the whole matrix of:
- command line options (--enable-ssl*)
- secureOptions
- secureProtocols

and makes sure that compatible test setups actually work as expected.

The test works by spawning two processes for each test case: one client
and one server. The test passes if a SSL/TLS connection from the client
to the server is successful and the test case was supposed to pass, or
if the connection couldn't be established and the test case was supposed
to fail.

The test is currently located in the directory 'test/external' because
it has external dependencies.
2014-10-23 10:45:12 -07:00
Timothy J Fontaine
69080f5474 tls: enforce secureOptions on incoming clients
Reuse the secureProtocol and secureOptions of the server when creating
the secure context for incoming clients.
2014-10-23 10:45:04 -07:00
Timothy J Fontaine
b9283cf9d1 tls: honorCipherOrder should not degrade defaults
Specifying honorCipherOrder should not change the SSLv2/SSLv3 defaults
for a TLS server.

Use secureOptions logic in both lib/tls.js and lib/crypto.js
2014-10-23 10:44:56 -07:00
Timothy J Fontaine
fe2e8a4a24 2014.10.20, Version 0.10.33 (Stable)
* openssl: Update to 1.0.1j (Addressing multiple CVEs)

* uv: Update to v0.10.29

* child_process: properly support optional args (cjihrig)

* crypto: Disable autonegotiation for SSLv2/3 by default (Fedor Indutny,
Timothy J Fontaine, Alexis Campailla)

This is a behavior change, by default we will not allow the negotiation to
SSLv2 or SSLv3. If you want this behavior, run Node.js with either
`--enable-ssl2` or `--enable-ssl3` respectively.

This does not change the behavior for users specifically requesting
`SSLv2_method` or `SSLv3_method`. While this behavior is not advised, it is
assumed you know what you're doing since you're specifically asking to use
these methods.
2014-10-20 17:43:37 -07:00
Timothy J Fontaine
35443862a2 uv: Update to v0.10.29 2014-10-20 16:13:29 -07:00
Fedor Indutny
1349b680ba crypto: allow forcing SSLv2/v3 via secureProtocol
Force-enable SSLv2/v3 when `secureProtocol` is explicitly set
to `SSLv2_method` or `SSLv3_method`.

see discussion at #8551
2014-10-20 14:35:18 -07:00
Calvin Metcalf
7dbc024c85 doc: add note about key derivation
adds a note to the crypto docs passing along
the advice that openssl gives about what
key derivation function they recommend.

PR-URL: https://github.com/joyent/node/pull/8580
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-10-20 13:41:15 +04:00
Timothy J Fontaine
6c8593d456 crypto: move disaling SSLv2/3 into JavaScript 2014-10-17 15:16:26 -07:00
Timothy J Fontaine
226c98649d doc: clarify poodle mitigation 2014-10-17 15:15:45 -07:00
Timothy J Fontaine
b259f245f8 docs: update api location 2014-10-17 15:14:45 -07:00
Alexis Campailla
3139fa20d7 crypto: extra caution in setting ssl options
Always set ssl2/ssl3 disabled based on whether they are enabled in Node.
In some corner-case scenario, node with OPENSSL_NO_SSL3 defined could
be linked to openssl that has SSL3 enabled.
2014-10-16 18:45:47 +02:00
Timothy J Fontaine
3859fbdb7d test: fix test-net-listen-fd0 for pipes
In the case of a pipe'd input, i.e. from the CI the fd will be a PIPE
and when listen() is called it will return ENOTSOCK instead of EINVAL.

Backport: cd2d3aedaa
2014-10-15 18:48:34 -07:00
Timothy J Fontaine
2afa3d8a03 test: crypto-domains avoid spurious failures
The order of the callbacks is non-deterministic, so don't expect the
error messages to come back in the same order every time, instead just
verify they are expected messages.
2014-10-15 18:36:36 -07:00
Timothy J Fontaine
d601c76f4d crypto: allow runtime opt in using SSLv2/SSLv3
This change disables SSLv2/SSLv3 use by default, and introduces a
command line flag to opt into using SSLv2/SSLv3.

SSLv2 and SSLv3 are considered unsafe, and should only be used in
situations where compatibility with other components is required and
they cannot be upgrade to support newer forms of TLS.
2014-10-15 17:36:05 -07:00
Timothy J Fontaine
c1f4aacc75 build: revert change to disable ssl2 and ssl3 2014-10-15 14:49:41 -07:00
Fedor Indutny
707cc25011 test: fix test-crypto-stream
Because of constant-timeness change made in openssl-1.0.1j the error is
no longer returned from EVP_DecryptFinal_ex. Now it just return 0, and
thus the error message does not contain proper error code. Adapt to this
change, there is not much that we could do about it.
2014-10-15 14:07:00 -07:00
Fedor Indutny
e0e38c2f47 deps: update openssl to 1.0.1j 2014-10-15 14:06:03 -07:00
Fedor Indutny
d6712917f5 doc: document why SSL2/SSL3 is disabled
PR-URL: https://github.com/joyent/node/pull/8551
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-10-15 19:39:56 +04:00
Fedor Indutny
0ec78c961b configure: disable ssl2/ssl3 by default
PR-URL: https://github.com/joyent/node/pull/8551
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-10-15 19:39:40 +04:00
Swaagie
6a95e9f7e0 tls add secureOptions documentation
PR-URL: https://github.com/joyent/node/pull/8553
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-10-15 13:19:54 +04:00
Matthew Fitzsimmons
1524d48333 doc: update design to match nodejs.org 2014-10-13 14:17:39 -07:00
Timothy J Fontaine
641cea0926 doc: build branch versioned docs 2014-10-13 14:17:39 -07:00
Timothy J Fontaine
2b7c8a2f02 test: check for multi-localhost support 2014-10-13 14:17:39 -07:00
Fedor Indutny
d87ae24dfe hdr: always define NODE_WANT_INTERNALS
Otherwise the warning could be printed on some systems.

fix #8419
2014-09-26 10:31:10 +04:00
Calvin Metcalf
c8e0bdd7cf doc: document _transform callback takes 2 args
Expands the paragraph in the transform stream
implementation docs about the callback that is passed
to the _transform method to include details about how
two arguments may be passed, error and data.  A code
example is also included.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-23 15:53:58 +04:00
cjihrig
542ac7f3d2 child_process: properly support optional args
Currently, a TypeError is incorrectly thrown if the second argument is
an object. This commit allows the args argument to be properly omitted.

Fixes: https://github.com/joyent/node/issues/6068
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-17 15:13:34 -07:00
Timothy J Fontaine
84952da241 Now working on 0.10.33 2014-09-16 16:53:10 -07:00
Timothy J Fontaine
1a8b0e807f Merge branch 'v0.10.32-release' into v0.10 2014-09-16 16:52:57 -07:00
Timothy J Fontaine
0fe0d12155 2014.09.16, Version 0.10.32 (Stable)
* npm: Update to 1.4.28

* v8: fix a crash introduced by previous release (Fedor Indutny)

* configure: add --openssl-no-asm flag (Fedor Indutny)

* crypto: use domains for any callback-taking method (Chris Dickinson)

* http: do not send `0rnrn` in TE HEAD responses (Fedor Indutny)

* querystring: fix unescape override (Tristan Berger)

* url: Add support for RFC 3490 separators (Mathias Bynens)
2014-09-16 15:47:52 -07:00
Timothy J Fontaine
daca803e9e npm: Update to 1.4.28 2014-09-16 15:38:50 -07:00
Fedor Indutny
1fddc1fee8 http: do not send 0\r\n\r\n in TE HEAD responses
When replying to a HEAD request, do not attempt to send the trailers and
EOF sequence (`0\r\n\r\n`). The HEAD request MUST not have body.

Quote from RFC:

The presence of a message body in a response depends on both the
request method to which it is responding and the response status code
(Section 3.1.2).  Responses to the HEAD request method (Section 4.3.2
of [RFC7231]) never include a message body because the associated
response header fields (e.g., Transfer-Encoding, Content-Length,
etc.), if present, indicate only what their values would have been if
the request method had been GET (Section 4.3.1 of [RFC7231]).

fix #8361

Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
2014-09-16 15:24:19 -07:00
Chris Dickinson
6e689ece46 crypto: use domains for any callback-taking method
This adds domains coverage for pdbkdf2, pseudoRandomBytes, and randomBytes.
All others should be covered by event emitters.

Fixes #5801.

Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
2014-09-16 15:23:04 -07:00
Maciej Małecki
0664ddc093 doc: document process.env better
Fixes #6424.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-16 02:41:38 +04:00
Mathias Schreck
7c5fabe405 doc: fix modules require.resolve documentation
The behavior of the `node_modules` lookup algorithm was
changed in #1177, but the documentation was not updated completely
to describe the new behavior.

The pseudocode of the lookup algorithm did not metion that
`index.json` is tried to be loaded if you require a folder.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-15 17:17:05 +04:00
Fedor Indutny
627c1a92eb configure: add --openssl-no-asm flag
see #8062

Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2014-09-03 17:35:18 +04:00
Julien Gilli
8e60b4523c tests: add test for non-integer delay timers.
PR #8034 came with a test to make sure that timers expiry is based on
monotonic time and not on wall-clock time. However, a bug in the
implementation broke timers with non-integer delays. A fix for this
issue was provided with PR #8073, but it didn't come with a test.

Because #8073 fixed a subtle issue that could reappear in the future,
and because the impact of such an issue would be significant, I suggest
adding this test.

The test would timeout after 1 minute if the issue was reproduced.
Otherwise it will run very quickly.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-02 22:22:57 +04:00
Mathias Bynens
b869797a2d url: Add support for RFC 3490 separators
There is no need to split the host by hand in `url.js` – Punycode.js
takes care of it anyway. This not only simplifies the code, but also
adds support for RFC 3490 separators (i.e. not just U+002E, but U+3002,
U+FF0E, and U+FF61 as well).

Closes #6055.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-27 14:36:04 +04:00
Tristan Berger
0f2956192c querystring: fix unescape override
Documentation states that `querystring.unescape` may be overridden to
replace unescaper during parsing. However, the function was only
being used as a fallback for when the native decoder throws (on a
malformed URL). This patch moves the call to the native function and
the try/catch around it into querystring.unescape then has the parser
always invoke it, so that an override will always be used.

Fixes #4055

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-27 13:49:16 +04:00
Fedor Indutny
f39e608c6e gyp: use --export-dynamic on FreeBSD
Should help addons use OpenSSL functions.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-27 00:20:10 +04:00
Fedor Indutny
ada85d7307 deps: enable ARM assembly for OpenSSL
fix #8062
2014-08-27 00:18:55 +04:00
Fedor Indutny
3122e0eae6 deps: fix up v8 after fd80a3
fd80a31e06 has introduced a segfault
during redundant boundary check elimination (#8208).

The problem consists of two parts:

  1. Abscense of instruction iterator in
     `EliminateRedundantBoundsChecks`. It was present in recent v8, but
     wasn't considered important at the time of backport. However, since
     the function is changing instructions order in block, it is
     important to not rely at `i->next()` at the end of the loop.
  2. Too strict ASSERT in `MoveIndexIfNecessary`. It is essentially a
     backport of a45c96ab from v8's upstream. See
     https://github.com/v8/v8/commit/a45c96ab for details.

fix #8208
2014-08-22 14:19:08 +04:00
Timothy J Fontaine
adf2cfd54d Now working on 0.10.32 2014-08-19 18:12:30 -04:00
Timothy J Fontaine
3998914ec8 Merge branch 'v0.10.31-release' into v0.10 2014-08-19 18:12:21 -04:00
Timothy J Fontaine
7fabdc23d8 2014.08.19, Version 0.10.31 (Stable)
* v8: backport CVE-2013-6668

* openssl: Update to v1.0.1i

* npm: Update to v1.4.23

* cluster: disconnect should not be synchronous (Sam Roberts)

* fs: fix fs.readFileSync fd leak when get RangeError (Jackson Tian)

* stream: fix Readable.wrap objectMode falsy values (James Halliday)

* timers: fix timers with non-integer delay hanging. (Julien Gilli)
2014-08-19 11:19:52 -04:00
Timothy J Fontaine
6a11bfe74b npm: Update to v1.4.23 2014-08-19 11:17:36 -04:00
Fedor Indutny
d1dd0d6b38 gyp: preserve v8dbg syms on freebsd too 2014-08-18 17:58:36 +04:00
Fedor Indutny
ffd0116eda Revert "gyp: preserve v8dbg syms on freebsd too"
This reverts commit 181b8a5d3a.
2014-08-18 17:57:26 +04:00
Fedor Indutny
181b8a5d3a gyp: preserve v8dbg syms on freebsd too 2014-08-17 14:19:14 +04:00
Fedor Indutny
fd80a31e06 deps: backport 5f836c from v8 upstream
Original commit message:

    Fix Hydrogen bounds check elimination

    When combining bounds checks, they must all be moved before the first load/store
    that they are guarding.

    BUG=chromium:344186
    LOG=y
    R=svenpanne@chromium.org

    Review URL: https://codereview.chromium.org/172093002

    git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@19475 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

fix #8070
2014-08-14 19:29:28 +04:00
Fedor Indutny
6b97c2e986 openssl: fix keypress requirement in apps on win32
Original source:

http://openssl.6102.n7.nabble.com/PATCH-s-client-Fix-keypress-requirement-with-redirected-input-on-Windows-td46787.html

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-13 09:26:53 -07:00
Fedor Indutny
5d824c89c9 deps: update openssl to v1.0.1i 2014-08-13 09:26:42 -07:00
Julien Gilli
b0277f35bd tests: fix child-process-fork-dgram on SmartOS.
Send messages until both the parent and the child process have received
at least one message. If at least one of them doesn't receive any
message, the test runner will make the test timeout.

Fixes #8046.
2014-08-07 16:06:59 -07:00
Maciej Małecki
d6b4766a78 doc: document arguments for 'error' event on a stream
Fixes #6361.
2014-08-07 12:19:33 -07:00
Jackson Tian
cc08106d62 fs: fix fs.readFileSync fd leak when get RangeError 2014-08-07 11:27:12 -07:00
Kevin Simper
70cc9968f6 doc: clarify factory methods for net.Socket 2014-08-06 14:46:18 -07:00
Timothy J Fontaine
53b4accb6e v8: Fix compliation with GCC 4.8
Supresses a very loud warning from GCC 4.8 about unused typedefs

Original url https://codereview.chromium.org/69413002
2014-08-04 15:11:36 -07:00
Julien Gilli
6f043940bd timers: fix timers with non-integer delay hanging.
When backporting f8193ab into v0.10, a regression was introduced. Timers
with non-integer timeout could trigger a infinite recursion with 100%
cpu usage. This commit backports 93b0624 which fixes the regression.

After backporting f8193ab, instead of using Date.now(), timers would use
Timer.now() to determine if they had expired. However, Timer.now() is
based on loop->time, which is not updated when a timer's remaining time
is > 0 and < 1. Timers would thus never timeout if their remaining time
was at some point > 0 and < 1.

With this commit, Timer.now() updates loop->time itself, and timers
always timeout eventually.

Fixes #8065 and #8068.
2014-08-04 12:00:40 -07:00
Sam Roberts
2fd7ee12d9 cluster: disconnect should not be synchronous
Callbacks in node are usually asynchronous, and should never be
sometimes synchronous, and sometimes asynchronous.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-08-02 00:41:13 -07:00
James Halliday
8e2cc69e78 stream: fix Readable.wrap objectMode falsy values
A streams1 stream will have its falsy values such as 0, false, or ""
eaten by the upgrade to streams2, even when objectMode is enabled.

Include test for said cases.

Reviewed-by: isaacs <i@izs.me>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-08-01 13:01:23 -07:00
Jakob Gillich
92518892ec docs: fix non-string ignore note in path.resolve
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-07-31 22:59:30 +04:00
Timothy J Fontaine
4f2b08c523 Now working on 0.10.31 2014-07-31 11:12:08 -07:00
Timothy J Fontaine
98c69e892c Merge branch 'v0.10.30-release' into v0.10 2014-07-31 11:11:53 -07:00
Timothy J Fontaine
bc0ff830af 2014.07.31, Version 0.10.30 (Stable)
* uv: Upgrade to v0.10.28

* npm: Upgrade to v1.4.21

* v8: Interrupts must not mask stack overflow.

* Revert "stream: start old-mode read in a next tick" (Fedor Indutny)

* buffer: fix sign overflow in `readUIn32BE` (Fedor Indutny)

* buffer: improve {read,write}{U}Int* methods (Nick Apperson)

* child_process: handle writeUtf8String error (Fedor Indutny)

* deps: backport 4ed5fde4f from v8 upstream (Fedor Indutny)

* deps: cherry-pick eca441b2 from OpenSSL (Fedor Indutny)

* lib: remove and restructure calls to isNaN() (cjihrig)

* module: eliminate double `getenv()` (Maciej Małecki)

* stream2: flush extant data on read of ended stream (Chris Dickinson)

* streams: remove unused require('assert') (Rod Vagg)

* timers: backport f8193ab (Julien Gilli)

* util.h: interface compatibility (Oguz Bastemur)

* zlib: do not crash on write after close (Fedor Indutny)
2014-07-31 10:24:06 -07:00
Timothy J Fontaine
7169879879 uv: Upgrade to v0.10.28 2014-07-31 09:31:01 -07:00
Fedor Indutny
530af9cb8e v8: Interrupts must not mask stack overflow.
Backport of https://codereview.chromium.org/339883002
2014-07-31 09:26:09 -07:00
Timothy J Fontaine
1223cafea6 npm: Upgrade to v1.4.21 2014-07-31 09:05:30 -07:00
Maciej Małecki
4f1ae11a62 module: eliminate double getenv()
`process.env` access results in a synchronous `getenv` call. Cache the
first result instead and save one syscall.
2014-07-31 08:59:46 -07:00
Rod Vagg
9d281934df streams: remove unused require('assert') 2014-07-31 08:58:33 -07:00
Julien Gilli
befbbad051 timers: backport f8193ab
Original commit message:

 timers: use uv_now instead of Date.now

 This saves a few calls to gettimeofday which can be expensive, and
 potentially subject to clock drift. Instead use the loop time which
 uses hrtime internally.

In addition to the backport, this commit:
 - keeps _idleStart timers' property which is still set to
   Date.now() to avoid breaking existing code that uses it, even if
   its use is discouraged.
 - adds automated tests. These tests use a specific branch of
   libfaketime that hasn't been submitted upstream yet. libfaketime
   is git cloned if needed when running automated tests.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-07-31 08:53:24 -07:00
Fedor Indutny
9f36c0d235 gyp: do not rm unused openssl syms on osx/linux
fix #8026

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-07-31 11:52:01 +04:00
Fedor Indutny
38f6fcd822 buffer: fix sign overflow in readUIn32BE
`|` operation takes precendence on `+`, which will result in
`new Buffer('ffffffff', 16).readUInt32BE(0)` returning `-1` instead of
`ffffffff`.
2014-07-29 12:34:49 +04:00
Fedor Indutny
338ba2bc80 test: fix test-https-foafssl 2014-07-23 23:55:24 +04:00
Fedor Indutny
93390ffc20 test: fix test-tls-server-verify
fix #7963
2014-07-23 23:51:14 +04:00
Sam Roberts
96b166f291 doc: console.trace takes a message format
Documentation claimed it accepted a single label argument, as time and
timeEnd do, which was incorrect.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-07-23 23:09:41 +04:00
Fedor Indutny
eba7aae107 gyp: fix post-mortem in v0.11
Expose missing constants and keep symbols on OSX.
2014-07-23 18:56:49 +04:00
Fedor Indutny
3530fa9cd0 deps: backport 4ed5fde4f from v8 upstream
Original commit message:

    Fix x64 MathMinMax for negative untagged int32 arguments.

    An untagged int32 has zeros in the upper half even if it is negative.
    Using cmpq to compare such numbers will incorrectly ignore the sign.

    BUG=164442
    R=mvstanton@chromium.org

    Review URL: https://chromiumcodereview.appspot.com/11665007

    git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@13273 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-07-18 14:57:18 +04:00
Fedor Indutny
1d3d8c0e55 gyp: do not let v8dbg_ slip away on osx
Pass `-force_load` to linker when linking to `libv8_base` to preserve
`v8dbg_` symbols, which are useful for debugging.
2014-07-17 15:16:29 +04:00
Fedor Indutny
9d9fc3fa30 lib: jslint string_decoder.js 2014-07-15 12:43:59 +04:00
Chris Dickinson
a96d6603b3 stream2: flush extant data on read of ended stream
A ReadableStream with a base64 StringDecoder backed by only
one or two bytes would fail to output its partial data before
ending. This fix adds a check to see if the `read` was triggered
by an internal `flow`, and if so, empties any remaining data.

fixes #7914.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-07-15 12:38:23 +04:00
Fedor Indutny
7f86baf5c7 child_process: handle writeUtf8String error
When handling `writeUtf8String` error, return after emitting it.
Otherwise a runtime failure can occur.

fix #7923
2014-07-12 12:35:26 +03:00
cjihrig
b87ca794e3 lib: remove and restructure calls to isNaN()
Switch condition order to check for null before calling isNaN().
Also remove two unnecessary calls to isNaN() that are already
covered by calls to isFinite(). This commit targets v0.10, as
opposed to #7891, which targets master (suggested by
@bnoordhuis). Closes #7840.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-07-10 15:21:50 +03:00
Maurice Butler
71fc4d9486 doc: added X.json to the LOAD_AS_FILE sudo code
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-07-07 12:00:10 +03:00
Sam Roberts
e2f2a20279 doc: fix console.assert docs, message is a format
Documentation for console.assert incorrectly described message as a
single message, but it is a format.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-07-07 08:44:40 +03:00
Fedor Indutny
11337db35f deps: cherry-pick eca441b2 from OpenSSL
Original commit message:

    bn_exp.c: fix x86_64-specific crash with one-word modulus.

    PR: #3397

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-07-03 00:46:17 +04:00
Trevor Norris
449ffecbb0 configure: fix v8 overriding commands on build
V8 seems to ignore the default value for want_separate_host_toolset and
would override it at build time. Instead always explicitly set the value.

Fixes #7833
2014-07-02 13:32:11 -07:00
Brian White
c7c904b1fc doc: fix createCipher description
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-07-02 13:02:46 -07:00
Fedor Indutny
9cbfd6ef51 constants: add O_NONBLOCK constant
It appears that it is defined unconditionally on all supported unixes.

fix #7867 #7855

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-07-02 12:49:59 -07:00
Fedor Indutny
7cb38309fe Revert "constants: export O_NONBLOCK"
This reverts commit 00890e43fb.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-07-02 12:49:59 -07:00
Fedor Indutny
47ee9a48a8 Revert "src: fix _XOPEN_SOURCE redefinition warning"
This reverts commit 885142a5ed.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-07-02 12:49:59 -07:00
Fedor Indutny
4128d4d2ba Revert "stream: start old-mode read in a next tick"
This reverts commit 2efe4ab761.
2014-06-30 13:06:35 +04:00
Fedor Indutny
a97bdef06d zlib: do not crash on write after close
fix #7767

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-27 17:02:02 +04:00
Oguz Bastemur
c94afdccf3 util.h: interface compatibility
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-27 14:22:01 +04:00
Nick Apperson
ee95e4f5f7 buffer: improve {read,write}{U}Int* methods
Increase the performance and simplify the logic of Buffer#write{U}Int*
and Buffer#read{U}Int* methods by placing the byte manipulation code
directly inline.

Also improve the speed of buffer-write benchmarks by creating a new
call directly to each method by using Function() instead of calling by
buff[fn].

Signed-off-by: Trevor Norris <trev.norris@gmail.com>

Conflicts:
	lib/buffer.js
2014-06-23 16:58:55 -07:00
Ben Noordhuis
72dcc26c7a doc: buffer: clarify typed array construction
It's possible to construct a typed array from a buffer but the buffer
is treated as an array, not a byte array as one might expect.

Fixes #7786.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-06-22 23:45:40 -07:00
Timothy J Fontaine
e22ea56647 node: update changelog to have proper npm version
fixes #7793
2014-06-16 19:16:13 -05:00
Timothy J Fontaine
361aa5344d build: run wix tool chain out of process
Building MSIs for different arch's can sometimes confuse MSBuild and
Wix, isntead run the toolchain externally so we don't have to worry
about which arch cmd.exe is running as.
2014-06-13 14:39:53 -07:00
Timothy J Fontaine
f6ba61bd15 node: signing the CLA is no longer a requirement 2014-06-11 11:51:53 -04:00
Timothy J Fontaine
1cb6f1a46a Now working on 0.10.30 2014-06-09 10:52:27 -07:00
Timothy J Fontaine
fc21bcb017 Merge branch 'v0.10.29-release' into v0.10 2014-06-09 10:51:53 -07:00
Timothy J Fontaine
ce82d6b847 2014.06.05, Version 0.10.29 (Stable)
* openssl: to 1.0.1h (CVE-2014-0224)

* npm: upgrade to 1.4.10

* utf8: Prevent Node from sending invalid UTF-8 (Felix Geisendörfer)
  - *NOTE* this introduces a breaking change, previously you could construct
invalid UTF-8 and invoke an error in a client that was expecting valid
UTF-8, now unmatched surrogate pairs are replaced with the unknown UTF-8
character. To restore the old functionality simply have NODE_INVALID_UTF8
environment variable set.

* child_process: do not set args before throwing (Greg Sabia Tucker)

* child_process: spawn() does not throw TypeError (Greg Sabia Tucker)

* constants: export O_NONBLOCK (Fedor Indutny)

* crypto: improve memory usage (Alexis Campailla)

* fs: close file if fstat() fails in readFile() (cjihrig)

* lib: name EventEmitter prototype methods (Ben Noordhuis)

* tls: fix performance issue (Alexis Campailla)
2014-06-09 10:04:36 -07:00
Brian White
7fd5a4d096 fs: remove duplicate check
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-08 10:01:23 -07:00
Timothy J Fontaine
e9170cbc3d v8: shift heap space for aslr on 64bit
Previously we were only shifting the address space for ASLR on 32bit
processes, apply the same shift for 64bit so processes don't
get artificially limited native heap.
2014-06-06 15:07:30 -07:00
Timothy J Fontaine
f051f31790 npm: upgrade to v1.4.14 2014-06-06 15:07:29 -07:00
Timothy J Fontaine
535c7777ac src: replace usage of String::Utf8Value
v8::String::Utf8Value previously could allow invalid surrogates when
interpreting values.
2014-06-06 15:07:29 -07:00
Felix Geisendörfer
0da4c67165 string_bytes: Guarantee valid utf-8 output
Previously v8's WriteUtf8 function would produce invalid utf-8 output
when encountering unmatched surrogate code units [1]. The new
REPLACE_INVALID_UTF8 option fixes that by replacing invalid code points
with the unicode replacement character.

[1]: JS Strings are defined as arrays of 16 bit unsigned integers. There
is no unicode enforcement, so one can easily end up with invalid unicode
code unit sequences inside a string.
2014-06-06 15:07:29 -07:00
Felix Geisendörfer
881ac26f27 deps/v8: Apply REPLACE_INVALID_UTF8 patch
- https://codereview.chromium.org/121173009/
- https://code.google.com/p/v8/source/detail?r=18683

Note: The v8 test case did not cleanly apply, so it's missing from this
patch. I'm assuming this is not a problem if the v8 test suite is not
part of the node build / test system. If that's the case I'll fix it.
Otherwise the test case will be integrated once v8 is upgraded.
2014-06-06 15:07:29 -07:00
Felix Geisendörfer
80eff96829 string_decoder: Add more comments 2014-06-06 15:07:29 -07:00
Felix Geisendörfer
9fbd0f0f7d string_decoder: Fix failures from new test cases
This patch simplifies the implementation of StringDecoder, fixes the
failures from the new test cases, and also no longer relies on v8's
WriteUtf8 function to encode individual surrogates.
2014-06-06 15:07:29 -07:00
Felix Geisendörfer
22b839845c string_decoder: Improve test coverage
The test cases are still essentially the same, but now all possible ways
of writing a buffer into the decoder are tested, which has exposed a few
failing scenarios that had not been discovered so far!
2014-06-06 15:07:29 -07:00
Fedor Indutny
2efe4ab761 stream: start old-mode read in a next tick
Calling `.read()` in the same tick with `.on('data', ...)` may cause
users missing `error` events, because no `error` listeners were set yet.

fix #7618
2014-06-05 21:12:07 -07:00
Fedor Indutny
a7dd0e51f3 deps: update openssl to 1.0.1h 2014-06-05 07:11:23 -07:00
Chris Barber
715bb7f89f doc: fixed wording in child_process
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-31 10:09:02 +01:00
cjihrig
72cc66e503 fs: close file if fstat() fails in readFile()
Currently, if fstat() fails in readFile(), the callback
is invoked without closing the file. This commit closes
the file before calling back.

Closes #7697
2014-05-28 18:58:32 -07:00
Alexis Campailla
c862c03485 tls: fix performance issue
See https://github.com/orangemocha/node-connection-drop

I have pinpointed the performance degradation to
ac2263b77f

This change brings performance back to the orginal levels.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-23 23:41:30 +04:00
Yazhong Liu
e86c9421ef doc: document url slashes property
Slashes should be documented, because 3rd-party protocols -- those
postfixed with `://` -- would incorrectly `format` and `parse` if they
didn't set/get the `slashes` option.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-05-22 09:27:03 -07:00
Calvin Metcalf
31150df92a doc: clarify end vs finish in streams
Adds a section to the transform stream docs to clarify the
difference between the `end` event and the `finish` events.
Also clarifies the wording on the `end` event.
2014-05-21 16:48:46 -07:00
Andrei Sedoi
1d90b5b78e configure: allow V8 snapshot for cross-compilation
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-16 13:15:25 +04:00
Alexis Campailla
c06495713a crypto: improve memory usage
ClientHelloParser used to contain an 18k buffer that was kept around
for the life of the connection, even though it was not needed in many
situations. I changed it to be deallocated when it's determined to
be no longer needed.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-16 01:33:08 +04:00
Greg Sabia Tucker
7bd08c5062 child_process: do not set args before throwing
No point in setting args and options if TypeError
is being thrown.

fix #7456

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-16 01:31:59 +04:00
Ben Noordhuis
885142a5ed src: fix _XOPEN_SOURCE redefinition warning
Fix the following compiler warning on systems where _XOPEN_SOURCE is
defined by default:

    ../src/node_constants.cc:35:0: warning: "_XOPEN_SOURCE" redefined
     #define _XOPEN_SOURCE 500

Move the (re)definition of _XOPEN_SOURCE to the top of the file while
we're here.  Commit 00890e4 adds a `#define _XOPEN_SOURCE 500` in order
to make <fcntl.h> expose O_NONBLOCK but it does so after other system
headers have been included.  If those headers include <fcntl.h>, then
the #include in node_constants.cc will be a no-op and O_NONBLOCK won't
be visible.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-14 15:33:18 +04:00
Greg Sabia Tucker
92875501d2 child_process: spawn() does not throw TypeError
Ensure TypeError is thrown, fix a bug where `env` option was
assuming the option was actually an object.

This case is especially bad because it then sets `env == null`
instead of using `process.env`.

Fix #7456

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-13 12:25:00 +04:00
Ben Noordhuis
17fbdc18b8 lib: name EventEmitter prototype methods
Before this commit the EventEmitter methods were anonymous functions.
V8 tries to infer names for anonymous functions based on the execution
context but it frequently gets it wrong and when that happens, the
stack trace is usually confusing and unhelpful.  This commit names all
methods so V8 can fall back to the method.name property.

The above gotcha applies to all anonymous functions but is exacerbated
for EventEmitter methods because those are invoked with a plenitude of
different receivers.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-05-07 12:11:57 -07:00
isaacs
120f7cf55f npm: upgrade to 1.4.10
* Don't set referer if already set
* fetch: Send referer and npm-session headers
* run-script: Support --parseable and --json
* list runnable scripts (Evan Lucas)
* Use marked instead of ronn for html docs
2014-05-05 18:20:40 -07:00
Fedor Indutny
00890e43fb constants: export O_NONBLOCK
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-02 22:54:08 +04:00
Fedor Indutny
a960d1707a deps: backport 23f2736a from v8 upstream
Original text:

    Fix corner case in x64 compare stubs.

    BUG=v8:2416

    Review URL: https://codereview.chromium.org/11413087

fix #7528
2014-05-02 22:53:27 +04:00
Timothy J Fontaine
bfe1fdb8ab Now working on 0.10.29 2014-05-02 07:46:15 -07:00
Timothy J Fontaine
d857d5ab09 Merge branch 'v0.10.28-release' into v0.10 2014-05-02 07:46:05 -07:00
Timothy J Fontaine
b148cbe09d 2014.05.01, Version 0.10.28 (Stable)
* npm: upgrade to v1.4.9
2014-05-01 17:47:47 -07:00
isaacs
dbec0a0cd8 npm: upgrade to v1.4.9
* Send referer header (with any potentially private stuff redacted)
* Fix critical typo bug in previous npm release
2014-05-01 16:30:33 -07:00
Timothy J Fontaine
1285008fca Now working on 0.10.28 2014-05-01 15:30:07 -07:00
Timothy J Fontaine
7abd826366 Merge branch 'v0.10.27-release' into v0.10 2014-05-01 15:29:52 -07:00
Timothy J Fontaine
cb7911f78a 2014.05.01, Version 0.10.27 (Stable)
* npm: upgrade to v1.4.8

* openssl: upgrade to 1.0.1g

* uv: update to v0.10.27

* dns: fix certain txt entries (Fedor Indutny)

* assert: Ensure reflexivity of deepEqual (Mike Pennisi)

* child_process: fix deadlock when sending handles (Fedor Indutny)

* child_process: fix sending handle twice (Fedor Indutny)

* crypto: do not lowercase cipher/hash names (Fedor Indutny)

* dtrace: workaround linker bug on FreeBSD (Fedor Indutny)

* http: do not emit EOF non-readable socket (Fedor Indutny)

* http: invoke createConnection when no agent (Nathan Rajlich)

* stream: remove useless check (Brian White)

* timer: don't reschedule timer bucket in a domain (Greg Brail)

* url: treat  the same as / (isaacs)

* util: format as Error if instanceof Error (Rod Vagg)
2014-05-01 14:04:20 -07:00
isaacs
f76c3938d0 npm: upgrade to v1.4.8
* Check SHA before using files from cache
* adduser: allow change of the saved password
* Make `npm install` respect `config.unicode`
* Fix lifecycle to pass `Infinity` for config env value
* Don't return 0 exit code on invalid command
* cache: Handle 404s and other HTTP errors as errors
* bump tap dep, make tests stderr a bit quieter
* Resolve ~ in path configs to env.HOME
* Include npm version in default user-agent conf
* npm init: Use ISC as default license, use save-prefix for deps
* Many test and doc fixes
2014-05-01 11:09:00 -07:00
Timothy J Fontaine
1038959dbf uv: update to v0.10.27 2014-05-01 09:27:39 -07:00
Forrest L Norvell
793c76e5c6 docs: add cautionary note to emitter.removeAllListeners
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-29 14:15:10 +04:00
Ben Noordhuis
3f3a71e61e deps: fix v8 link error with glibc < 2.17
Commit f9ced08 switches V8 on Linux over from gettimeofday() to
clock_getres() and clock_gettime().  As of glibc 2.17, those functions
live in libc.  For older versions, we need to pull them in from librt.

Fixes the following link-time error;

    Release/obj.target/deps/v8/tools/gyp/libv8_base.a(platform-posix.o):
    In function `v8::internal::OS::Ticks()':
    platform-posix.cc:(.text+0x93c):
    undefined reference to `clock_gettime'
    platform-posix.cc:(.text+0x989):
    undefined reference to `clock_getres'

Fixes #7514.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-28 19:34:07 +04:00
Rod Vagg
250782d139 util: format as Error if instanceof Error
Conflicts:
	lib/util.js
	test/simple/test-util-format.js

This is a backport to fix #7253

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-26 00:52:49 +04:00
Ben Noordhuis
f9ced08de3 deps: make v8 use CLOCK_REALTIME_COARSE
Date.now() indirectly calls gettimeofday() on Linux and that's a system
call that is extremely expensive on virtualized systems when the host
operating system has to emulate access to the hardware clock.

Case in point: output from `perf record -c 10000 -e cycles:u -g -i`
for a benchmark/http_simple bytes/8 benchmark with a light load of
50 concurrent clients:

    53.69%     node  node                 [.] v8::internal::OS::TimeCurrentMillis()
               |
               --- v8::internal::OS::TimeCurrentMillis()
                  |
                  |--99.77%-- v8::internal::Runtime_DateCurrentTime(v8::internal::Arguments, v8::internal::Isolate*)
                  |          0x23587880618e

That's right - over half of user time spent inside the V8 function that
calls gettimeofday().

Notably, nearly all system time gets attributed to acpi_pm_read(), the
kernel function that reads the ACPI power management timer:

    32.49%     node  [kernel.kallsyms]    [k] acpi_pm_read
               |
               --- acpi_pm_read
                  |
                  |--98.40%-- __getnstimeofday
                  |          getnstimeofday
                  |          |
                  |          |--71.61%-- do_gettimeofday
                  |          |          sys_gettimeofday
                  |          |          system_call_fastpath
                  |          |          0x7fffbbaf6dbc
                  |          |          |
                  |          |          |--98.72%-- v8::internal::OS::TimeCurrentMillis()

The cost of the gettimeofday() system call is normally measured in
nanoseconds but we were seeing 100 us averages and spikes >= 1000 us.
The numbers were so bad, my initial hunch was that the node process was
continuously getting rescheduled inside the system call...

v8::internal::OS::TimeCurrentMillis()'s most frequent caller is
v8::internal::Runtime_DateCurrentTime(), the V8 run-time function
that's behind Date.now().  The timeout handling logic in lib/http.js
and lib/net.js calls into lib/timers.js and that module will happily
call Date.now() hundreds or even thousands of times per second.
If you saw exports._unrefActive() show up in --prof output a lot,
now you know why.

That's why this commit makes V8 switch over to clock_gettime() on Linux.
In particular, it checks if CLOCK_REALTIME_COARSE is available and has
a resolution <= 1 ms because in that case the clock_gettime() call can
be fully serviced from the vDSO.

It speeds up the aforementioned benchmark by about 100% on the affected
systems and should go a long way toward addressing the latency issues
that StrongLoop customers have been reporting.

This patch will be upstreamed as a CR against V8 3.26.  I'm sending it
as a pull request for v0.10 first because that's what our users are
running and because the delta between 3.26 and 3.14 is too big to
reasonably back-port the patch.  I'll open a pull request for the
master branch once the CR lands upstream.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-24 14:02:05 -07:00
Julian Gruber
0ee99565f9 doc: fix missing link in net api
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-24 19:59:41 +04:00
Julian Gruber
b0fa931e07 doc: fix order in net api
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-24 19:59:41 +04:00
Fedor Indutny
4601e7c892 Revert "deps: backport b5135bbc from c-ares repo"
This reverts commit 896e19330a.

Proper handling of TXT records requires API change, we can't afford it
in v0.10.

See #7371 for details.
2014-04-24 10:19:30 +04:00
isaacs
75bc11cf12 npm: upgrade to 1.4.7
* isaacs, Robert Kowalski, Benjamin Coe: Test Improvements
* isaacs doc: Add canonical url
* isaacs view: handle unpublished packages properly
* Raynos (Jake Verbaten) do not log if silent
* Julian Gruber fix no such property error
* isaacs npmconf@0.1.14
* Thorsten Lorenz adding save-prefix configuration option
* isaacs npm-registry-client@0.4.7
* isaacs cache: treat missing versions as a 404
* isaacs cache: Save shasum, write resolved/etc data to cache
* isaacs cache: Always fetch root doc
* isaacs cache: don't repack unnecessarily from tmp
* Andrey Kislyuk Don't crash if shrinkwrap-dependencies were not passed in pkginfo
* Robert Kowalski fix link in faq
* Jean Lauliac Add a peerDependencies section in package.json doc
* isaacs read-installed@2.0.2
2014-04-15 15:31:36 -07:00
isaacs
9520adeb37 url: treat \ the same as /
See https://code.google.com/p/chromium/issues/detail?id=25916

Parse URLs with backslashes the same as web browsers, by replacing all
backslashes with forward slashes, except those that occur after the
first # character.
2014-04-15 15:30:43 -07:00
Fedor Indutny
1bd4f3a605 child_process: fix deadlock when sending handles
Fix possible deadlock, when handles are sent in both direction
simultaneously. In such rare cases, both sides may queue their
`NODE_HANDLE_ACK` replies and wait for them.

fix #7465
2014-04-14 20:15:09 +04:00
William Bert
bfb7de5e75 docs: fix links to streams
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-11 00:52:33 +04:00
Timothy J Fontaine
632c135622 src: use monotonic time for process.uptime()
`process.uptime()` interface will return the amount of time the
current process has been running. To achieve this it was caching the
`uv_uptime` value at program start, and then on the call to
`process.uptime()` returning the delta between the two values.

`uv_uptime` is defined as the number of seconds the operating system
has been up since last boot. On sunos this interface uses `kstat`s
which can be a significantly expensive operation as it requires
exclusive access, but because of the design of `process.uptime()` node
*had* to always call this on start. As a result if you had many node
processes all starting at the same time you would suffer lock
contention as they all tried to read kstats.

Instead of using `uv_uptime` to achieve this, the libuv loop already
has a concept of current loop time in the form of `uv_now()` which is
in fact monotonically increasing, and already stored directly on the
loop. By using this value at start every platform performs at least
one fewer syscall during initialization.

Since the interface to `uv_uptime` is defined as seconds, in the call
to `process.uptime()` we now `uv_update_time` get our delta, divide by
1000 to get seconds, and then convert to an `Integer`. In 0.12 we can
move back to `Number::New` instead and not lose precision.

Caveat: For some platforms `uv_uptime` reports time monotonically
increasing regardless of system hibernation, `uv_now` interface is
also monotonically increasing but may not reflect time spent in
hibernation.
2014-04-10 10:55:02 -07:00
Timothy J Fontaine
af69f88a9d build: make sure changelog.html is generated 2014-04-08 09:06:28 -07:00
Fedor Indutny
d6fd118727 deps: update openssl to 1.0.1g 2014-04-08 00:58:37 +04:00
Fedor Indutny
f2b297cc7c http: do not emit EOF non-readable socket
Socket may become not `readable`, but http should not rely on this
property and should not think that it means that no data will ever
arrive from it. In fact, it may arrive in a next tick and, since
`this.push(null)` was already called, it will result in a error like
this:

    Error: stream.push() after EOF
        at readableAddChunk (_stream_readable.js:143:15)
        at IncomingMessage.Readable.push (_stream_readable.js:123:10)
        at HTTPParser.parserOnBody (_http_common.js:132:22)
        at Socket.socketOnData (_http_client.js:277:20)
        at Socket.EventEmitter.emit (events.js:101:17)
        at Socket.Readable.read (_stream_readable.js:367:10)
        at Socket.socketCloseListener (_http_client.js:196:10)
        at Socket.EventEmitter.emit (events.js:123:20)
        at TCP.close (net.js:479:12)

fix #6784
2014-04-08 00:40:22 +04:00
Brian White
c2d32f4c0e doc: add missing space
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-07 17:45:04 +04:00
Dominic Tarr
cdc093b31f docs: correct tls docs. server -> client
when a pfx file is passed to tls.connection,
it is the client private key, not the server's private key.
2014-04-02 15:34:16 +04:00
Goh Yisheng (Andrew)
47bed4828c doc: typo clean up in tls 2014-03-31 07:40:17 -07:00
Josh Dague
a9d22247ad build: windows signing should include timestamps
Previously the build artifacts did not include a signed timestamp, so
when the certificate expired the validation of the artifact would fail.
Now we sign against a timestamp server such that the artifact will
always be valid regardless of the disposition of the certificate.

Closes #7360 and #7059.
2014-03-27 11:54:13 -07:00
Ben Noordhuis
f68a116c3c src: ensure that openssl's PRNG is fully seeded
Ensure that OpenSSL has enough entropy (at least 256 bits) for its PRNG.

The entropy pool starts out empty and needs to fill up before the PRNG
can be used securely.

OpenSSL normally fills the pool automatically but not when someone
starts generating random numbers before the pool is full: in that case
OpenSSL keeps lowering the entropy estimate to thwart attackers trying
to guess the initial state of the PRNG.

When that happens, we wait until enough entropy is available, something
that normally should never take longer than a few milliseconds.

Fixes #7338.
2014-03-26 11:31:32 +04:00
Ben Noordhuis
70f198ddb1 src: seed V8's random number generator at startup
The default entropy source is /dev/urandom on UNIX platforms, which is
okay but we can do better by seeding it from OpenSSL's entropy pool.

On Windows we can certainly do better; on that platform, V8 seeds the
random number generator using only the current system time.

Fixes #6250.

NB: This is a back-port of commit 7ac2391 from the master branch that
for some reason never got back-ported to the v0.10 branch.

The default on UNIX platforms in v0.10 is different and arguably worse
than it is with master: if no entropy source is provided, V8 3.14 calls
srandom() with a xor of the PID and the current time in microseconds.

That means that on systems with a coarse system clock, the initial
state of the PRNG may be easily guessable.

The situation on Windows is even more dire because there the PRNG is
seeded with only the current time... in milliseconds.
2014-03-26 11:31:32 +04:00
isaacs
bd547d6598 npm: upgrade to 1.4.6
* Documentation upgrades
* Fix glob bug which prevents proper README publishing
* node-gyp upgrade to 0.13
* Documentation updates
* Add --save-exact to save an exact dep (instead of a range)
* alias 't' to 'test'
2014-03-25 17:42:22 -07:00
Ben Noordhuis
7989f42f86 build: fix g++ 4.8 build, disable -Werror
Turn off -Werror when building V8, it hits -Werror=unused-local-typedefs
with g++ 4.8.  The warning itself is harmless so don't abort the build.

This was originally implemented in commit d2ab314e back in 2011 but the
build process has gone through a few iterations since then, that change
no longer works.
2014-03-23 16:11:08 -07:00
Shuhei Kagawa
43a29f53ca doc: remove an unused arg in process.stdin.
The argument of process.stdin's readable event handler is not used.
2014-03-10 15:30:40 -07:00
Fedor Indutny
f0d870501e crypto: do not lowercase cipher/hash names
`crypto.getCiphers()` and `crypto.getHashes()` should prefer lower-case
variants of names, but should not introduce them.

fix #7282
2014-03-11 01:08:43 +04:00
Ben Noordhuis
6bd78fd770 deps: fix v8 valgrind warning
Fix the following valgrind warning:

    Conditional jump or move depends on uninitialised value(s)
        at 0x7D64E7: v8::internal::GlobalHandles::IterateAllRootsWithClassIds(v8::internal::ObjectVisitor*) (global-handles.cc:613)
        by 0x94DCDC: v8::internal::NativeObjectsExplorer::FillRetainedObjects() (profile-generator.cc:2849)
        # etc.

This was fixed upstream in r12903 and released in 3.15.2 but that commit
was never back-ported to the 3.14 branch that node.js v0.10 uses.

The code itself works okay; this commit simply shuffles the clauses in
an `if` statement to check that the node is in use before checking its
class id (which is uninitialized if the node is not in use.)
2014-03-07 03:29:00 +04:00
Fedor Indutny
5e06ce4fb9 child_process: fix sending handle twice
When sending a socket to a child process via IPC pipe,
`child_process.js` picks a raw UV handle from `_handle` property, sends
it, and assigns `null` to the property. Sending the same socket twice
was resulting in a runtime error, since we weren't handling the empty
`_handle` case.

In case of `null` `_handle` we should send just a plain text message
as passed it was passed to `.send()` and ignore the handle, letting
users handle such cases themselves instead of throwing the error at
runtime.

fix #5469
2014-03-05 09:36:35 -08:00
Benoit Vallée
a9d24fa40d test: test sending a handle twice
Added test-cluster-send-handle-twice.js testing to send a handle
twice to the parent process.
2014-03-05 09:36:32 -08:00
Ben Noordhuis
bd8a5755dc src: add default visibility to NODE_MODULE
It's currently not really possible to compile native add-ons with
-fvisibility=hidden because that also hides the struct containing
the module definition.

The NODE_MODULE() and NODE_MODULE_DECL() macros are structured in
a way that makes it impossible to add a visibility attribute manually
so there is no escape hatch there.

That's why this commit adds an explicit visibility attribute to
the module definition.  It doesn't help with node.js releases that
are already out there but at least it improves the situation going
forward.
2014-03-05 15:26:09 +04:00
Greg Brail
6eb4d1d15c timer: don't reschedule timer bucket in a domain
If two timers run on the same tick, and the first timer uses a domain,
and then catches an exception and disposes of the domain, then the
second timer never runs. (And even if the first timer does not dispose
of the domain, the second timer could run under the wrong domain.)

This happens because timer.js uses "process.nextTick()" to schedule
continued processing of the timers for that tick. However, there was
an exception inside a domain, then "process.nextTick()" runs under
the domain of the first timer function, and will do nothing if
the domain has been disposed.

To avoid this, we temporarily save the value of "process.domain"
before calling nextTick so that it does not run inside any domain.
2014-03-03 17:46:49 -08:00
Timothy J Fontaine
06453a94a7 src: domain should not replace nextTick function
Previously if you cached process.nextTick and then require('domain')
subsequent nextTick() calls would not be caught because enqueued
functions were taking the wrong path. This keeps nextTick to a single
function reference and changes the implementation details after domain
has been required.
2014-03-03 16:27:58 -08:00
Nathan Rajlich
47abdd9c43 test: add agent: null http client request test
This is just the test portion from #7012 / #7189,
but targetted for the v0.10 branch.
2014-02-26 11:39:53 -08:00
Nathan Rajlich
0a01a42e87 http: invoke createConnection when no agent
This makes it so that the user may pass in a
`createConnection()` option, and they don't have
to pass `agent: false` at the same time.

Also adding a test for the `createConnection` option,
since none was in place before.

See #7014.
2014-02-26 11:14:32 -08:00
Mike Pennisi
aae51ecf7d assert: Ensure reflexivity of deepEqual
Ensure that the behavior of `assert.deepEqual` does not depend on
argument ordering  when comparing an `arguments` object with a
non-`arguments` object.
2014-02-25 20:32:49 +04:00
Brian White
70ea5bac43 stream: remove useless check 2014-02-24 15:08:11 +04:00
Nicolas Talle
1efe6837b2 doc: update assert.markdown
Update assert.throws() and assert.doesNotThrow() docs
2014-02-23 18:09:26 +04:00
Fedor Indutny
e0c5302590 installer: copy node.d only with node_use_dtrace 2014-02-21 01:03:03 +04:00
Fedor Indutny
a6f89ccd76 dtrace: workaround linker bug on FreeBSD 2014-02-21 00:56:17 +04:00
Fedor Indutny
b7776fb192 configure: allow --with-dtrace on freebsd 2014-02-21 00:46:26 +04:00
Fedor Indutny
b940e0fd86 gyp: specialize node.d for freebsd
`node.d` should use `psinfo.d` instead of `procfs.d` and have statically
defined architecture on FreeBSD.
2014-02-21 00:46:26 +04:00
Timothy J Fontaine
085db9dd6c tools: update to support separate website repo 2014-02-18 18:57:45 -08:00
Timothy J Fontaine
ae418f974d Now working on v0.10.27 2014-02-18 16:43:12 -08:00
Timothy J Fontaine
0206925b0d Merge branch 'v0.10.26-release' into v0.10 2014-02-18 16:40:23 -08:00
Timothy J Fontaine
cc56c62ed8 build: readd missing installer resources
This were accidentally moved during the website refactor
2014-02-18 15:34:29 -08:00
Timothy J Fontaine
31c510ca88 2014.02.18, Version 0.10.26 (Stable)
* uv: Upgrade to v0.10.25 (Timothy J Fontaine)

* npm: upgrade to 1.4.3 (isaacs)

* v8: support compiling with VS2013 (Fedor Indutny)

* cares: backport TXT parsing fix (Fedor Indutny)

* crypto: throw on SignFinal failure (Fedor Indutny)

* crypto: update root certificates (Ben Noordhuis)

* debugger: Fix breakpoint not showing after restart (Farid Neshat)

* fs: make unwatchFile() insensitive to path (iamdoron)

* net: do not re-emit stream errors (Fedor Indutny)

* net: make Socket destroy() re-entrance safe (Jun Ma)

* net: reset `endEmitted` on reconnect (Fedor Indutny)

* node: do not close stdio implicitly (Fedor Indutny)

* zlib: avoid assertion in close (Fedor Indutny)
2014-02-18 14:55:58 -08:00
Anton Khlynovskiy
1fa5cff4f2 docs: clarify process.stdin and old mode 2014-02-18 13:52:14 -08:00
Pedro Ballesteros
1d734a75b5 doc: stdout blocking or non-blocking behaviour
Makes clear that the behaviour of stdout is blocking
in Linux/Unix even when they refer to pipes.
2014-02-18 13:36:00 -08:00
Timothy J Fontaine
3e6e63406d test: make test-net-error-twice less racey 2014-02-18 13:10:09 -08:00
Timothy J Fontaine
c2aea3747d uv: Upgrade to v0.10.25 2014-02-18 13:04:29 -08:00
Raynos
abbde2fafa doc: mention objectMode for Writable streams 2014-02-18 10:29:04 -08:00
Farid Neshat
562b015170 debugger: Fix breakpoint not showing after restart
The reason this wasn't working was because after restart, when restoring
breakpoints the scripts wasn't loaded, so the breakpoint.script was
undefined. As a fix I added another check to use breakpoint.scriptReq
instead of breakpoint.script, which is the same except when the
breakpoint is a function.

fixes #7027
2014-02-17 20:47:46 -08:00
isaacs
217bb0c964 npm: upgrade to 1.4.3 2014-02-17 19:37:33 -08:00
Fedor Indutny
829a9b8cba zlib: introduce pending close state
zlib should not crash in `close()` if the write is still in progress.

fix #7101
2014-02-18 01:11:05 +04:00
Timothy J Fontaine
86b8d84811 doc: re-add node.1 man page
The man page was accidentally removed in 37376de for the website
refactor, bring it back.

Fixes #7117
2014-02-14 11:01:49 -08:00
isaacs
55543d3c45 npm: Upgrade to v1.4.0
- Removes 'npm publish -f'
- Documentation
- Bug-fixes
- Update license etc to refer to npm, Inc. rather than @isaacs personally
2014-02-13 16:35:41 -08:00
Timothy J Fontaine
37376debe5 website: move website to joyent/node-website
The website will no longer be living in the source repository instead
it can be found at http://github.com/joyent/node-website
2014-02-13 15:54:07 -08:00
Christian
b222374b07 doc: changed timer id to object
fix #7074
2014-02-13 02:18:10 +04:00
Fedor Indutny
dee5270a6c net: do not re-emit stream errors
fix #7015
2014-02-10 10:59:52 -08:00
Timothy J Fontaine
5c832e44c3 src: refactor buffer bounds checking
Consolidate buffer bounds checking logic into Buffer namespace and use
it consistently throughout the source.
2014-02-08 15:31:27 -08:00
isaacs
2e8bb57fe3 npm: upgrade to 1.3.26 2014-02-08 15:10:43 -08:00
Brian White
3595139b51 doc: fix diffieHellman.getGenerator() description 2014-02-09 02:42:41 +04:00
Fedor Indutny
d10a68736d Revert "dns: validate arguments in resolve"
This reverts commit 56e80a37e0.
2014-02-08 02:15:33 +04:00
Fedor Indutny
96379f83e0 Revert "dns: verify argument is valid function in resolve"
This reverts commit 2ee86c624e.
2014-02-08 02:15:29 +04:00
Kenan Sulayman
2ee86c624e dns: verify argument is valid function in resolve
Don't use argument as callback if it's not a valid callback function.
Throw a valid exception instead explaining the issue. Adds to #7070
("DNS — Throw meaningful error(s)").
2014-02-08 02:10:01 +04:00
Kenan Sulayman
56e80a37e0 dns: validate arguments in resolve
Mitigat  C++-land assertion error, add test accordingly.

fix #7070
2014-02-08 02:08:28 +04:00
Timothy J Fontaine
e3d8359021 website: update cla email address 2014-02-07 11:17:23 -08:00
iamdoron
1317032c97 fs: make unwatchFile() insensitive to path 2014-02-06 13:04:35 +04:00
Benjamin Waters
d2147c55c2 doc: fix references to error keyword
References for err.signal and err.code should be error.signal and
error.code.

Fixes joyent/node#6862
2014-02-04 12:50:24 +04:00
Ben Noordhuis
09c51d5e40 crypto: update root certificates
Update the list of root certificates in src/node_root_certs.h with
tools/mk-ca-bundle.pl and update src/node_crypto.cc to make use of
the new format.

Fixes #6013.
2014-02-04 01:42:52 +04:00
Maxime Quandalle
154d9d2163 doc: add an example about multiple extensions
`path.extname` returns only the last extension
2014-02-03 12:38:40 +04:00
Fedor Indutny
643a7d8c16 dtrace: fix arguments warning
Add enough arguments to `NODE_NET_SOCKET_READ()` and
`NODE_NET_SOCKET_WRITE()` stubs.
2014-02-01 00:45:55 +04:00
Fedor Indutny
fac8f396cc deps: backport 883637bd from latest v8
Original commit message:

  VS2013 contains a number of improvements, most notably the addition
  of all C99 math functions.

  I'm a little bit concerned about the change I had to make in
  cpu-profiler.cc, but I spent quite a bit of time looking at it and was
  unable to figure out any rational explanation for the warning. It's
  possible it's spurious. Since it seems like a useful warning in
  general   though, I chose not to disable globally at the gyp level.

  I do think someone with expertise here should probably try to
  determine if this is a legitimate warning.

  BUG=288948
  R=dslomov@chromium.org

  Review URL: https://codereview.chromium.org/23449035

NOTE: Path applied without `cpu-profiler.cc` changes because in our
version it was looking totally different.
2014-02-01 00:45:55 +04:00
Fedor Indutny
e796e11087 node: do not ever close stdio
Even if stdio streams are opened as file streams, we should not ever try
to close them. This could be accomplished by passing `autoClose: false`
in options on their creation.
2014-01-30 21:26:19 +04:00
Timothy J Fontaine
a98d541733 blog: Post for v0.11.11 2014-01-28 19:48:54 -08:00
Wyatt Preul
8c05570258 docs: clarify origin in agent.maxSockets section 2014-01-29 03:39:54 +04:00
Jun Ma
d2de8ba34d net: make Socket destroy() re-entrance safe
So that we are free to call socket.destroy() in error event handler.

fix #6769
2014-01-27 22:12:29 +04:00
Fedor Indutny
b4c4e0bbaa crypto: throw on SignFinal failure
fix #6963
2014-01-26 22:24:57 +04:00
Fedor Indutny
00efcb4cd7 net: reset endEmitted on reconnect
fix #6908
2014-01-25 12:20:45 -08:00
Fedor Indutny
896e19330a deps: backport b5135bbc from c-ares repo
Original commit message:

    ares_parse_txt_reply: return a ares_txt_reply node for each sub-string

    Previously, the function would wrongly return all substrings merged into
    one.

fix #6931
2014-01-25 12:20:41 -08:00
Fedor Indutny
0ec3770767 doc: readline document TTY utils
fix #6933
2014-01-25 12:10:44 -08:00
Scott González
9975ff603b doc: fix typo in readline 2014-01-24 18:56:46 +04:00
isaacs
485fcf9c63 npm: Upgrade to v1.3.25 2014-01-23 13:04:49 -08:00
Alexis Campailla
42cd468901 test: fix http-incoming-pipelined-socket-destroy
The test was calling server.close() after write on the socket
had completed. However the fact that the write had completed was
not valid indication that the server had received the data.

This would result in a premutaure closing of the server and
an ECONNRESET event on the client.
2014-01-23 12:42:56 -08:00
Alexis Campailla
5d4f4ee310 test: fix http-many-ended-pipelines server close
The test was calling server.close() without waiting for the server
to have received all the requests. This would cause an ECONNRESET.
2014-01-23 12:42:36 -08:00
Timothy J Fontaine
5aebc73525 blog: Post for v0.10.25 2014-01-23 11:44:32 -08:00
Timothy J Fontaine
eb7c7be7da Now working on 0.10.26 2014-01-23 11:44:32 -08:00
Timothy J Fontaine
24d05f21be Merge branch 'v0.10.25-release' into v0.10 2014-01-23 11:44:14 -08:00
Timothy J Fontaine
b0e5f195df src: lint lib/net.js 2014-01-22 21:05:51 -08:00
Timothy J Fontaine
bc2f31ae1d 2014.01.23, Version 0.10.25 (Stable)
* uv: Upgrade to v0.10.23

* npm: Upgrade to v1.3.24

* v8: Fix enumeration for objects with lots of properties

* child_process: fix spawn() optional arguments (Sam Roberts)

* cluster: report more errors to workers (Fedor Indutny)

* domains: exit() only affects active domains (Ryan Graham)

* src: OnFatalError handler must abort() (Timothy J Fontaine)

* stream: writes may return false but forget to emit drain (Yang Tianyang)
2014-01-22 21:03:08 -08:00
Timothy J Fontaine
8b7ec73331 uv: Upgrade to v0.10.23 2014-01-22 20:47:12 -08:00
Fedor Indutny
25f9e92813 gyp: fix non-ninja build 2014-01-20 18:39:05 +04:00
isaacs
f645c40fcd npm: Upgrade to v1.3.24 2014-01-19 21:13:20 -08:00
Timothy J Fontaine
1d57a5caa4 blog: nodejs v0.12 roadmap update 2014-01-16 14:43:29 -08:00
Fedor Indutny
61c0d571bf gyp: fix ninja build on linux
fix #6679
2014-01-16 17:11:04 +00:00
Sam Roberts
abe02553f2 doc: clarify Windows signal sending emulation 2014-01-16 08:41:04 -08:00
Sam Roberts
67e9298fb6 child_process: fix spawn() optional arguments
Spawn's arguments were documented to be optional, as they are for the
other similar child_process APIs, but the code was missing. Result was
`child_process.spawn('node', {})` errored when calling slice() on an
Object, now it behaves as the documentation said it would.
2014-01-16 07:35:12 -08:00
Sam Roberts
198ed0bd0d doc: describe child_process.fork() silent option 2014-01-16 07:35:12 -08:00
Sam Roberts
549be1caa8 doc: child_process.execFile arguments are optional 2014-01-16 07:35:12 -08:00
Ryan Graham
7f81ca2c47 domains: exit() only affects active domains
domain.create().exit() should not clear the domain stack if the domain
instance does not exist within the stack.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-01-15 12:27:10 -08:00
isaacs
e7f7e2aeca blog: TJ is the new node core project lead 2014-01-15 09:03:45 -08:00
Fedor Indutny
a05dae2ced gyp: fix build with python 2.6
fix #6859
2014-01-13 22:03:40 -08:00
Fedor Indutny
346b59e4a3 deps: update gyp to 1eae492b 2014-01-13 22:03:40 -08:00
Sam Roberts
7bd6e33318 doc: streams must be open to be passed to child
spawn stdio options can be a 'stream', but the following code
fails with "Incorrect value for stdio stream: [object Object]",
despite being a stream. The problem is the test isn't really
for a stream, its for an object with a numeric `.fd` property,
and streams do not have an fd until their async 'open' event
has occurred. This is reasonable, but was not documented.

    child_process.spawn('date', [], {stdio: [
      'ignore',
      fs.createWriteStream('out.txt',{flags:'a'}),
      'ignore']})
2014-01-13 21:36:56 +00:00
Alexis Campailla
1b74892807 test: close debug client in test-debugger-client
Killing the debuggee without first closing the socket can result
in an ECONNRESET error.
2014-01-13 13:16:25 -08:00
Timothy J Fontaine
8753bb3859 src: return empty set on ENOSYS for interfaces
If node was compiled with --no-ifaddrs to support older operating
systems, don't throw instead simply return an empty object

Fixes #6846
2014-01-12 10:04:21 -08:00
svenpanne@chromium.org
196184d332 v8: backport codereview.chromium.org/11362182
Keep the number of descriptors below
DescriptorArray::kMaxNumberOfDescriptors even for accessors

Review URL: https://codereview.chromium.org/11362182
2014-01-10 23:32:08 +00:00
gluxon
56913d2cde doc: Fix argument typo in SimpleProtocol example 2014-01-10 08:42:34 -08:00
Timothy J Fontaine
270c2deb84 src: OnFatalError handler must abort()
We are in an unrecoverable state if v8 throws a FatalError, actually
ask the operating system to dump core in this case.

Fixes #6836
2014-01-09 14:01:53 -08:00
Lorenz Leutgeb
fc7e217a30 doc: fix typo in cluster page 2014-01-08 23:39:02 +04:00
Timothy J Fontaine
30b3bc2f7c uv: Upgrade to v0.10.22 2014-01-07 14:05:58 -08:00
isaacs
1be9365930 npm: Upgrade to 1.3.23 2014-01-06 17:02:07 -08:00
ayanamist
b922b5e90d stream: writes may return false but forget to emit drain
If a write is above the highWaterMark, _write still manages to
fully send it synchronously, _writableState.length will be adjusted down
to 0 synchronously with the write returning false, but 'drain' will
not be emitted until process.nextTick.

If another small write which is below highWaterMark is issued before
process.nextTick happens, _writableState.needDrain will be reset to false,
and the drain event will never be fired.

So we should check needDrain before setting it up, which prevents it
from inproperly resetting to false.
2014-01-05 19:44:45 +04:00
Timothy J Fontaine
aa56d9d354 blog: Post for v0.11.10 2013-12-31 16:24:58 -08:00
Maciej Małecki
5a8de857f0 doc: document that process.send is synchronous
Ref #2598
2013-12-31 14:52:43 -08:00
Timothy J Fontaine
ffb718b5a3 doc: clarify process on exit safe usage 2013-12-31 14:48:20 -08:00
Ron Korving
3917232030 docs: process.on('exit') receives exit code
The fact that the "exit" event passes the exit code as an argument
as omitted from the documentation. This adds the explanation and
augments the example code to show that.
2013-12-31 14:38:09 -08:00
Timothy J Fontaine
6f8aa24d1e test: fix test-cluster-eaccess to work on windows 2013-12-31 11:57:13 -08:00
Fedor Indutny
3e9f2e61db cluster: report more errors to workers
Some errors for listening and binding to a socket were not properly
delivered to workers.

fix #6767
2013-12-31 09:47:33 -08:00
Fedor Indutny
cb5da7b443 deps: update gyp to 828ce09 2013-12-30 15:52:47 -08:00
Dav Glass
34b9280da4 doc: Fix missing backtick in debugger doc 2013-12-30 11:44:13 -08:00
Lev Gimelfarb
d2d56d04f8 build: add settings for VS 2013 to vcbuild.bat
Search for VS2013 compiler 1st, before falling back to older ones. This
allows compiling using the latest VS2013.
2013-12-28 16:58:01 +04:00
isaacs
7f82faee30 npm: Upgrade to v1.3.22 2013-12-25 19:15:23 -08:00
T.C. Hollingsworth
55b0bd639d build: install common.gypi along with headers
node-gyp requires this file
2013-12-20 11:03:06 -08:00
Timothy J Fontaine
f84c7a2776 blog: Post for v0.10.24 2013-12-19 09:05:14 -08:00
Timothy J Fontaine
00e28ee6a8 Now working on 0.10.25 2013-12-19 09:05:14 -08:00
Timothy J Fontaine
696ae46fd7 Merge branch 'v0.10.24-release' into v0.10 2013-12-19 09:03:45 -08:00
Timothy J Fontaine
b7fd6bc899 2013.12.18, Version 0.10.24 (Stable)
* uv: Upgrade to v0.10.21

* npm: upgrade to 1.3.21

* v8: backport fix for CVE-2013-{6639|6640}

* build: unix install node and dep library headers (Timothy J Fontaine)

* cluster, v8: fix --logfile=%p.log (Ben Noordhuis)

* module: only cache package main (Wyatt Preul)
2013-12-18 15:49:45 -08:00
Timothy J Fontaine
9371be0aa1 uv: Upgrade to v0.10.21 2013-12-18 15:42:46 -08:00
Ben Noordhuis
2eaef9f6da cluster, v8: fix --logfile=%p.log
The %p is replaced with the current PID.  This used to work in node.js
v0.9.7 but it seems to have been lost somewhere along the way.

This commit makes the fix from 6b713b52 ("cluster: make --prof work for
workers") work again.  Without it, all log data ends up in a single
file and is unusable because the addresses are all wrong.
2013-12-18 15:36:12 -08:00
Timothy J Fontaine
32478acf94 build: unix install node and dep library headers
Restores functionality from v0.8 where module authors may not be
relying on gyp for building their modules.
2013-12-18 15:06:20 -08:00
isaacs
2a741f2d12 npm: upgrade to 1.3.21 2013-12-17 14:33:52 -08:00
isaacs
e10c223eb6 npm: upgrade to 1.3.20
The 1.3.19 release had a critical bug: any packages published with it
could not be installed, because the shasum would be incorrect.

Thankfully, 1.3.19 was published using 1.3.19, so could not be installed
by any users!  However, if it goes out as part of a Node.js release,
then obviously that would be a problem.
2013-12-17 09:04:30 -08:00
isaacs
97738994e0 npm: Upgrade to 1.3.19 2013-12-16 23:09:16 -08:00
jkummerow@chromium.org
39e2426b20 v8: backport fix for CVE-2013-{6639|6640}
Quoting CVE-2013-6639:

    The DehoistArrayIndex function in hydrogen-dehoist.cc in Google V8
    before 3.22.24.7, as used in Google Chrome before 31.0.1650.63,
    allows remote attackers to cause a denial of service (out-of-bounds
    write) or possibly have unspecified other impact via JavaScript code
    that sets the value of an array element with a crafted index.

Quoting CVE-2013-6640:

    The DehoistArrayIndex function in hydrogen-dehoist.cc in Google V8
    before 3.22.24.7, as used in Google Chrome before 31.0.1650.63,
    allows remote attackers to cause a denial of service (out-of-bounds
    read) via JavaScript code that sets a variable to the value of an
    array element with a crafted index.

Like 6b92a7, this is unlikely to affect node.js because it only runs
local, trusted code.  However, if there exists some module somewhere
that populates an array index with remotely provided data this could
very well be used to crash a remote server running node.  Defense in
depth and all.

This is a backport of upstream commit r17801. Original commit log:

    Limit size of dehoistable array indices

    LOG=Y
    BUG=chromium:319835,chromium:319860
    R=dslomov@chromium.org

    Review URL: https://codereview.chromium.org/74113002
2013-12-14 02:55:29 +04:00
Wyatt Preul
1d5e797445 module: only cache package main 2013-12-12 09:38:47 -08:00
Timothy J Fontaine
7dca8d714f blog: Post for v0.10.23 2013-12-11 22:11:19 -08:00
Timothy J Fontaine
bb1575b4c4 Now working on 0.10.24 2013-12-11 22:11:19 -08:00
Timothy J Fontaine
593672c33d Merge branch 'v0.10.23-release' into v0.10 2013-12-11 22:11:06 -08:00
Timothy J Fontaine
0462bc2356 2013.12.12, Version 0.10.23 (Stable)
* uv: Upgrade to v0.10.20 (Timothy J Fontaine)

* npm: Upgrade to 1.3.17 (isaacs)

* gyp: update to 78b26f7 (Timothy J Fontaine)

* build: include postmortem symbols on linux (Timothy J Fontaine)

* crypto: Make Decipher._flush() emit errors. (Kai Groner)

* dgram: fix abort when getting `fd` of closed dgram (Fedor Indutny)

* events: do not accept NaN in setMaxListeners (Fedor Indutny)

* events: avoid calling `once` functions twice (Tim Wood)

* events: fix TypeError in removeAllListeners (Jeremy Martin)

* fs: report correct path when EEXIST (Fedor Indutny)

* process: enforce allowed signals for kill (Sam Roberts)

* tls: emit 'end' on .receivedShutdown (Fedor Indutny)

* tls: fix potential data corruption (Fedor Indutny)

* tls: handle `ssl.start()` errors appropriately (Fedor Indutny)

* tls: reset NPN callbacks after SNI (Fedor Indutny)
2013-12-11 21:20:06 -08:00
Nicolas Kaiser
4bc2ec90d7 doc: fix typos in node.1 2013-12-11 20:41:36 -08:00
Mathias Bynens
f89a7185b7 doc: mention binary as deafult for Hash strings 2013-12-11 20:39:22 -08:00
Gabriel Farrell
04d52270b6 doc: "finish" event is on the writable stream 2013-12-11 20:29:17 -08:00
Timothy J Fontaine
910bc3c02d uv: Upgrade v0.10.20 2013-12-11 20:24:36 -08:00
Timothy J Fontaine
4ec189b250 gyp: update to 78b26f7 2013-12-11 20:06:11 -08:00
isaacs
a22de4f7ee npm: Upgrade to 1.3.17 2013-12-11 10:20:26 -08:00
Fedor Indutny
f16edd2632 fs: report correct path when EEXIST
When `symlink`, `link` or `rename` report EEXIST, ENOTEMPTY or EPERM -
the destination file name should be included in the error message,
instead of source file name.

fix #6510
2013-12-10 23:17:00 +04:00
Fedor Indutny
4a2792cd2f tls: emit 'end' on .receivedShutdown
NOTE: Also removed `.receivedShutdown` method of `Connection` it wasn't
documented anywhere, and was rewritten with `true` after receiving
`close_notify`.

fix #6638
2013-12-10 22:56:01 +04:00
Timothy J Fontaine
92bbd60a3f build: only whole archive on static v8 builds
Closes #6629
2013-12-10 10:11:28 -08:00
Timothy J Fontaine
2905884b63 build: pass --no-parallel by default to gyp
gyp by default now tries to process gyp files in parallel by using
python's multiprocessing module, but it has problems on oddball
platforms. We don't have many files or complex dependency chains that
would benefit from parallel processing so disable by deafult

fixes #6640
2013-12-06 21:07:46 -08:00
Timothy J Fontaine
b5e161989c build: ./configure pass positional args to gyp
use `--` to specify the arguments you want to pass directly to gyp.

for example: `./configure -- --no-parallel -Dsome_define=foo`

fixes #6370
2013-12-06 21:07:00 -08:00
Yazhong Liu
5cfee927cd doc: mention execArgv in setupMaster 2013-12-06 10:45:40 -08:00
Fedor Indutny
796834bf18 doc: document 'error' event for stream.Writable
fix #5255
2013-12-06 10:26:49 -08:00
Kai Groner
98be8df571 crypto: Make Decipher._flush() emit errors.
When Decipher processes a stream using an incorrect key, the
DecipherFinal() method throws an unhandled exception at the end of the
stream.
2013-12-04 19:52:15 +04:00
isaacs
b371d4ae8f blog: bnoordhuis departure 2013-12-04 01:00:07 -08:00
Fedor Indutny
60f777d343 tls: fix pool usage race
When calling `encOut` in loop, `maybeInitFinished()` may invoke
`clearOut`'s loop, leading to the writing of interleaved data
(encrypted and cleartext) into the one shared pool.

Move `maybeInitFinished()` out of the loop and add assertion for
future.
2013-12-02 15:18:04 -08:00
Yazhong Liu
bd7fa92de4 doc: list execArgv option for child_process.fork() 2013-12-02 13:41:30 -08:00
Gabriel Falkenberg
94c4ba9dd3 doc: change constant to consistent 2013-12-02 13:31:23 -08:00
Sam Roberts
8aac118b69 process: document kill(0), disallow kill(O_RDWR)
The null signal test existed, but only tested the case where the target
process existed, not when it did not exist.

Also clarified that SIGUSR1 is reserved by Node.js only for receiveing,
its not at all reserved when sending a signal with kill().

kill(pid, 'O_RDWR'), or any other node constant, "worked". I fixed this
by also checking for 'SIG'. The same as done in the isSignal() function.
Now the signal names supported by process.kill() are the same as those
supported by process.on().
2013-12-02 10:41:37 -08:00
Fedor Indutny
9b8fcff435 tls: reset NPN callbacks after SNI
SNI callback selects a new SSL_CTX for the connection, which doesn't
have NPN callbacks set up.
2013-12-02 14:48:14 +04:00
Timothy J Fontaine
6877e64fa8 build: include postmortem symbols on linux
Previously we were building the symbols, but the linker was garbage
collecting the symbols because they weren't used. Inform the linker
that we want to keep all symbols from v8 around.
2013-12-01 18:57:43 -08:00
Yazhong Liu
fcfaa392ae doc: net: fix typo in example code 2013-11-30 14:05:45 +01:00
Michael Ridgway
a32b8787a4 doc: http: document ServerResponse 'finish' event 2013-11-28 22:35:25 +01:00
Nikolai Vavilov
207a3e10f8 doc: http: properly document callback argument 2013-11-28 22:31:11 +01:00
Ben Noordhuis
658aeb2ca0 stream_wrap: don't call Number::New()
Replace call to Number::New() with a call to Integer::NewFromUnsigned().

Profiling a Real World(TM) application with perf(1) suggests that the
conversion of its argument from integer to double is disproportionally
costly: over 60% of CPU cycles accountable to WriteStringImpl() are
attributable to the conversion.

After changing it to Integer::NewFromUnsigned(), WriteStringImpl()
has dropped from the 'most costly functions' top ten altogether.
2013-11-27 03:53:45 +01:00
isaacs
90655a998e blog: npm outage postmortem 2013-11-26 07:27:59 -08:00
Linus Unnebäck
953d7184ec doc: clarify child_process error behaviour
Clarify that an 'error' event may or may not be followed by an 'exit'
event and that it's not safe to make assumptions either way.
2013-11-23 15:46:50 +01:00
Jeremy Martin
71aabedad4 events: fix TypeError in removeAllListeners
Check that `listeners` is actually an array before trying to manipulate it
because it won't be if no regular event listeners have been registered yet
but there are 'removeListener' event listeners.
2013-11-22 17:42:34 +01:00
Timothy J Fontaine
a34bbaf31b blog: Post for v0.11.9 2013-11-20 16:45:27 -08:00
isaacs
c1452f4c6f npm: Upgrade to v1.3.15 2013-11-20 11:08:52 -08:00
Fedor Indutny
88dc1fcb62 crypto: randomBytes is non-blocking
Add NOTE section in documentation, mentioning that `randomBytes` won't
block when entropy sources are drained.

fix #6372
2013-11-19 13:15:50 +04:00
Fedor Indutny
fce0eb416b events: do not accept NaN in setMaxListeners 2013-11-19 13:14:01 +04:00
Fedor Indutny
5885f464f0 net: fix new net.Socket documentation
`Socket` no longer accepts `type` option, and also accepts `readable`,
`writable` options.

fix #6541
2013-11-19 12:50:16 +04:00
Fedor Indutny
5ce50ece16 dgram: fix abort when getting fd of closed dgram
v8's `messages.js` file's `CallSiteGetMethodName` is running through all
object properties and getter to figure out method name of function that
appears in stack trace. This run-through will also read `fd` property of
`UDPWrap` instance's javascript object, making `UNWRAP()` fail.

As a simple alternative to the test case above, one could just keep
reference to the dgram handle and try accessing `handle.fd` after it has
been fully closed.

fix #6536
2013-11-19 12:44:06 +04:00
Ben Noordhuis
1394d5856b doc: add nodejs.vn to community page
Node.js.  It's not just for SF hipsters anymore.
2013-11-15 16:29:30 +01:00
Ben Noordhuis
a763db8fc0 doc: sort community page links alphabetically
This commit introduces some long lines but it's HTML so it's okay.
2013-11-15 16:24:47 +01:00
Fedor Indutny
65b127572f tls: handle ssl.start() errors 2013-11-13 17:09:25 +04:00
Tim Wood
c9d93f3431 events: don't call once twice
Emitting an event within a `EventEmitter#once` callback of the same
event name will cause subsequent `EventEmitter#once` listeners of the
same name to be called multiple times.

    var emitter = new EventEmitter();

    emitter.once('e', function() {
      emitter.emit('e');
      console.log(1);
    });

    emitter.once('e', function() {
      console.log(2);
    });

    emitter.emit('e');

    // Output
    // 2
    // 1
    // 2

Fix the issue, by calling the listener method only if it was not
already called.
2013-11-13 03:21:04 +04:00
Timothy J Fontaine
ac9cf00252 blog: Post for v0.10.22 2013-11-12 12:53:45 -08:00
Timothy J Fontaine
9142dc676f Now working on 0.10.23 2013-11-12 12:53:45 -08:00
Timothy J Fontaine
36f2bf22b5 Merge branch 'v0.10.22-release' into v0.10 2013-11-12 12:53:28 -08:00
Timothy J Fontaine
cbff8f091c 2013.11.12, Version 0.10.22 (Stable)
* npm: Upgrade to 1.3.14

* uv: Upgrade to v0.10.19

* child_process: don't assert on stale file descriptor events (Fedor Indutny)

* darwin: Fix "Not Responding" in Mavericks activity monitor (Fedor Indutny)

* debugger: Fix bug in sb() with unnamed script (Maxim Bogushevich)

* repl: do not insert duplicates into completions (Maciej Małecki)

* src: Fix memory leak on closed handles (Timothy J Fontaine)

* tls: prevent stalls by using read(0) (Fedor Indutny)

* v8: use correct timezone information on Solaris (Maciej Małecki)
2013-11-12 12:22:12 -08:00
Timothy J Fontaine
16934d9210 src: add HandleScope in HandleWrap::OnClose
Fixes a 4 byte leak on handles closing. AKA The Walmart leak.

MakeCallback doesn't have a HandleScope. That means the callers scope
will retain ownership of created handles from MakeCallback and related.
There is by default a wrapping HandleScope before uv_run, if the caller
doesn't have a HandleScope on the stack the global will take ownership
which won't be reaped until the uv loop exits.

If a uv callback is fired, and there is no enclosing HandleScope in the
cb, you will appear to leak 4-bytes for every invocation. Take heed.

cc @hueniverse
2013-11-12 11:23:19 -08:00
Timothy J Fontaine
ac799ba0af uv: Upgrade to v0.10.19 2013-11-12 10:57:57 -08:00
yangguo@chromium.org
007393a09d v8: use correct timezone information on Solaris
`timezone` variable contains the difference, in seconds, between UTC and
local standard time (see `man 3 localtime` on Solaris).

Call to `tzset` is required to apply contents of `TZ` variable to
`timezone` variable.

BUG=v8:2064

Review URL: https://chromiumcodereview.appspot.com/10967066
Patch from Maciej Małecki <me@mmalecki.com>.

This is a back-port of upstream commit r12802 and a forward port of
commit 9fa953d from the v0.8 branch.  V8 3.22 in the master branch
contains the patch so no further forward-porting is necessary.
2013-11-12 15:15:32 +01:00
Maciej Małecki
568072ceae repl: do not insert duplicates into completions
Fix invalid `hasOwnProperty` function usage.

For example, before in the REPL:

```
> Ar<Tab>
Array

Array        ArrayBuffer
```

Now:

```
> Ar<Tab>
Array

ArrayBuffer
```

Fixes #6255.
Closes #6498.
2013-11-11 15:45:09 -08:00
Timothy J Fontaine
2010985354 gyp: update to bebdcea 2013-11-10 15:15:34 -08:00
Ben Noordhuis
3dcc9b93e1 v8: unbreak make native build
The security fix from commit 6b92a713 also back-ported the test case.
Said test case relies on API that is only available in newer versions
of V8 and, as a result, broke the `make native` and `make <arch.mode>`
builds.  This commit reverts that part of the back-port.  Fixes the
following build error:

  ../test/cctest/test-api.cc: In function ‘void TestRegress260106()’:
  ../test/cctest/test-api.cc:17712:34: error: ‘class v8::Context’ has
  no member named ‘GetIsolate’
2013-11-09 22:27:22 +01:00
Fedor Indutny
ac2263b77f tls: prevent stalls by using read(0)
Do not `.push()` the same data as just passed to `.ondata()`, it
may be read by 'data' event listeners.

fix #6277
2013-11-09 02:07:36 +04:00
isaacs
8f221bc43d npm: Upgrade to 1.3.14 2013-11-08 13:41:24 -08:00
Fedor Indutny
0be5a94c56 doc: encoding is ignored if input is a Buffer
NOTE: it wasn't in 0.8

fixes #6386
2013-11-07 11:02:19 -08:00
isaacs
849c92fec7 doc: Correct and add several items
Several names/urls were out of date, and some really
awesome stuff was missing.
2013-10-31 13:36:00 -07:00
Sam Roberts
155df9ca76 doc: document node signal handling
Partly lifted from uv.h, partly from observation of node.cc.
2013-10-31 21:19:04 +01:00
Timothy J Fontaine
9f7f9d1240 blog: Post for v0.11.8 2013-10-30 09:09:04 -07:00
Ben Noordhuis
0c5981b226 doc: dgram: reword dgram.Socket#send() docs
Make it clear that the address argument is not really optional and fix
some Engrish and long lines while we're here.

Fixes #6433.
2013-10-29 10:32:15 +01:00
isaacs
4b5e6a38df npm@1.3.13 2013-10-28 14:10:47 -07:00
Phillip Alexander
977c54adb5 doc: fs: clarify fs.symlink Windows specific args 2013-10-27 21:02:19 +01:00
Ryan Graham
5ac6f4de13 doc: improve module documentation
Expands on when to use module.exports vs. exports. This is a recurring
question on mailing list and continues to confuse new devs.
2013-10-27 11:47:11 +01:00
Sam Roberts
a60f67192f doc: fix missing backtick in 2e16037 2013-10-25 23:40:46 +02:00
Brian White
21265e20d3 doc: streams: document default objectMode setting 2013-10-25 10:33:22 -07:00
Maxim Bogushevich
9c6e06bed3 debugger: Fix bug in sb() with unnamed script
setBreakpoint() cause error when unnamed script is loaded
2013-10-25 13:17:35 +04:00
isaacs
f6f176e108 npm@1.3.12 2013-10-24 09:22:13 -07:00
Ben Noordhuis
808a968409 build: fix test-gc weakref build rule
Make the build rule depend on the build artifact (weakref.node) itself
rather than the directory it's built in.  Depending on the directory
means that a build failure won't trigger a rebuild on the next
invocation because the directory's timestamp has been updated.

This is a back-port of commit 1189571 from the master branch that
hopefully fixes the following CI error:

    executing:  make test/gc/node_modules/weak/build/
    make: *** No rule to make target `test/gc/node_modules/weak/build/'.
    Command exited with non-zero: make test/gc/node_modules/weak/build/
    Build step 'Execute NodeJS script' marked build as failure
2013-10-24 16:31:31 +02:00
Zarko Stankovic
eb291de00e doc: add nodejs.rs to the community page 2013-10-24 16:17:56 +02:00
Ben Noordhuis
91a0e52c03 src: IsInt64() should return bool, not int 2013-10-23 13:26:25 +02:00
isaacs
97813ae58d blog: HTTP server DoS vulnerability details
CVE-2013-4450
2013-10-22 10:56:03 -07:00
Timothy J Fontaine
028e524bce blog: Post for v0.10.21 2013-10-18 15:46:02 -07:00
Timothy J Fontaine
2649ae8395 blog: Post for v0.8.26 2013-10-18 15:43:55 -07:00
Timothy J Fontaine
85b2aaea3d Now working on 0.10.22 2013-10-18 15:40:32 -07:00
Timothy J Fontaine
7940833773 Merge branch 'v0.10.21-release' into v0.10 2013-10-18 15:39:56 -07:00
Timothy J Fontaine
e2da042844 2013.10.18, Version 0.10.21 (Stable)
* uv: Upgrade to v0.10.18

* crypto: clear errors from verify failure (Timothy J Fontaine)

* dtrace: interpret two byte strings (Dave Pacheco)

* fs: fix fs.truncate() file content zeroing bug (Ben Noordhuis)

* http: provide backpressure for pipeline flood (isaacs)

* tls: fix premature connection termination (Ben Noordhuis)
2013-10-18 14:26:27 -07:00
Timothy J Fontaine
5e41c022af crypto: clear errors from verify failure
OpenSSL will push errors onto the stack when a verify fails, which can
disrupt TLS and other routines if we don't clear the error stack

Fixes #6304
2013-10-18 14:14:21 -07:00
Timothy J Fontaine
8fc48bcf4c uv: Upgrade to v0.10.18 2013-10-18 13:52:15 -07:00
isaacs
b97c28f59e http: provide backpressure for pipeline flood
If a client sends a lot more pipelined requests than we can handle, then
we need to provide backpressure so that the client knows to back off.
Do this by pausing both the stream and the parser itself when the
responses are not being read by the downstream client.

Backport of 085dd30
2013-10-16 17:12:34 -07:00
Timothy J Fontaine
f051b8919f http_parser: expose pause/resume method for parser 2013-10-16 17:12:34 -07:00
Sam Roberts
2e16037201 doc: cluster documentation cleanup and corrections
- fixed some incomprehensible wording ("event assigned to..."?)
- removed undocumented and unnecessary process properties from example
- corrected the docs on the default for the exec setting
- described when workers are removed from cluster.workers
- described addressType, which was documented as existing, but not what
  values it might have
- spell out more clearly the limitations of setupMaster
- describe disconnect in sufficient detail that why a child does or does
  not exit can be understood
- clarify which cluster functions and events are available on process or
  just on the worker, as well as which are not available in children,
- don't describe events as the same, when they have receive different
  arguments
- fix misleading disconnect example: since disconnect already calls
  close on all servers, doing it again in the example is a no-op, not
  the "force close" it was claimed to be
- document the error event, not catching it will kill your node
- describe suicide better, it is important, and a bit unintuitive
  (process.exit() is not suicide?)
- use worker consistently throughout, instead of child.
2013-10-16 15:10:13 -07:00
Sam Roberts
ed186c971c doc: child_process corrections and cleanups
- Make explicit that .disconnected is set before the disconnect event,
  and it is not allowed to send messages after calling .disconnect(),
  even while waiting for a delayed disconect event.
- Remove obsolete claim that explicit exit is required
- Describe silent: in the options for fork()
- Describe .connected as the property it is, not just as an aside in
  the disconnect() method
2013-10-16 15:10:13 -07:00
Ben Noordhuis
5bc5210b92 doc: http: reword IncomingMessage 'close' event
The bit that says "before response.end() was called or able to flush"
doesn't apply to incoming streams.

Fixes #6359.
2013-10-16 12:56:13 +02:00
Ben Noordhuis
5ef03bc3ee doc: http: add cross-links for easier clicking
Make it a little easier to navigate the http module documentation by
turning class names and methods into links to the appropriate section.
2013-10-16 12:56:03 +02:00
Ben Noordhuis
9a3a0ccc50 doc: expand os.loadavg() section
Add a short explanation of what the load average is and why it's
unavailable on Windows.

Also sneak in a fix for a typo that I introduced in commit 56c5806.
2013-10-15 10:17:23 +02:00
Ben Noordhuis
56c5806da3 doc: document os.loadavg() behavior on windows
The load average is a very UNIX-y concept.  That's why os.loadavg()
always returns zeros on Windows.  Mention that in the documentation.
2013-10-14 12:14:51 +02:00
Dave Pacheco
720675e7db test: use proper findjsobjects output format
Closes #6329
2013-10-10 15:45:25 -07:00
Ben Noordhuis
ff1efdd6ee doc: net: remove bad net.Server description
net.Server is not an instance of net.Socket so don't say it is.
2013-10-10 14:34:16 +02:00
Ben Noordhuis
51cdce8322 doc: addon: fix object instantiation examples
* Extend examples to show how to handle non-constructor invocation in
  constructor callback functions.

* Fix up examples to initialize member variables at object construction.

* Fix up a few naming inconsistencies.

Fixes #5701.
2013-10-10 14:09:39 +02:00
isaacs
9c65387673 blog: Remove wp-to-markdown script 2013-10-09 14:00:32 -07:00
Ben Noordhuis
9777890f5d tls: fix premature connection termination
Destroying the TLS session implies destroying the underlying socket but
before this commit, that was done with net.Socket#destroy() rather than
net.Socket#destroySoon().  The former closes the connection right away,
even when there is still data to write.  In other words, sometimes the
final TLS record got truncated.

Fixes #6107.
2013-10-09 19:25:47 +02:00
Dave Pacheco
98c57c7c07 dtrace: backport two byte string fix
This is a partial backport of 5921158

Re #6309
Closes #6319
2013-10-09 08:49:39 -07:00
Ben Noordhuis
b011811a9f fs: fix fs.truncate() file content zeroing bug
fs.truncate() and its synchronous sibling are implemented in terms of
open() + ftruncate().  Unfortunately, it opened the target file with
mode 'w' a.k.a. 'write-only and create or truncate at open'.

The subsequent call to ftruncate() then moved the end-of-file pointer
from zero to the requested offset with the net result of a file that's
neatly truncated at the right offset and filled with zero bytes only.

This bug was introduced in commit 168a5557 but in fairness, before that
commit fs.truncate() worked like fs.ftruncate() so it seems we've never
had a working fs.truncate() until now.

Fixes #6233.
2013-10-08 11:35:12 +02:00
Ben Noordhuis
d97ea06d88 doc: add warning to fs.exists() documentation
Warn against the open-if-exists anti-pattern, it's susceptible to
race conditions.
2013-10-05 14:54:57 +02:00
Ben Noordhuis
b7f36e187d doc: link to pre-built binaries, add install note
lLnk to http://nodejs.org/download/ and add a short primer on how to
extract the tarballs.

Fixes #6292.
2013-10-01 08:37:32 +02:00
Timothy J Fontaine
a63079f34c blog: Post for v0.10.20 2013-09-30 15:06:14 -07:00
Timothy J Fontaine
d537992d57 Now working on 0.10.21 2013-09-30 15:06:14 -07:00
Timothy J Fontaine
451497c81e Merge branch 'v0.10.20-release' into v0.10 2013-09-30 15:06:02 -07:00
Timothy J Fontaine
d7234c8d50 2013.09.30, Version 0.10.20 (Stable)
* tls: fix sporadic hang and partial reads (Fedor Indutny)
  - fixes "npm ERR! cb() never called!"
2013-09-30 13:52:48 -07:00
Ben Noordhuis
994ce4c99f src: turn uv_pipe_open() failures into exceptions
uv_pipe_open() is unlikely to fail but when it does, the failure should
not be quietly ignored.  Raise the error as an exception.

See joyent/libuv#941.
2013-09-28 10:35:57 +02:00
Fedor Indutny
671b5be6e9 tls: fix sporadic hang and partial reads
Do not decrement size in read loop, its used later, when comparing to
`bytesRead`.

fix #6270

NOTE: Original patch contributed by @roadrunner2
2013-09-27 23:47:13 +04:00
Timothy J Fontaine
cfa03ad2e3 blog: add missing shasums for v0.10.19 release 2013-09-24 15:16:44 -07:00
Timothy J Fontaine
9135c7fea8 blog: Post for v0.10.19 2013-09-24 15:10:22 -07:00
Timothy J Fontaine
093efafce3 Now working on 0.10.20 2013-09-24 15:10:22 -07:00
Timothy J Fontaine
cb150406c8 Merge branch 'v0.10.19-release' into v0.10 2013-09-24 15:10:10 -07:00
Timothy J Fontaine
6b5e6a5a3e 2013.09.24, Version 0.10.19 (Stable)
* uv: Upgrade to v0.10.17

* npm: upgrade to 1.3.11

* readline: handle input starting with control chars (Eric Schrock)

* configure: add mips-float-abi (soft, hard) option (Andrei Sedoi)

* stream: objectMode transforms allow falsey values (isaacs)

* tls: prevent duplicate values returned from read (Nathan Rajlich)

* tls: NPN protocols are now local to connections (Fedor Indutny)
2013-09-24 14:10:33 -07:00
Timothy J Fontaine
55546f55d4 uv: Upgrade to v0.10.17 2013-09-24 13:46:19 -07:00
Eric Schrock
35ae696822 readline: handle input starting with control chars
Handle control characters only when there is a single byte in the
stream, otherwise fall through to the standard multibyte handling.
2013-09-23 14:22:37 -07:00
Ben Noordhuis
7c554a5cd0 doc: document reserved status of SIGUSR1
Fixes #1212.
2013-09-19 12:31:52 +02:00
Nathan Rajlich
5bda2bed37 doc: fix typos in the tls NPNProtocols option 2013-09-16 13:57:34 -07:00
Nathan Rajlich
afabdf0e15 doc: specify the format of the ca tls option 2013-09-16 13:57:00 -07:00
Nathan Rajlich
7196742852 tls: don't push() incoming data when ondata is set
Otherwise the data ends up "on the wire" twice, and
switching between consuming the stream using `ondata`
vs. `read()` would yield duplicate data, which was bad.
2013-09-13 10:08:35 -07:00
Ben Noordhuis
9fad8e5dc4 doc: fix blog link in blog posts and README
Apparently Joyent decommissioned joyeur.com but at least they saved the
contents of the blog.  Update the links in the README and the nodejs.org
blog posts.

Hat tip to Eugen Pirogoff (@eugenpirogoff) for pointing it out.

Fixes #6224.
2013-09-13 14:55:08 +02:00
Fedor Indutny
1c3863abfd tls: fix setting NPN protocols
The NPN protocols was set on `require('tls')` or `global` object instead
of being a local property. This fact lead to strange persistence of NPN
protocols, and sometimes incorrect protocol selection (when no NPN
protocols were passed in client options).

fix #6168
2013-09-09 18:18:05 +04:00
Andrei Sedoi
3546825b14 configure: add mips-float-abi (soft, hard) option 2013-09-07 22:25:50 +02:00
isaacs
ebeae2df51 npm: upgrade to 1.3.11 2013-09-07 14:31:04 -05:00
isaacs
1be09dfc25 npm: upgrade to v1.3.10 2013-09-05 17:13:50 -07:00
isaacs
1da7bcc22c stream: objectMode transforms allow falsey values
Closes #6183
2013-09-05 13:19:23 -07:00
Bert Belder
6301613ff5 uv: upgrade to v0.10.16 2013-09-05 16:50:47 +02:00
Timothy J Fontaine
8b05206665 blog: Post for v0.11.7 2013-09-04 15:27:06 -07:00
Timothy J Fontaine
9c19c1e19c blog: Post for v0.10.18 2013-09-04 11:25:19 -07:00
Timothy J Fontaine
65ed79a6dc Now working on 0.10.19 2013-09-04 11:25:19 -07:00
Timothy J Fontaine
86d881f888 Merge branch 'v0.10.18-release' into v0.10 2013-09-04 11:25:04 -07:00
Timothy J Fontaine
67a1f0c52e 2013.09.04, Version 0.10.18 (Stable)
* uv: Upgrade to v0.10.15

* stream: Don't crash on unset _events property (isaacs)

* stream: Pass 'buffer' encoding with decoded writable chunks (isaacs)
2013-09-04 10:51:53 -07:00
Kyle Robinson Young
95794641d2 doc: fix writable.write link 2013-09-04 10:25:51 +02:00
isaacs
00a1d3633c benchmark: Fix execArgv handling
Bug in 01f3b46 causes the same benchmark to be run repeatedly.

Not so useful for the compare scripts.
2013-08-31 17:58:17 -07:00
isaacs
01f3b468a9 benchmark: Support passing v8 flags to benchmarks
The better to test --use-strict effects on performance.

(Spoiler: it has no measurable effect on performance.)
2013-08-31 10:36:44 -07:00
isaacs
fbb963b5d5 stream: check _events before _events.error
This fixes the regression introduced by 5458079, which breaks the
net/net-pipe benchmark script.

Closes #6145
2013-08-28 09:35:39 -07:00
isaacs
02eb9c834a doc: Adjust util stability index to 'API Frozen'
Closes #6087
2013-08-27 19:52:49 -07:00
isaacs
a3da3e7312 stream: Pass 'buffer' encoding to decoded writables
Since the encoding is no longer relevant once it is decoded to a Buffer,
it is confusing and incorrect to pass the encoding as 'utf8' or whatever
in those cases.

Closes #6119
2013-08-27 14:53:06 -07:00
Bert Belder
5508236c49 uv: update to v0.10.15 2013-08-23 19:02:14 +02:00
Timothy J Fontaine
3f1dba18b2 tools: script release steps after jenkins build 2013-08-21 16:59:15 -07:00
Timothy J Fontaine
92e4375173 tools: script to report [un]stable build 2013-08-21 16:55:27 -07:00
Timothy J Fontaine
1d27987dab blog: Post for v0.10.17 2013-08-21 16:38:30 -07:00
Timothy J Fontaine
3c66b15789 Now working on 0.10.18 2013-08-21 16:37:43 -07:00
Timothy J Fontaine
fcf180327b Merge branch 'v0.10.17-release' into v0.10 2013-08-21 16:37:31 -07:00
Timothy J Fontaine
469a4a5091 2013.08.21, Version 0.10.17 (Stable)
* uv: Upgrade v0.10.14

* http_parser: Do not accept PUN/GEM methods as PUT/GET (Chris Dickinson)

* tls: fix assertion when ssl is destroyed at read (Fedor Indutny)

* stream: Throw on 'error' if listeners removed (isaacs)

* dgram: fix assertion on bad send() arguments (Ben Noordhuis)

* readline: pause stdin before turning off terminal raw mode (Daniel Chatfield)
2013-08-21 15:00:56 -07:00
Timothy J Fontaine
e445fbda1f uv: Upgrade v0.10.14 2013-08-21 14:44:20 -07:00
Timothy J Fontaine
985695e4d6 blog: v0.11.6 2013-08-21 14:26:32 -07:00
isaacs
8a9434c4ef doc: Mention python dep in downloads page
Closes #3604
2013-08-21 11:11:02 -07:00
Ben Noordhuis
8d42c6344b deps: upgrade http_parser to 303c4e4
Upgrade to joyent/http-parser@303c4e4. Changes:

  * Do not accept PUN/GEM methods as PUT/GET.
  * Further request method check strengthening.
2013-08-21 03:40:43 +02:00
Fedor Indutny
af6a2339c5 tls: fix assertion when ssl is destroyed at read
`maybeInitFinished()` can emit the 'secure' event which
in turn destroys the connection in case of authentication
failure and sets `this.pair.ssl` to `null`.

If such condition appeared after non-empty read - loop will continue
and `clearOut` will be called on `null` object instead of
`crypto::Connection` instance. Resulting in the following assertion:

    ERROR: Error: Hostname/IP doesn't match certificate's altnames
    Assertion failed: handle->InternalFieldCount() > 0

fix #5756
2013-08-21 16:15:08 +04:00
Gil Pedersen
e04c8a8ee4 fs: use correct self reference for autoClose test 2013-08-20 17:10:18 +02:00
isaacs
26a8c0c6b8 doc: Minor typos in dgram doc
a/an usage.  Thanks @KenanSulayman
2013-08-19 17:55:58 -07:00
Duan Yao
9456cf8fe2 doc: Add callback parameter to dgram socket.bind()
Also, describe more details of bind().
2013-08-19 16:33:38 -07:00
ChrisWren
2385fbbc3a doc: fixed syntax error in stream.Transform 2013-08-19 16:10:05 -07:00
Edward Hutchins
31a27ca72d Added documentation for process.execArgv 2013-08-19 15:53:09 -07:00
Eivind Uggedal
732f8b9641 doc: add missing word in Transform stream intro 2013-08-19 15:45:35 -07:00
isaacs
545807918e stream: Throw on 'error' if listeners removed
In this situation:

    writable.on('error', handler);
    readable.pipe(writable);
    writable.removeListener('error', handler);
    writable.emit('error', new Error('boom'));

there is actually no error handler, but it doesn't throw, because of the
fix for stream.once('error', handler), in 23d92ec.

Note that simply reverting that change is not valid either, because
otherwise this will emit twice, being handled the first time, and then
throwing the second:

    writable.once('error', handler);
    readable.pipe(writable);
    writable.emit('error', new Error('boom'));

Fix this with a horrible hack to make the stream pipe onerror handler
added before any other userland handlers, so that our handler is not
affected by adding or removing any userland handlers.

Closes #6007.
2013-08-19 09:26:49 -07:00
Ben Noordhuis
0c2960ef4a dgram: fix assertion on bad send() arguments
Add range checks for the offset, length and port arguments to
dgram.Socket#send().  Fixes the following assertion:

    node: ../../src/udp_wrap.cc:264: static v8::Handle<v8::Value>
    node::UDPWrap::DoSend(const v8::Arguments&, int): Assertion
    `offset < Buffer::Length(buffer_obj)' failed.

And:

    node: ../../src/udp_wrap.cc:265: static v8::Handle<v8::Value>
    node::UDPWrap::DoSend(const v8::Arguments&, int): Assertion
    `length <= Buffer::Length(buffer_obj) - offset' failed.

Interestingly enough, a negative port number was accepted until now but
silently ignored.  (In other words, it would send the datagram to a
random port.)

This commit exposed a bug in the simple/test-dgram-close test which
has also been fixed.

This is a back-port of commit 41ec6d0 from the master branch.

Fixes #6025.
2013-08-17 17:11:02 +02:00
Daniel Chatfield
5453619eb2 readline: pause stdin before turning off terminal raw mode
On windows, libuv will immediately make a `ReadConsole` call (in the
thread pool) when a 'flowing' `uv_tty_t` handle is switched to
line-buffered mode. That causes an immediate issue for some users,
since libuv can't cancel the `ReadConsole` operation on Windows 8 /
Server 2012 and up if the program switches back to raw mode later.

But even if this will be fixed in libuv at some point, it's better to
avoid the overhead of starting work in the thread pool and immediately
cancelling it afther that.

See also f34f1e3, where the same change is made for the opposite
flow, e.g. move `resume()` after `_setRawMode(true)`.

Fixes #5927

This is a backport of dfb0461 (see #5930) to the v0.10 branch.
2013-08-17 15:35:09 +02:00
isaacs
a66d2400a0 blog: v0.10.16 2013-08-16 12:47:54 -07:00
isaacs
0e043528a1 Now working on v0.10.17 2013-08-16 12:47:29 -07:00
isaacs
e679739b63 Merge branch 'v0.10.16-release' into v0.10 2013-08-16 12:46:56 -07:00
isaacs
50b4c905a4 2013.08.16, Version 0.10.16 (Stable)
* v8: back-port fix for CVE-2013-2882

* npm: Upgrade to 1.3.8

* crypto: fix assert() on malformed hex input (Ben Noordhuis)

* crypto: fix memory leak in randomBytes() error path (Ben Noordhuis)

* events: fix memory leak, don't leak event names (Ben Noordhuis)

* http: Handle hex/base64 encodings properly (isaacs)

* http: improve chunked res.write(buf) performance (Ben Noordhuis)

* stream: Fix double pipe error emit (Eran Hammer)
2013-08-16 08:32:38 -07:00
isaacs
5abdef790c npm: Upgrade to 1.3.8 2013-08-16 08:19:31 -07:00
Ben Noordhuis
f55aca6515 crypto: fix memory leak in randomBytes() error path
This is the conceptual back-port of commit ec54873 from the master
branch.
2013-08-16 16:50:01 +02:00
isaacs
255650f4d9 http: Handle hex/base64 encodings properly
This is a backport of 6d3d60aced39d59eaa5e705b7d822c227d0d3dae for
v0.10.
2013-08-15 15:01:28 -07:00
Timothy J Fontaine
b1acb2ebd6 blog: Post for v0.11.5 2013-08-06 17:14:53 -07:00
Eran Hammer
23d92ec88e stream: Fix double pipe error emit
If an error listener is added to a stream using once() before it is
piped, it is invoked and removed during pipe() but before pipe() sees it
which causes it to be emitted again.

Fixes #4155 #4978
2013-08-06 08:15:13 -07:00
isaacs
366baedfd8 doc: Update LICENSE for npm's Artistic 2.0 2013-08-05 13:56:05 -07:00
mstarzinger@chromium.org
6b92a71321 v8: back-port fix for CVE-2013-2882
Quoting the CVE:

    Google V8, as used in Google Chrome before 28.0.1500.95, allows
    remote attackers to cause a denial of service or possibly have
    unspecified other impact via vectors that leverage "type confusion."

Likely has zero impact on node.js because it only runs local, trusted
code but let's apply it anyway.

This is a back-port of upstream commit r15665. Original commit log:

    Use internal array as API function cache.

    R=yangguo@chromium.org
    BUG=chromium:260106
    TEST=cctest/test-api/Regress260106

    Review URL: https://codereview.chromium.org/19159003

Fixes #5973.
2013-08-05 18:17:24 +02:00
Forrest L Norvell
231092d236 doc: document domain.enter() and domain.exit()
Adds the documentation requested in #5017.
2013-08-05 13:11:38 +02:00
Sam Roberts
6a7be99703 doc: fs.open, fix flag/mode confusion, etc.
Flags and modes aren't the same, symlinks are followed in all of the
path but the last component, docs should say something about what the
mode argument is for and when its used, fs.openSync should point to the
function that contains the docs for its args, as fs.writeSync does.
2013-08-05 12:26:09 +02:00
isaacs
bea9dfa14c npm: Upgrade to 1.3.7 2013-08-02 14:55:22 -07:00
Ben Noordhuis
9e1eb361e8 test: future-proof simple/test-event-emitter-memory-leak
Run the garbage collector before running the actual test. It doesn't
matter now but if in the future something in node.js core creates a lot
of reclaimable garbage, that will break the test's expectation.
2013-08-01 16:14:14 +02:00
Ben Noordhuis
98db7babcc test: fix pummel/test-net-connect-memleak
* Run the garbage collector before creating the big array. It doesn't
  matter now but if in the future something in node.js core creates
  a lot of reclaimable garbage, that will break the test's expectation.

* The first RSS check was being done too late. The garbage collector
  might have run before the check, throwing off the 'reclaimed memory'
  calculation.

* Due to changes in how V8 represents the big array internally, the
  actual memory usage is just below 256 MB on x64. Update the test's
  expectation.
2013-08-01 16:07:46 +02:00
Ben Noordhuis
fc6f8a6943 events: fix memory leak, don't leak event names
Before this commit, events were set to undefined rather than deleted
from the EventEmitter's backing dictionary for performance reasons:
`delete obj.key` causes a transition of the dictionary's hidden class
and that can be costly.

Unfortunately, that introduces a memory leak when many events are added
and then removed again. The strings containing the event names are never
reclaimed by the garbage collector because they remain part of the
dictionary.

That's why this commit makes EventEmitter delete events again. This
effectively reverts commit 0397223.

Fixes #5970.
2013-08-01 14:52:06 +02:00
Ben Noordhuis
3398cce193 http: improve chunked res.write(buf) performance
Avoid a costly buffer-to-string operation. Instead, allocate a new
buffer, copy the chunk header and data into it and send that.

The speed difference is negligible on small payloads but it really
shines with larger (10+ kB) chunks. benchmark/http/end-vs-write-end
with 64 kB chunks gives 45-50% higher throughput. With 1 MB chunks,
the difference is a staggering 590%.

Of course, YMMV will vary with real workloads and networks but this
commit should have a positive impact on CPU and memory consumption.

Big kudos to Wyatt Preul (@wpreul) for reporting the issue and providing
the initial patch.

Fixes #5941 and #5944.
2013-07-31 13:23:06 +02:00
Wyatt Preul
6359e017ac docs: Warning about consuming response 2013-07-30 15:06:20 -07:00
Ben Noordhuis
6327d67be3 crypto: fix assert() on malformed hex input
Use the StringBytes::IsValidString() function introduced in commit
dce26cc to ensure that the input string meets the expectations of the
other StringBytes functions before processing it further.

Fixes the following assertion:

    Assertion failed: (str->Length() % 2 == 0 && "invalid hex string
    length"), function StorageSize, file ../../src/string_bytes.cc,
    line 301.

Fixes #5725.
2013-07-30 14:34:19 +02:00
Ben Noordhuis
dce26ccea1 string_bytes: add StringBytes::IsValidString()
Performs a quick, non-exhaustive check on the input string to see if
it's compatible with the specified string encoding.

Curently it only checks that hex strings have a length that is a
multiple of two.
2013-07-30 14:32:47 +02:00
Ben Noordhuis
4881a6a9a3 doc: clarify fs.read() offset argument 2013-07-28 00:05:10 +02:00
Andrew Chilton
767c5bf01d doc: add nodejs.geek.nz to the community page 2013-07-27 16:02:05 +02:00
Rod Vagg
df1673202c doc: add nodejs.org.au to community listing 2013-07-27 12:25:59 +02:00
Ben Noordhuis
e4363145ba test: fix simple/test-setproctitle
The title shouldn't be too long; libuv's uv_set_process_title() out of
security considerations no longer overwrites envp, only argv, so the
maximum title length is possibly quite short.

Fixes #5908.
2013-07-25 12:29:20 +02:00
Timothy J Fontaine
180f987147 blog: Post for v0.10.15 2013-07-25 17:03:21 -07:00
Timothy J Fontaine
33267337fa Now working on 0.10.16 2013-07-25 17:03:03 -07:00
Timothy J Fontaine
272525714d Merge branch 'v0.10.15-release' into v0.10 2013-07-25 17:02:38 -07:00
Timothy J Fontaine
2426d65af8 2013.07.25, Version 0.10.15 (Stable)
* src: fix process.getuid() return value (Ben Noordhuis)
2013-07-25 16:26:15 -07:00
Ben Noordhuis
015ec05272 src: fix process.getuid() return value
And process.getgid() too.

Commit ed80638 changed fs.chown() and fs.fchown() to only accept
unsigned integers. Make process.getuid() and process.getgid() follow
suit.

This commit should unbreak npm on OS X - it's hitting the new 'uid must
be an unsigned int' check when installing as e.g. user 'nobody' (which
has an UID of -2 in /etc/passwd or 4294967294 when cast to an uid_t.)

Fixes #5904.
2013-07-26 00:29:03 +02:00
Ben Noordhuis
0de5b831e2 doc: document tls.Server 'secureProtocol' option 2013-07-25 23:21:54 +02:00
Timothy J Fontaine
0256edc43e blog: Post for v0.10.14 2013-07-25 13:54:55 -07:00
Timothy J Fontaine
90c448de23 Now working on 0.10.15 2013-07-25 13:54:16 -07:00
Timothy J Fontaine
e2a598b5f2 Merge branch 'v0.10.14-release' into v0.10 2013-07-25 13:53:45 -07:00
Timothy J Fontaine
fdf57f811f 2013.07.25, Version 0.10.14 (Stable)
* uv: Upgrade to v0.10.13

* npm: Upgrade to v1.3.5

* os: Don't report negative times in cpu info (Ben Noordhuis)

* fs: Handle large UID and GID (Ben Noordhuis)

* url: Fix edge-case when protocol is non-lowercase (Shuan Wang)

* doc: Streams API Doc Rewrite (isaacs)

* node: call MakeDomainCallback in all domain cases (Trevor Norris)

* crypto: fix memory leak in LoadPKCS12 (Fedor Indutny)
2013-07-25 11:49:01 -07:00
Timothy J Fontaine
5c81f41e70 uv: Upgrade to v0.10.13 2013-07-25 10:48:29 -07:00
isaacs
4bf5211820 doc: explicitly set industry logo height 2013-07-24 13:37:20 -07:00
isaacs
ff0de45929 npm: Upgrade to v1.3.5 2013-07-24 13:23:44 -07:00
Ben Noordhuis
e20811a628 src: os: use Number::New() for CPU info
The return values from uv_cpu_info() don't necessarily fit in a 32 bits
signed integer.

Fixes #5732.
2013-07-23 17:12:17 +02:00
Ben Noordhuis
ed806385bf fs: uids and gids must be unsigned ints
Before this commit, fs.chown() and fs.fchown() coerced the uid and gid
arguments to signed integers which is wrong because uid_t and gid_t are
unsigned on most all platforms and IDs that don't fit in a signed
integer do exist.

This commit changes the aforementioned functions to take unsigned ints
instead.  No test because we can't assume the system has [GU]IDs that
large.

This change depends on joyent/libuv@d779eb5.

Fixes #5890.
2013-07-23 13:36:46 +02:00
Ben Noordhuis
14f45ba739 test: move two tests from simple/ to internet/
Fixes #5876.
2013-07-20 12:36:33 +02:00
Ben Noordhuis
e0c4fba0ac doc: events: clarify 'newListener' emitter state
Ditto for the 'removeListener' event.
2013-07-18 20:49:24 +02:00
Shuan Wang
48a4600c56 url: Fix edge-case when protocol is non-lowercase
When using url.parse(), path and pathname usually return '/' when there
is no path available. However when you have a protocol that contains
non-lowercase letters and the input string does not have a trailing
slash, both path and pathname will be undefined.
2013-07-17 15:59:28 -07:00
isaacs
04e0324f6a doc: style the 'type' fields in API docs 2013-07-16 10:49:54 -07:00
isaacs
db5776cf8b doc: Streams API Doc Rewrite
The Streams API doc is now broken up into 3 sections:

1. API for Consumers
2. API for Implementors
3. Details and Extras

This addresses one of the biggest points of confusion for new users who
start to consume streams, and get the impression that they have to do
lots of extra work and implement classes and such, just to get some data
out of a file.
2013-07-16 10:49:54 -07:00
isaacs
e48536f4cd tls: Trivial use_strict fix 2013-07-14 20:08:07 -07:00
Timothy J Fontaine
875dd37a93 blog: v0.11.4 is unstable not stable 2013-07-12 17:05:53 -07:00
Timothy J Fontaine
21dd5f4ea9 blog: v0.11.4 release 2013-07-12 15:12:49 -07:00
isaacs
5e86519199 npm: Upgrade to 1.3.4 2013-07-12 13:14:50 -07:00
isaacs
ff8a4058bf npm: Upgrade to 1.3.3 2013-07-12 08:56:26 -07:00
Trevor Norris
6d91bd3707 node: call MakeDomainCallback in all domain cases
Previously there was no way to pass a Function callback directly to
MakeCallback and support domains. The check has been added so that users
never have to worry about supporting domains while using MakeCallback.
2013-07-10 10:46:48 -07:00
Fedor Indutny
610269295b crypto: fix memory leak in LoadPKCS12
X509_STORE_add_cert increment reference of passed `x509` cert,
`X509_free` must be called to avoid memory leak.

This is a back-port of commit c1db1ec from the master branch.
2013-07-10 10:10:29 +02:00
Ben Noordhuis
8a65df9baa test: fix up indentation, replace tabs with spaces 2013-07-10 09:48:57 +02:00
isaacs
b3b8e74dbf tools: Add next/prev version scripts 2013-07-09 15:58:15 -07:00
Timothy J Fontaine
f1bb5dca85 blog: Post for v0.10.13 2013-07-09 14:29:16 -07:00
Timothy J Fontaine
8a7e2b9da6 Now working v0.10.14 2013-07-09 14:28:37 -07:00
Timothy J Fontaine
8d9897d735 Merge branch 'v0.10.13-release' into v0.10 2013-07-09 14:28:05 -07:00
Timothy J Fontaine
e32660a984 2013.07.09, Version 0.10.13 (Stable)
* uv: Upgrade to v0.10.12

* npm: Upgrade to 1.3.2

* windows: get proper errno (Ben Noordhuis)

* tls: only wait for finish if we haven't seen it (Timothy J Fontaine)

* http: Dump response when request is aborted (isaacs)

* http: use an unref'd timer to fix delay in exit (Peter Rust)

* zlib: level can be negative (Brian White)

* zlib: allow zero values for level and strategy (Brian White)

* buffer: add comment explaining buffer alignment (Ben Noordhuis)

* string_bytes: properly detect 64bit (Timothy J Fontaine)

* src: fix memory leak in UsingDomains() (Ben Noordhuis)
2013-07-09 13:51:24 -07:00
Timothy J Fontaine
5b6464f461 build: use separate env vars for signing 2013-07-09 13:50:45 -07:00
isaacs
8bac8857f5 uv: Upgrade to v0.10.12 2013-07-09 13:20:38 -07:00
isaacs
f5602bda18 npm: Upgrade to 1.3.2 2013-07-09 13:09:02 -07:00
Timothy J Fontaine
91698f77e5 tls: only wait for finish if we haven't seen it
A pooled https agent may get a Connection: close, but never finish
destroying the socket as the prior request had already emitted finish
likely from a pipe.

Since the socket is not marked as destroyed it may get reused by the
agent pool and result in an ECONNRESET.

re: #5712 #5739
2013-07-09 10:55:10 -07:00
Nathan Rajlich
ed5324687e doc: fix bad markdown parsing in list 2013-07-08 11:25:40 -07:00
isaacs
99a7e78e77 http: Dump response when request is aborted
Fixes #5695
2013-07-08 09:20:40 -07:00
Tim Oxley
2d6d46172e doc: remove obsolete spawn() stdio options 2013-07-05 11:56:24 +02:00
Ben Noordhuis
806e300878 src: fix memory leak in UsingDomains()
UsingDomains() assigned process_tickCallback when it had already
been set by MakeCallback() a few frames down the call stack.

Dispose the handle first or we'll retain whatever is in the lexical
closure of the old process._tickCallback function.

Fixes #5795.
2013-07-05 02:20:39 +02:00
Timothy J Fontaine
4c38742dd8 test: fix tls-hello-parser-failure on smartos
Assert that when the client closes it has seen an error, this prevents
the test from timing out.

Also queue a second write in the case that we were able to send the
buffer before the other side closed the connection.
2013-07-01 17:41:38 -07:00
Peter Rust
16b59cbc74 http: use an unref'd timer to fix delay in exit
There was previously up to a second exit delay when exiting node
right after an http request/response, due to the utcDate() function
doing a setTimeout to update the cached date/time.

Fixing this should increase the performance of our http tests.
2013-07-01 16:02:25 -07:00
Brian White
dc3c2d12c8 zlib: level can be negative
This is a back-port of commit e945903 from the master branch.
2013-07-01 19:37:50 +02:00
Brian White
95dcd11dde zlib: allow zero values for level and strategy
This is a back-port of commit c9644fb from the master branch.
2013-07-01 19:37:29 +02:00
Ben Noordhuis
9290385057 doc: vm: update github issues link 2013-06-28 12:31:37 +02:00
Ben Noordhuis
cf6acf2a1a buffer: add comment explaining buffer alignment
Avoids alignment issues (unaligned loads/stores) on ARM. Originally
added in commit 285d8c6.

Fixes #3030.
2013-06-27 03:22:05 +02:00
isaacs
2a8c5ddc46 blog: v0.11.3 release 2013-06-26 17:06:51 -07:00
Ben Noordhuis
c1bf89df2e doc: tls: ECDH ciphers are not supported 2013-06-27 01:37:39 +02:00
Ben Noordhuis
a0b6df080d Revert "configure: fix cross-compilation host_arch_cc()"
Several people have reported cross-compiling build breakage, see e.g.
https://groups.google.com/forum/#!topic/nodejs/k8HzqpqPkJQ

Message-Id: <823c3bd1-e104-4409-86ad-0ab6de936fec@googlegroups.com>
Subject: [nodejs] nodejs 0.10.12 and Angstrom issues

This reverts commit acbdabb74b.
2013-06-25 12:47:24 +02:00
4926 changed files with 502588 additions and 419558 deletions

6
.gitignore vendored
View File

@@ -15,6 +15,7 @@ node_g
.benchmark_reports
/.project
/.cproject
icu_config.gypi
/out
@@ -54,6 +55,9 @@ deps/openssl/openssl.xml
# build/release artifacts
/*.tar.gz
/SHASUMS.txt*
/SHASUMS*.txt*
/tools/wrk/wrk
# test artifacts
tools/faketime

75
AUTHORS
View File

@@ -455,3 +455,78 @@ Daniel G. Taylor <dan@programmer-art.org>
Kiyoshi Nomo <tokyoincidents.g@gmail.com>
Veres Lajos <vlajos@gmail.com>
Yuan Chuan <yuanchuan23@gmail.com>
Peter Rust <peter@cornerstonenw.com>
Shuan Wang <shuanwang@gmail.com>
Andrew Chilton <andychilton@gmail.com>
Wyatt Preul <wpreul@gmail.com>
Forrest L Norvell <ogd@aoaioxxysz.net>
Eran Hammer <eran@hueniverse.com>
Daniel Chatfield <chatfielddaniel@gmail.com>
Eivind Uggedal <eivind@uggedal.com>
Edward Hutchins <eahutchins@gmail.com>
Chris Wren <cthewren@gmail.com>
Duan Yao <duanyao@ustc.edu>
Eric Schrock <Eric.Schrock@delphix.com>
Zarko Stankovic <stankovic.zarko@gmail.com>
Maxim Bogushevich <boga1@mail.ru>
Phillip Alexander <git@phillipalexander.io>
Tim Wood <washwithcare@gmail.com>
Linus Unnebäck <linus@folkdatorn.se>
Nikolai Vavilov <vvnicholas@gmail.com>
Michael Ridgway <mcridgway@gmail.com>
Yazhong Liu <yorkiefixer@gmail.com>
Gabriel Falkenberg <gabriel.falkenberg@gmail.com>
Kai Groner <kai@gronr.com>
Gabriel Farrell <g@grrawr.com>
Nicolas Kaiser <nikai@nikai.net>
Lev Gimelfarb <lev.gimelfarb@gmail.com>
Dav Glass <davglass@gmail.com>
ayanamist <contact@ayanamist.com>
Lorenz Leutgeb <lorenz.leutgeb@gmail.com>
Brandon Cheng <bcheng.gt@gmail.com>
Alexis Campailla <alexis@janeasystems.com>
Jun Ma <roammm@gmail.com>
Maxime Quandalle <maxime.quandalle@gmail.com>
Benjamin Waters <ben25890@gmail.com>
Doron Pagot <doronpagot@gmail.com>
Kenan Sulayman <kenan@sly.mn>
Christian Schulz <me@rndm.de>
Pedro Ballesteros <nitroduna@gmail.com>
Anton Khlynovskiy <subzey@gmail.com>
Nicolas Talle <dev@nicolab.net>
Mike Pennisi <mike@mikepennisi.com>
Greg Brail <greg@apigee.com>
Shuhei Kagawa <shuhei.kagawa@gmail.com>
Josh Dague <daguej@email.uc.edu>
Goh Yisheng (Andrew) <mail.yisheng@gmail.com>
William Bert <william@spanishdict.com>
Greg Sabia Tucker <greg@narrowlabs.com>
Calvin Metcalf <calvin.metcalf@gmail.com>
cjihrig <cjihrig@gmail.com>
Chris Barber <chris@cb1inc.com>
Nick Apperson <apperson@gmail.com>
Oguz Bastemur <obastemur@gmail.com>
Maurice Butler <maurice.butler@gmail.com>
Chris Dickinson <christopher.s.dickinson@gmail.com>
Julien Gilli <julien.gilli@joyent.com>
Jakob Gillich <jakob@gillich.me>
James Halliday <mail@substack.net>
Kevin Simper <kevin.simper@gmail.com>
Jackson Tian <shyvo1987@gmail.com>
Tristan Berger <tristan.berger@gmail.com>
Mathias Schreck <schreck.mathias@googlemail.com>
Matthew Fitzsimmons <matt@fitzage.com>
Swaagie <info@martijnswaagman.nl>
Emmanuel Odeke <emmanuel.odeke@cmgcanada.ca>
Eric Mill <eric@konklone.com>
Brendan Ashworth <squirrelslikeacorns@gmail.com>
Alejandro Oviedo <alejandro.oviedo.g@gmail.com>
pkcs <pkcs@gmx.com>
Saúl Ibarra Corretgé <saghul@gmail.com>
silverwind <silv3rwind@gmail.com>
Steven R. Loomis <srl@icu-project.org>
James M Snell <jasnell@gmail.com>
Amir Saboury <amir.saboury@gmail.com>
Florin-Cristian Gavrila <cristi_gavrila1@yahoo.com>
Tyler Anton <mtyleranton@gmail.com>
Jonas Dohse <jonas@dohse.ch>

View File

@@ -134,12 +134,6 @@ feature branch. Post a comment in the pull request afterwards; GitHub does
not send out notifications when you add commits.
### CONTRIBUTOR LICENSE AGREEMENT
Please visit http://nodejs.org/cla.html and sign the Contributor License
Agreement. You only need to do that once.
[stability index page]: https://github.com/joyent/node/blob/master/doc/api/documentation.markdown
[issue tracker]: https://github.com/joyent/node/issues
[node.js mailing list]: http://groups.google.com/group/nodejs

466
ChangeLog
View File

@@ -1,4 +1,468 @@
2013.06.18, Version 0.10.12 (Stable)
2015.03.23, Version 0.10.38 (Maintenance)
* openssl: upgrade to 1.0.1m (Addressing multiple CVEs)
2015.03.11, Version 0.10.37 (Maintenance), 7d6b5b1d5ba726331f9ccaaae59af7cd53eee82e
* uv: update to 0.10.36 (CVE-2015-0278)
* domains: fix stack clearing after error handled (Jonas Dohse)
* buffer: reword Buffer.concat error message (Chris Dickinson)
* console: allow Object.prototype fields as labels (Julien Gilli)
* V8: log version in profiler log file (Ben Noordhuis)
* http: fix performance regression for GET requests (Florin-Cristian Gavrila)
2015.01.26, Version 0.10.36 (Stable), 09b482886bdd3d863c3d4e7d71264eac0daaf9e1
* openssl: update to 1.0.1l
* v8: Fix debugger and strict mode regression (Julien Gilli)
* v8: don't busy loop in cpu profiler thread (Ben Noordhuis)
2014.12.22, Version 0.10.35 (Stable), a363f61ca839e817eb6853c5dc5af8c3b9b9226b
* tls: re-add 1024-bit SSL certs removed by f9456a2 (Chris Dickinson)
* timers: don't close interval timers when unrefd (Julien Gilli)
* timers: don't mutate unref list while iterating it (Julien Gilli)
2014.12.17, Version 0.10.34 (Stable), 52795f8fcc2de77cf997e671ea58614e5e425dfe
* uv: update to v0.10.30
* zlib: upgrade to v1.2.8
* child_process: check execFile args is an array (Sam Roberts)
* child_process: check fork args is an array (Sam Roberts)
* crypto: update root certificates (Ben Noordhuis)
* domains: fix issues with abort on uncaught (Julien Gilli)
* timers: Avoid linear scan in _unrefActive. (Julien Gilli)
* timers: fix unref() memory leak (Trevor Norris)
* v8: add api for aborting on uncaught exception (Julien Gilli)
* debugger: fix when using "use strict" (Julien Gilli)
2014.10.20, Version 0.10.33 (Stable), 8d045a30e95602b443eb259a5021d33feb4df079
* openssl: Update to 1.0.1j (Addressing multiple CVEs)
* uv: Update to v0.10.29
* child_process: properly support optional args (cjihrig)
* crypto: Disable autonegotiation for SSLv2/3 by default (Fedor Indutny,
Timothy J Fontaine, Alexis Campailla)
This is a behavior change, by default we will not allow the negotiation to
SSLv2 or SSLv3. If you want this behavior, run Node.js with either
`--enable-ssl2` or `--enable-ssl3` respectively.
This does not change the behavior for users specifically requesting
`SSLv2_method` or `SSLv3_method`. While this behavior is not advised, it is
assumed you know what you're doing since you're specifically asking to use
these methods.
2014.09.16, Version 0.10.32 (Stable), 0fe0d121551593c23a565db8397f85f17bb0f00e
* npm: Update to 1.4.28
* v8: fix a crash introduced by previous release (Fedor Indutny)
* configure: add --openssl-no-asm flag (Fedor Indutny)
* crypto: use domains for any callback-taking method (Chris Dickinson)
* http: do not send `0\r\n\r\n` in TE HEAD responses (Fedor Indutny)
* querystring: fix unescape override (Tristan Berger)
* url: Add support for RFC 3490 separators (Mathias Bynens)
2014.08.19, Version 0.10.31 (Stable), 7fabdc23d843cb705d2d0739e7bbdaaf50aa3292
* v8: backport CVE-2013-6668
* openssl: Update to v1.0.1i
* npm: Update to v1.4.23
* cluster: disconnect should not be synchronous (Sam Roberts)
* fs: fix fs.readFileSync fd leak when get RangeError (Jackson Tian)
* stream: fix Readable.wrap objectMode falsy values (James Halliday)
* timers: fix timers with non-integer delay hanging. (Julien Gilli)
2014.07.31, Version 0.10.30 (Stable), bc0ff830aff1e016163d855e86ded5c98b0899e8
* uv: Upgrade to v0.10.28
* npm: Upgrade to v1.4.21
* v8: Interrupts must not mask stack overflow.
* Revert "stream: start old-mode read in a next tick" (Fedor Indutny)
* buffer: fix sign overflow in `readUIn32BE` (Fedor Indutny)
* buffer: improve {read,write}{U}Int* methods (Nick Apperson)
* child_process: handle writeUtf8String error (Fedor Indutny)
* deps: backport 4ed5fde4f from v8 upstream (Fedor Indutny)
*
* lib: remove and restructure calls to isNaN() (cjihrig)
* module: eliminate double `getenv()` (Maciej Małecki)
* stream2: flush extant data on read of ended stream (Chris Dickinson)
* streams: remove unused require('assert') (Rod Vagg)
* timers: backport f8193ab (Julien Gilli)
* util.h: interface compatibility (Oguz Bastemur)
* zlib: do not crash on write after close (Fedor Indutny)
2014.06.05, Version 0.10.29 (Stable), ce82d6b8474bde7ac7df6d425fb88fb1bcba35bc
* openssl: to 1.0.1h (CVE-2014-0224)
* npm: upgrade to 1.4.14
* utf8: Prevent Node from sending invalid UTF-8 (Felix Geisendörfer)
- *NOTE* this introduces a breaking change, previously you could construct
invalid UTF-8 and invoke an error in a client that was expecting valid
UTF-8, now unmatched surrogate pairs are replaced with the unknown UTF-8
character. To restore the old functionality simply have NODE_INVALID_UTF8
environment variable set.
* child_process: do not set args before throwing (Greg Sabia Tucker)
* child_process: spawn() does not throw TypeError (Greg Sabia Tucker)
* constants: export O_NONBLOCK (Fedor Indutny)
* crypto: improve memory usage (Alexis Campailla)
* fs: close file if fstat() fails in readFile() (cjihrig)
* lib: name EventEmitter prototype methods (Ben Noordhuis)
* tls: fix performance issue (Alexis Campailla)
2014.05.01, Version 0.10.28 (Stable), b148cbe09d4657766fdb61575ba985734c2ff0a8
* npm: upgrade to v1.4.9
2014.05.01, Version 0.10.27 (Stable), cb7911f78ae96ef7a540df992cc1359ba9636e86
* npm: upgrade to v1.4.8
* openssl: upgrade to 1.0.1g
* uv: update to v0.10.27
* dns: fix certain txt entries (Fedor Indutny)
* assert: Ensure reflexivity of deepEqual (Mike Pennisi)
* child_process: fix deadlock when sending handles (Fedor Indutny)
* child_process: fix sending handle twice (Fedor Indutny)
* crypto: do not lowercase cipher/hash names (Fedor Indutny)
* dtrace: workaround linker bug on FreeBSD (Fedor Indutny)
* http: do not emit EOF non-readable socket (Fedor Indutny)
* http: invoke createConnection when no agent (Nathan Rajlich)
* stream: remove useless check (Brian White)
* timer: don't reschedule timer bucket in a domain (Greg Brail)
* url: treat \ the same as / (isaacs)
* util: format as Error if instanceof Error (Rod Vagg)
2014.02.18, Version 0.10.26 (Stable), cc56c62ed879ad4f93b1fdab3235c43e60f48b7e
* uv: Upgrade to v0.10.25 (Timothy J Fontaine)
* npm: upgrade to 1.4.3 (isaacs)
* v8: support compiling with VS2013 (Fedor Indutny)
* cares: backport TXT parsing fix (Fedor Indutny)
* crypto: throw on SignFinal failure (Fedor Indutny)
* crypto: update root certificates (Ben Noordhuis)
* debugger: Fix breakpoint not showing after restart (Farid Neshat)
* fs: make unwatchFile() insensitive to path (iamdoron)
* net: do not re-emit stream errors (Fedor Indutny)
* net: make Socket destroy() re-entrance safe (Jun Ma)
* net: reset `endEmitted` on reconnect (Fedor Indutny)
* node: do not close stdio implicitly (Fedor Indutny)
* zlib: avoid assertion in close (Fedor Indutny)
2014.01.23, Version 0.10.25 (Stable), b0e5f195dfce3e2b99f5091373d49f6616682596
* uv: Upgrade to v0.10.23
* npm: Upgrade to v1.3.24
* v8: Fix enumeration for objects with lots of properties
* child_process: fix spawn() optional arguments (Sam Roberts)
* cluster: report more errors to workers (Fedor Indutny)
* domains: exit() only affects active domains (Ryan Graham)
* src: OnFatalError handler must abort() (Timothy J Fontaine)
* stream: writes may return false but forget to emit drain (Yang Tianyang)
2013.12.18, Version 0.10.24 (Stable), b7fd6bc899ccb629d790c47aee06aba87e535c41
* uv: Upgrade to v0.10.21
* npm: upgrade to 1.3.21
* v8: backport fix for CVE-2013-{6639|6640}
* build: unix install node and dep library headers (Timothy J Fontaine)
* cluster, v8: fix --logfile=%p.log (Ben Noordhuis)
* module: only cache package main (Wyatt Preul)
2013.12.12, Version 0.10.23 (Stable), 0462bc23564e7e950a70ae4577a840b04db6c7c6
* uv: Upgrade to v0.10.20 (Timothy J Fontaine)
* npm: Upgrade to 1.3.17 (isaacs)
* gyp: update to 78b26f7 (Timothy J Fontaine)
* build: include postmortem symbols on linux (Timothy J Fontaine)
* crypto: Make Decipher._flush() emit errors. (Kai Groner)
* dgram: fix abort when getting `fd` of closed dgram (Fedor Indutny)
* events: do not accept NaN in setMaxListeners (Fedor Indutny)
* events: avoid calling `once` functions twice (Tim Wood)
* events: fix TypeError in removeAllListeners (Jeremy Martin)
* fs: report correct path when EEXIST (Fedor Indutny)
* process: enforce allowed signals for kill (Sam Roberts)
* tls: emit 'end' on .receivedShutdown (Fedor Indutny)
* tls: fix potential data corruption (Fedor Indutny)
* tls: handle `ssl.start()` errors appropriately (Fedor Indutny)
* tls: reset NPN callbacks after SNI (Fedor Indutny)
2013.11.12, Version 0.10.22 (Stable), cbff8f091c22fb1df6b238c7a1b9145db950fa65
* npm: Upgrade to 1.3.14
* uv: Upgrade to v0.10.19
* child_process: don't assert on stale file descriptor events (Fedor Indutny)
* darwin: Fix "Not Responding" in Mavericks activity monitor (Fedor Indutny)
* debugger: Fix bug in sb() with unnamed script (Maxim Bogushevich)
* repl: do not insert duplicates into completions (Maciej Małecki)
* src: Fix memory leak on closed handles (Timothy J Fontaine)
* tls: prevent stalls by using read(0) (Fedor Indutny)
* v8: use correct timezone information on Solaris (Maciej Małecki)
2013.10.18, Version 0.10.21 (Stable), e2da042844a830fafb8031f6c477eb4f96195210
* uv: Upgrade to v0.10.18
* crypto: clear errors from verify failure (Timothy J Fontaine)
* dtrace: interpret two byte strings (Dave Pacheco)
* fs: fix fs.truncate() file content zeroing bug (Ben Noordhuis)
* http: provide backpressure for pipeline flood (isaacs)
* tls: fix premature connection termination (Ben Noordhuis)
2013.09.30, Version 0.10.20 (Stable), d7234c8d50a1af73f60d2d3c0cc7eed17429a481
* tls: fix sporadic hang and partial reads (Fedor Indutny)
- fixes "npm ERR! cb() never called!"
2013.09.24, Version 0.10.19 (Stable), 6b5e6a5a3ec8d994c9aab3b800b9edbf1b287904
* uv: Upgrade to v0.10.17
* npm: upgrade to 1.3.11
* readline: handle input starting with control chars (Eric Schrock)
* configure: add mips-float-abi (soft, hard) option (Andrei Sedoi)
* stream: objectMode transforms allow falsey values (isaacs)
* tls: prevent duplicate values returned from read (Nathan Rajlich)
* tls: NPN protocols are now local to connections (Fedor Indutny)
2013.09.04, Version 0.10.18 (Stable), 67a1f0c52e0708e2596f3f2134b8386d6112561e
* uv: Upgrade to v0.10.15
* stream: Don't crash on unset _events property (isaacs)
* stream: Pass 'buffer' encoding with decoded writable chunks (isaacs)
2013.08.21, Version 0.10.17 (Stable), 469a4a5091a677df62be319675056b869c31b35c
* uv: Upgrade v0.10.14
* http_parser: Do not accept PUN/GEM methods as PUT/GET (Chris Dickinson)
* tls: fix assertion when ssl is destroyed at read (Fedor Indutny)
* stream: Throw on 'error' if listeners removed (isaacs)
* dgram: fix assertion on bad send() arguments (Ben Noordhuis)
* readline: pause stdin before turning off terminal raw mode (Daniel Chatfield)
2013.08.16, Version 0.10.16 (Stable), 50b4c905a4425430ae54db4906f88982309e128d
* v8: back-port fix for CVE-2013-2882
* npm: Upgrade to 1.3.8
* crypto: fix assert() on malformed hex input (Ben Noordhuis)
* crypto: fix memory leak in randomBytes() error path (Ben Noordhuis)
* events: fix memory leak, don't leak event names (Ben Noordhuis)
* http: Handle hex/base64 encodings properly (isaacs)
* http: improve chunked res.write(buf) performance (Ben Noordhuis)
* stream: Fix double pipe error emit (Eran Hammer)
2013.07.25, Version 0.10.15 (Stable)
* src: fix process.getuid() return value (Ben Noordhuis)
2013.07.25, Version 0.10.14 (Stable), fdf57f811f9683a4ec49a74dc7226517e32e6c9d
* uv: Upgrade to v0.10.13
* npm: Upgrade to v1.3.5
* os: Don't report negative times in cpu info (Ben Noordhuis)
* fs: Handle large UID and GID (Ben Noordhuis)
* url: Fix edge-case when protocol is non-lowercase (Shuan Wang)
* doc: Streams API Doc Rewrite (isaacs)
* node: call MakeDomainCallback in all domain cases (Trevor Norris)
* crypto: fix memory leak in LoadPKCS12 (Fedor Indutny)
2013.07.09, Version 0.10.13 (Stable), e32660a984427d46af6a144983cf7b8045b7299c
* uv: Upgrade to v0.10.12
* npm: Upgrade to 1.3.2
* windows: get proper errno (Ben Noordhuis)
* tls: only wait for finish if we haven't seen it (Timothy J Fontaine)
* http: Dump response when request is aborted (isaacs)
* http: use an unref'd timer to fix delay in exit (Peter Rust)
* zlib: level can be negative (Brian White)
* zlib: allow zero values for level and strategy (Brian White)
* buffer: add comment explaining buffer alignment (Ben Noordhuis)
* string_bytes: properly detect 64bit (Timothy J Fontaine)
* src: fix memory leak in UsingDomains() (Ben Noordhuis)
2013.06.18, Version 0.10.12 (Stable), a088cf4f930d3928c97d239adf950ab43e7794aa
* npm: Upgrade to 1.2.32

274
LICENSE
View File

@@ -294,9 +294,9 @@ maintained libraries. The externally maintained libraries used by Node are:
- Zlib at deps/zlib. zlib's license follows:
"""
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.4, March 14th, 2010
version 1.2.8, April 28th, 2013
Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -314,79 +314,249 @@ maintained libraries. The externally maintained libraries used by Node are:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly
Mark Adler
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
*/
"""
- npm is a package manager program located at deps/npm.
npm's license follows:
"""
Copyright 2009-2012, Isaac Z. Schlueter (the "Original Author")
Copyright (c) Isaac Z. Schlueter
All rights reserved.
MIT +no-false-attribs License
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.
Distributions of all or part of the Software intended to be used
by the recipients as they would use the unmodified Software,
containing modifications that substantially alter, remove, or
disable functionality of the Software, outside of the documented
configuration mechanisms provided by the Software, shall be
modified such that the Original Author's bug reporting email
addresses and urls are either replaced with the contact information
of the parties responsible for the changes, or removed entirely.
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.
npm is released under the Artistic 2.0 License.
The text of the License follows:
Except where noted, this license applies to any and all software
programs and associated documentation files created by the
Original Author, when distributed with the Software.
--------
The Artistic License 2.0
Copyright (c) 2000-2006, The Perl Foundation.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
This license establishes the terms under which a given free software
Package may be copied, modified, distributed, and/or redistributed.
The intent is that the Copyright Holder maintains some artistic
control over the development of that Package while still keeping the
Package available as open source and free software.
You are always permitted to make arrangements wholly outside of this
license directly with the Copyright Holder of a given Package. If the
terms of this license do not permit the full use that you propose to
make of the Package, you should contact the Copyright Holder and seek
a different licensing arrangement.
Definitions
"Copyright Holder" means the individual(s) or organization(s)
named in the copyright notice for the entire Package.
"Contributor" means any party that has contributed code or other
material to the Package, in accordance with the Copyright Holder's
procedures.
"You" and "your" means any person who would like to copy,
distribute, or modify the Package.
"Package" means the collection of files distributed by the
Copyright Holder, and derivatives of that collection and/or of
those files. A given Package may consist of either the Standard
Version, or a Modified Version.
"Distribute" means providing a copy of the Package or making it
accessible to anyone else, or in the case of a company or
organization, to others outside of your company or organization.
"Distributor Fee" means any fee that you charge for Distributing
this Package or providing support for this Package to another
party. It does not mean licensing fees.
"Standard Version" refers to the Package if it has not been
modified, or has been modified only in ways explicitly requested
by the Copyright Holder.
"Modified Version" means the Package, if it has been changed, and
such changes were not explicitly requested by the Copyright
Holder.
"Original License" means this Artistic License as Distributed with
the Standard Version of the Package, in its current version or as
it may be modified by The Perl Foundation in the future.
"Source" form means the source code, documentation source, and
configuration files for the Package.
"Compiled" form means the compiled bytecode, object code, binary,
or any other form resulting from mechanical transformation or
translation of the Source form.
Permission for Use and Modification Without Distribution
(1) You are permitted to use the Standard Version and create and use
Modified Versions for any purpose without restriction, provided that
you do not Distribute the Modified Version.
Permissions for Redistribution of the Standard Version
(2) You may Distribute verbatim copies of the Source form of the
Standard Version of this Package in any medium without restriction,
either gratis or for a Distributor Fee, provided that you duplicate
all of the original copyright notices and associated disclaimers. At
your discretion, such verbatim copies may or may not include a
Compiled form of the Package.
(3) You may apply any bug fixes, portability changes, and other
modifications made available from the Copyright Holder. The resulting
Package will still be considered the Standard Version, and as such
will be subject to the Original License.
Distribution of Modified Versions of the Package as Source
(4) You may Distribute your Modified Version as Source (either gratis
or for a Distributor Fee, and with or without a Compiled form of the
Modified Version) provided that you clearly document how it differs
from the Standard Version, including, but not limited to, documenting
any non-standard features, executables, or modules, and provided that
you do at least ONE of the following:
(a) make the Modified Version available to the Copyright Holder
of the Standard Version, under the Original License, so that the
Copyright Holder may include your modifications in the Standard
Version.
(b) ensure that installation of your Modified Version does not
prevent the user installing or running the Standard Version. In
addition, the Modified Version must bear a name that is different
from the name of the Standard Version.
(c) allow anyone who receives a copy of the Modified Version to
make the Source form of the Modified Version available to others
under
(i) the Original License or
(ii) a license that permits the licensee to freely copy,
modify and redistribute the Modified Version using the same
licensing terms that apply to the copy that the licensee
received, and requires that the Source form of the Modified
Version, and of any works derived from it, be made freely
available in that license fees are prohibited but Distributor
Fees are allowed.
Distribution of Compiled Forms of the Standard Version
or Modified Versions without the Source
(5) You may Distribute Compiled forms of the Standard Version without
the Source, provided that you include complete instructions on how to
get the Source of the Standard Version. Such instructions must be
valid at the time of your distribution. If these instructions, at any
time while you are carrying out such distribution, become invalid, you
must provide new instructions on demand or cease further distribution.
If you provide valid instructions or cease distribution within thirty
days after you become aware that the instructions are invalid, then
you do not forfeit any of your rights under this license.
(6) You may Distribute a Modified Version in Compiled form without
the Source, provided that you comply with Section 4 with respect to
the Source of the Modified Version.
Aggregating or Linking the Package
(7) You may aggregate the Package (either the Standard Version or
Modified Version) with other packages and Distribute the resulting
aggregation provided that you do not charge a licensing fee for the
Package. Distributor Fees are permitted, and licensing fees for other
components in the aggregation are permitted. The terms of this license
apply to the use and Distribution of the Standard or Modified Versions
as included in the aggregation.
(8) You are permitted to link Modified and Standard Versions with
other works, to embed the Package in a larger work of your own, or to
build stand-alone binary or bytecode versions of applications that
include the Package, and Distribute the result without restriction,
provided the result does not expose a direct interface to the Package.
Items That are Not Considered Part of a Modified Version
(9) Works (including, but not limited to, modules and scripts) that
merely extend or make use of the Package, do not, by themselves, cause
the Package to be a Modified Version. In addition, such works are not
considered parts of the Package itself, and are not subject to the
terms of this license.
General Provisions
(10) Any use, modification, and distribution of the Standard or
Modified Versions is governed by this Artistic License. By using,
modifying or distributing the Package, you accept this license. Do not
use, modify, or distribute the Package, if you do not accept this
license.
(11) If your Modified Version has been derived from a Modified
Version made by someone other than you, you are nevertheless required
to ensure that your Modified Version complies with the requirements of
this license.
(12) This license does not grant you the right to use any trademark,
service mark, tradename, or logo of the Copyright Holder.
(13) This license includes the non-exclusive, worldwide,
free-of-charge patent license to make, have made, use, offer to sell,
sell, import and otherwise transfer the Package with respect to any
patent claims licensable by the Copyright Holder that are necessarily
infringed by the Package. If you institute patent litigation
(including a cross-claim or counterclaim) against any party alleging
that the Package constitutes direct or contributory patent
infringement, then this Artistic License to you shall terminate on the
date that such litigation is filed.
(14) Disclaimer of Warranty:
THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL
LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------
"Node.js" and "node" trademark Joyent, Inc. npm is not officially
part of the Node.js project, and is neither owned by nor
officially affiliated with Joyent, Inc.
Packages published in the npm registry are not part of npm
itself, are the sole property of their respective maintainers,
and are not covered by this license.
Packages published in the npm registry (other than the Software and
its included dependencies) are not part of npm itself, are the sole
property of their respective maintainers, and are not covered by
this license.
"npm Logo" created by Mathias Pettersson and Brian Hammond,
used with permission.
"Gubblebum Blocky" font
Copyright (c) 2007 by Tjarda Koster, http://jelloween.deviantart.com
Copyright (c) by Tjarda Koster, http://jelloween.deviantart.com
included for use in the npm website and documentation,
used with permission.
This program uses "node-uuid", Copyright (c) 2010 Robert Kieffer,
according to the terms of the MIT license.
This program uses "request", Copyright (c) 2011 Mikeal Rogers,
according to the terms of the Apache license.
This program uses "mkdirp", Copyright (c) 2010 James Halliday,
according to the terms of the MIT/X11 license.
This program uses several Node modules contained in the node_modules/
subdirectory, according to the terms of their respective licenses.
"""
- tools/doc/node_modules/marked. Marked is a Markdown parser. Marked's

View File

@@ -46,9 +46,9 @@ endif
out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp deps/v8/build/common.gypi deps/v8/tools/gyp/v8.gyp node.gyp config.gypi
ifeq ($(USE_NINJA),1)
touch out/Makefile
$(PYTHON) tools/gyp_node -f ninja
$(PYTHON) tools/gyp_node.py -f ninja
else
$(PYTHON) tools/gyp_node -f make
$(PYTHON) tools/gyp_node.py -f make
endif
config.gypi: configure
@@ -82,16 +82,16 @@ test-http1: all
test-valgrind: all
$(PYTHON) tools/test.py --mode=release --valgrind simple message
test/gc/node_modules/weak/build:
test/gc/node_modules/weak/build/Release/weakref.node:
@if [ ! -f node ]; then make all; fi
./node deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
--directory="$(shell pwd)/test/gc/node_modules/weak" \
--nodedir="$(shell pwd)"
test-gc: all test/gc/node_modules/weak/build
test-gc: all test/gc/node_modules/weak/build/Release/weakref.node
$(PYTHON) tools/test.py --mode=release gc
test-all: all test/gc/node_modules/weak/build
test-all: all test/gc/node_modules/weak/build/Release/weakref.node
$(PYTHON) tools/test.py --mode=debug,release
make test-npm
@@ -125,40 +125,29 @@ test-npm: node
test-npm-publish: node
npm_package_config_publishtest=true ./node deps/npm/test/run.js
test-timers:
$(MAKE) --directory=tools faketime
$(PYTHON) tools/test.py --mode=release timers
test-timers-clean:
$(MAKE) --directory=tools clean
apidoc_sources = $(wildcard doc/api/*.markdown)
apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html)) \
$(addprefix out/,$(apidoc_sources:.markdown=.json))
apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets out/doc/about out/doc/community out/doc/download out/doc/logos out/doc/images
apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets
apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))
doc_images = $(addprefix out/,$(wildcard doc/images/* doc/*.jpg doc/*.png))
website_files = \
out/doc/index.html \
out/doc/v0.4_announcement.html \
out/doc/cla.html \
out/doc/sh_main.js \
out/doc/sh_javascript.min.js \
out/doc/sh_vim-dark.css \
out/doc/sh.css \
out/doc/favicon.ico \
out/doc/pipe.css \
out/doc/about/index.html \
out/doc/community/index.html \
out/doc/download/index.html \
out/doc/logos/index.html \
out/doc/changelog.html \
$(doc_images)
out/doc/sh_javascript.min.js
doc: $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/ blog node
doc: $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/ out/doc/changelog.html node
blogclean:
rm -rf out/blog
blog: doc/blog out/Release/node tools/blog
out/Release/node tools/blog/generate.js doc/blog/ out/blog/ doc/blog.html doc/rss.xml
doc-branch: NODE_DOC_VERSION = v$(shell $(PYTHON) tools/getnodeversion.py | cut -f1,2 -d.)
doc-branch: doc
$(apidoc_dirs):
mkdir -p $@
@@ -169,17 +158,14 @@ out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/
out/doc/changelog.html: ChangeLog doc/changelog-head.html doc/changelog-foot.html tools/build-changelog.sh node
bash tools/build-changelog.sh
out/doc/%.html: doc/%.html node
cat $< | sed -e 's|__VERSION__|'$(VERSION)'|g' > $@
out/doc/%: doc/%
cp -r $< $@
out/doc/api/%.json: doc/api/%.markdown node
out/Release/node tools/doc/generate.js --format=json $< > $@
NODE_DOC_VERSION=$(NODE_DOC_VERSION) out/Release/node tools/doc/generate.js --format=json $< > $@
out/doc/api/%.html: doc/api/%.markdown node
out/Release/node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
NODE_DOC_VERSION=$(NODE_DOC_VERSION) out/Release/node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
email.md: ChangeLog tools/email-footer.md
bash tools/changelog-head.sh | sed 's|^\* #|* \\#|g' > $@
@@ -188,9 +174,6 @@ email.md: ChangeLog tools/email-footer.md
blog.html: email.md
cat $< | ./node tools/doc/node_modules/.bin/marked > $@
blog-upload: blog
rsync -r out/blog/ node@nodejs.org:~/web/nodejs.org/blog/
website-upload: doc
rsync -r out/doc/ node@nodejs.org:~/web/nodejs.org/
ssh node@nodejs.org '\
@@ -201,6 +184,11 @@ website-upload: doc
rm -f ~/web/nodejs.org/dist/node-latest.tar.gz &&\
ln -s $(VERSION)/node-$(VERSION).tar.gz ~/web/nodejs.org/dist/node-latest.tar.gz'
doc-branch-upload: NODE_DOC_VERSION = v$(shell $(PYTHON) tools/getnodeversion.py | cut -f1,2 -d.)
doc-branch-upload: doc-branch
echo $(NODE_DOC_VERSION)
rsync -r out/doc/api/ node@nodejs.org:~/web/nodejs.org/$(NODE_DOC_VERSION)
docopen: out/doc/api/all.html
-google-chrome out/doc/api/all.html
@@ -209,6 +197,7 @@ docclean:
RAWVER=$(shell $(PYTHON) tools/getnodeversion.py)
VERSION=v$(RAWVER)
NODE_DOC_VERSION=$(VERSION)
RELEASE=$(shell $(PYTHON) tools/getnodeisrelease.py)
PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]')
ifeq ($(findstring x86_64,$(shell uname -m)),x86_64)
@@ -234,7 +223,7 @@ TARBALL=$(TARNAME).tar.gz
BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH)
BINARYTAR=$(BINARYNAME).tar.gz
PKG=out/$(TARNAME).pkg
packagemaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
PACKAGEMAKER ?= /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
PKGSRC=nodejs-$(DESTCPU)-$(RAWVER).tgz
ifdef NIGHTLY
@@ -277,18 +266,18 @@ $(PKG): release-only
rm -rf out/deps out/Release
$(PYTHON) ./configure --without-snapshot --dest-cpu=x64 --tag=$(TAG)
$(MAKE) install V=$(V) DESTDIR=$(PKGDIR)
SIGN="$(SIGN)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh
SIGN="$(APP_SIGN)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh
lipo $(PKGDIR)/32/usr/local/bin/node \
$(PKGDIR)/usr/local/bin/node \
-output $(PKGDIR)/usr/local/bin/node-universal \
-create
mv $(PKGDIR)/usr/local/bin/node-universal $(PKGDIR)/usr/local/bin/node
rm -rf $(PKGDIR)/32
$(packagemaker) \
$(PACKAGEMAKER) \
--id "org.nodejs.Node" \
--doc tools/osx-pkg.pmdoc \
--out $(PKG)
SIGN="$(SIGN)" PKG="$(PKG)" bash tools/osx-productsign.sh
SIGN="$(INT_SIGN)" PKG="$(PKG)" bash tools/osx-productsign.sh
$(TARBALL): release-only node doc
git archive --format=tar --prefix=$(TARNAME)/ HEAD | tar xf -

View File

@@ -28,6 +28,19 @@ Windows:
vcbuild.bat
You can download pre-built binaries for various operating systems from
[http://nodejs.org/download/](http://nodejs.org/download/). The Windows
and OS X installers will prompt you for the location to install to.
The tarballs are self-contained; you can extract them to a local directory
with:
tar xzf /path/to/node-<version>-<platform>-<arch>.tar.gz
Or system-wide with:
cd /usr/local && tar --strip-components 1 -xzf \
/path/to/node-<version>-<platform>-<arch>.tar.gz
### To run the tests:
Unix/Macintosh:
@@ -50,7 +63,7 @@ Resources for Newcomers
---
- [The Wiki](https://github.com/joyent/node/wiki)
- [nodejs.org](http://nodejs.org/)
- [how to install node.js and npm (node package manager)](http://joyeur.com/2010/12/10/installing-node-and-npm/)
- [how to install node.js and npm (node package manager)](http://www.joyent.com/blog/installing-node-and-npm/)
- [list of modules](https://github.com/joyent/node/wiki/modules)
- [searching the npm registry](http://npmjs.org/)
- [list of companies and projects using node](https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node)

View File

@@ -20,9 +20,12 @@ function main(conf) {
var fn = 'read' + conf.type;
buff.writeDoubleLE(0, 0, noAssert);
var testFunction = new Function('buff', [
"for (var i = 0; i !== " + len + "; i++) {",
" buff." + fn + "(0, " + JSON.stringify(noAssert) + ");",
"}"
].join("\n"));
bench.start();
for (var i = 0; i < len; i++) {
buff[fn](0, noAssert);
}
testFunction(buff);
bench.end(len / 1e6);
}

View File

@@ -15,9 +15,9 @@ var bench = common.createBenchmark(main, {
const INT8 = 0x7f;
const INT16 = 0x7fff;
const INT32 = 0x7fffffff;
const UINT8 = INT8 * 2;
const UINT16 = INT16 * 2;
const UINT32 = INT32 * 2;
const UINT8 = (INT8 * 2) + 1;
const UINT16 = (INT16 * 2) + 1;
const UINT32 = INT32;
var mod = {
writeInt8: INT8,
@@ -47,17 +47,23 @@ function main(conf) {
function benchInt(buff, fn, len, noAssert) {
var m = mod[fn];
var testFunction = new Function('buff', [
"for (var i = 0; i !== " + len + "; i++) {",
" buff." + fn + "(i & " + m + ", 0, " + JSON.stringify(noAssert) + ");",
"}"
].join("\n"));
bench.start();
for (var i = 0; i < len; i++) {
buff[fn](i % m, 0, noAssert);
}
testFunction(buff);
bench.end(len / 1e6);
}
function benchFloat(buff, fn, len, noAssert) {
var testFunction = new Function('buff', [
"for (var i = 0; i !== " + len + "; i++) {",
" buff." + fn + "(i, 0, " + JSON.stringify(noAssert) + ");",
"}"
].join("\n"));
bench.start();
for (var i = 0; i < len; i++) {
buff[fn](i * 0.1, 0, noAssert);
}
testFunction(buff);
bench.end(len / 1e6);
}

View File

@@ -18,28 +18,29 @@ if (module === require.main) {
var spawn = require('child_process').spawn;
runBenchmarks();
}
function runBenchmarks() {
var test = tests.shift();
if (!test)
return;
function runBenchmarks() {
var test = tests.shift();
if (!test)
return;
if (test.match(/^[\._]/))
return process.nextTick(runBenchmarks);
if (test.match(/^[\._]/))
return process.nextTick(runBenchmarks);
console.error(type + '/' + test);
test = path.resolve(dir, test);
console.error(type + '/' + test);
test = path.resolve(dir, test);
var child = spawn(process.execPath, [ test ], { stdio: 'inherit' });
child.on('close', function(code) {
if (code)
process.exit(code);
else {
console.log('');
runBenchmarks();
}
});
}
var a = (process.execArgv || []).concat(test);
var child = spawn(process.execPath, a, { stdio: 'inherit' });
child.on('close', function(code) {
if (code)
process.exit(code);
else {
console.log('');
runBenchmarks();
}
});
}
exports.createBenchmark = function(fn, options) {

View File

@@ -1,12 +1,13 @@
{
'variables': {
'visibility%': 'hidden', # V8's visibility setting
'target_arch%': 'ia32', # set v8's target architecture
'host_arch%': 'ia32', # set v8's host architecture
'want_separate_host_toolset': 0, # V8 should not build target and host
'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
'component%': 'static_library', # NB. these names match with what V8 expects
'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
'werror': '', # Turn off -Werror in V8 build.
'visibility%': 'hidden', # V8's visibility setting
'target_arch%': 'ia32', # set v8's target architecture
'host_arch%': 'ia32', # set v8's host architecture
'want_separate_host_toolset%': 0, # V8 should not build target and host
'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
'component%': 'static_library', # NB. these names match with what V8 expects
'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
'gcc_version%': 'unknown',
'clang%': 0,
'python%': 'python',
@@ -19,7 +20,14 @@
'conditions': [
['OS != "win"', {
'v8_postmortem_support': 'true'
}]
}],
['GENERATOR == "ninja" or OS== "mac"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
}, {
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a',
}],
],
},
@@ -79,10 +87,12 @@
],
}],
['OS=="solaris"', {
'cflags': [ '-fno-omit-frame-pointer' ],
# pull in V8's postmortem metadata
'ldflags': [ '-Wl,-z,allextract' ]
}],
['OS!="mac" and OS!="win"', {
'cflags': [ '-fno-omit-frame-pointer' ],
}],
],
'msvs_settings': {
'VCCLCompilerTool': {
@@ -225,6 +235,11 @@
}],
['OS=="freebsd" and node_use_dtrace=="true"', {
'libraries': [ '-lelf' ],
}],
['OS=="freebsd"', {
'ldflags': [
'-Wl,--export-dynamic',
],
}]
],
}

83
configure vendored
View File

@@ -82,6 +82,11 @@ parser.add_option("--shared-openssl-libname",
dest="shared_openssl_libname",
help="Alternative lib name to link to (default: 'crypto,ssl')")
parser.add_option("--openssl-no-asm",
action="store_true",
dest="openssl_no_asm",
help="Do not build optimized assembly for OpenSSL")
# deprecated
parser.add_option("--openssl-use-sys",
action="store_true",
@@ -107,10 +112,15 @@ parser.add_option("--systemtap-includes",
dest="systemtap_includes",
help=optparse.SUPPRESS_HELP)
parser.add_option("--no-ssl2",
parser.add_option("--without-ssl2",
action="store_true",
dest="no_ssl2",
help="Disable OpenSSL v2")
dest="ssl2",
help="Disable SSL v2")
parser.add_option("--without-ssl3",
action="store_true",
dest="ssl3",
help="Disable SSL v3")
parser.add_option("--shared-zlib",
action="store_true",
@@ -250,6 +260,12 @@ parser.add_option("--with-arm-float-abi",
help="Specifies which floating-point ABI to use. Valid values are: "
"soft, softfp, hard")
parser.add_option("--with-mips-float-abi",
action="store",
dest="mips_float_abi",
help="Specifies which floating-point ABI to use. Valid values are: "
"soft, hard")
parser.add_option("--ninja",
action="store_true",
dest="use_ninja",
@@ -296,14 +312,11 @@ def pkg_config(pkg):
return (libs, cflags)
def cc_macros(cc=None):
"""Checks predefined macros using the C compiler command."""
if cc is None:
cc = CC
def cc_macros():
"""Checks predefined macros using the CC command."""
try:
p = subprocess.Popen(shlex.split(cc) + ['-dM', '-E', '-'],
p = subprocess.Popen(shlex.split(CC) + ['-dM', '-E', '-'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
@@ -378,9 +391,7 @@ def arm_hard_float_abi():
def host_arch_cc():
"""Host architecture check using the CC command."""
# use 'cc', as CC may be set to a target arch compiler command
# in case of cross-compilation
k = cc_macros('cc')
k = cc_macros()
matchup = {
'__x86_64__' : 'x64',
@@ -446,6 +457,16 @@ def configure_arm(o):
o['variables']['v8_use_arm_eabi_hardfloat'] = b(hard_float)
def configure_mips(o):
if options.mips_float_abi:
if options.mips_float_abi in ('soft', 'hard'):
o['variables']['v8_use_mips_abi_hardfloat'] = b(
options.mips_float_abi == 'hard')
else:
raise Exception(
'Invalid mips-float-abi value. Valid values are: soft, hard')
def configure_node(o):
o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0
o['variables']['v8_no_strict_aliasing'] = 1 # work around compiler bugs
@@ -460,8 +481,15 @@ def configure_node(o):
o['variables']['host_arch'] = host_arch
o['variables']['target_arch'] = target_arch
if target_arch != host_arch and not options.without_snapshot:
o['variables']['want_separate_host_toolset'] = 1
else:
o['variables']['want_separate_host_toolset'] = 0
if target_arch == 'arm':
configure_arm(o)
elif target_arch in ('mips', 'mipsel'):
configure_mips(o)
cc_version, is_clang = compiler_version()
o['variables']['clang'] = 1 if is_clang else 0
@@ -478,6 +506,8 @@ def configure_node(o):
# SunOS, and we haven't implemented it.)
if flavor in ('solaris', 'mac'):
o['variables']['node_use_dtrace'] = b(not options.without_dtrace)
elif flavor == 'freebsd':
o['variables']['node_use_dtrace'] = b(options.with_dtrace)
elif flavor == 'linux':
o['variables']['node_use_dtrace'] = 'false'
o['variables']['node_use_systemtap'] = b(options.with_dtrace)
@@ -589,13 +619,18 @@ def configure_v8(o):
def configure_openssl(o):
o['variables']['node_use_openssl'] = b(not options.without_ssl)
o['variables']['node_shared_openssl'] = b(options.shared_openssl)
o['variables']['openssl_no_asm'] = (
1 if options.openssl_no_asm else 0)
if options.without_ssl:
return
if options.no_ssl2:
if options.ssl2:
o['defines'] += ['OPENSSL_NO_SSL2=1']
if options.ssl3:
o['defines'] += ['OPENSSL_NO_SSL3=1']
if options.shared_openssl:
(libs, cflags) = pkg_config('openssl') or ('-lssl -lcrypto', '')
@@ -682,13 +717,17 @@ config = '\n'.join(map('='.join, config.iteritems())) + '\n'
write('config.mk',
'# Do not edit. Generated by the configure script.\n' + config)
if options.use_ninja:
gyp_args = ['-f', 'ninja-' + flavor]
elif options.use_xcode:
gyp_args = ['-f', 'xcode']
elif flavor == 'win':
gyp_args = ['-f', 'msvs', '-G', 'msvs_version=auto']
else:
gyp_args = ['-f', 'make-' + flavor]
gyp_args = [sys.executable, 'tools/gyp_node.py', '--no-parallel']
subprocess.call([sys.executable, 'tools/gyp_node'] + gyp_args)
if options.use_ninja:
gyp_args += ['-f', 'ninja-' + flavor]
elif options.use_xcode:
gyp_args += ['-f', 'xcode']
elif flavor == 'win':
gyp_args += ['-f', 'msvs', '-G', 'msvs_version=auto']
else:
gyp_args += ['-f', 'make-' + flavor]
gyp_args += args
sys.exit(subprocess.call(gyp_args))

View File

@@ -936,6 +936,7 @@ size_t http_parser_execute (http_parser *parser,
} else if (parser->index == 2 && ch == 'P') {
parser->method = HTTP_COPY;
} else {
SET_ERRNO(HPE_INVALID_METHOD);
goto error;
}
} else if (parser->method == HTTP_MKCOL) {
@@ -948,12 +949,14 @@ size_t http_parser_execute (http_parser *parser,
} else if (parser->index == 2 && ch == 'A') {
parser->method = HTTP_MKACTIVITY;
} else {
SET_ERRNO(HPE_INVALID_METHOD);
goto error;
}
} else if (parser->method == HTTP_SUBSCRIBE) {
if (parser->index == 1 && ch == 'E') {
parser->method = HTTP_SEARCH;
} else {
SET_ERRNO(HPE_INVALID_METHOD);
goto error;
}
} else if (parser->index == 1 && parser->method == HTTP_POST) {
@@ -964,13 +967,27 @@ size_t http_parser_execute (http_parser *parser,
} else if (ch == 'A') {
parser->method = HTTP_PATCH;
} else {
SET_ERRNO(HPE_INVALID_METHOD);
goto error;
}
} else if (parser->index == 2) {
if (parser->method == HTTP_PUT) {
if (ch == 'R') parser->method = HTTP_PURGE;
if (ch == 'R') {
parser->method = HTTP_PURGE;
} else {
SET_ERRNO(HPE_INVALID_METHOD);
goto error;
}
} else if (parser->method == HTTP_UNLOCK) {
if (ch == 'S') parser->method = HTTP_UNSUBSCRIBE;
if (ch == 'S') {
parser->method = HTTP_UNSUBSCRIBE;
} else {
SET_ERRNO(HPE_INVALID_METHOD);
goto error;
}
} else {
SET_ERRNO(HPE_INVALID_METHOD);
goto error;
}
} else if (parser->index == 4 && parser->method == HTTP_PROPFIND && ch == 'P') {
parser->method = HTTP_PROPPATCH;

View File

@@ -3117,14 +3117,8 @@ main (void)
/// REQUESTS
test_simple("hello world", HPE_INVALID_METHOD);
test_simple("GET / HTP/1.1\r\n\r\n", HPE_INVALID_VERSION);
test_simple("ASDF / HTTP/1.1\r\n\r\n", HPE_INVALID_METHOD);
test_simple("PROPPATCHA / HTTP/1.1\r\n\r\n", HPE_INVALID_METHOD);
test_simple("GETA / HTTP/1.1\r\n\r\n", HPE_INVALID_METHOD);
// Well-formed but incomplete
test_simple("GET / HTTP/1.1\r\n"
"Content-Type: text/plain\r\n"
@@ -3167,13 +3161,23 @@ main (void)
}
static const char *bad_methods[] = {
"ASDF",
"C******",
"COLA",
"GEM",
"GETA",
"M****",
"MKCOLA",
"PROPPATCHA",
"PUN",
"PX",
"SA",
"hello world",
0 };
for (this_method = bad_methods; *this_method; this_method++) {
char buf[200];
sprintf(buf, "%s / HTTP/1.1\r\n\r\n", *this_method);
test_simple(buf, HPE_UNKNOWN);
test_simple(buf, HPE_INVALID_METHOD);
}
const char *dumbfuck2 =

2
deps/npm/.npmignore vendored
View File

@@ -7,9 +7,11 @@ npm-debug.log
/test/packages/npm-test-depends-on-spark/which-spark.log
/test/packages/test-package/random-data.txt
/test/root
node_modules/marked
node_modules/ronn
node_modules/tap
node_modules/.bin
node_modules/npm-registry-mock
/npmrc
/release/

2
deps/npm/.npmrc vendored Normal file
View File

@@ -0,0 +1,2 @@
save-prefix = ~
proprietary-attribs = false

View File

@@ -1,7 +0,0 @@
{
"libs": [
],
"plugins": {
"node": {}
}
}

5
deps/npm/.travis.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
language: node_js
script: "npm run-script tap"
node_js:
- "0.11"
- "0.10"

134
deps/npm/AUTHORS vendored
View File

@@ -1,48 +1,48 @@
# Authors sorted by whether or not they're me
Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)
Steve Steiner <ssteinerX@gmail.com> (http://websaucesoftware.com/blog/)
Mikeal Rogers <mikeal.rogers@gmail.com> (http://www.mikealrogers.com/)
Aaron Blohowiak <aaron.blohowiak@gmail.com> (http://aaronblohowiak.com/)
Martyn Smith <martyn@dollyfish.net.nz> (http://dollyfish.net.nz/)
Mathias Pettersson <mape@mape.me> (http://mape.me/)
Brian Hammond <brian@fictorial.com> (http://fictorial.com/)
Charlie Robbins <charlie.robbins@gmail.com> (http://www.charlierobbins.com/)
Francisco Treacy <francisco.treacy@gmail.com> (http://franciscotreacy.com/)
Cliffano Subagio <cliffano@gmail.com> (http://blog.cliffano.com/)
Christian Eager <christian.eager@nokia.com> (http://perpenduum.com)
Dav Glass <davglass@gmail.com> (http://blog.davglass.com)
Isaac Z. Schlueter <i@izs.me>
Steve Steiner <ssteinerX@gmail.com>
Mikeal Rogers <mikeal.rogers@gmail.com>
Aaron Blohowiak <aaron.blohowiak@gmail.com>
Martyn Smith <martyn@dollyfish.net.nz>
Mathias Pettersson <mape@mape.me>
Brian Hammond <brian@fictorial.com>
Charlie Robbins <charlie.robbins@gmail.com>
Francisco Treacy <francisco.treacy@gmail.com>
Cliffano Subagio <cliffano@gmail.com>
Christian Eager <christian.eager@nokia.com>
Dav Glass <davglass@gmail.com>
Alex K. Wolfe <alexkwolfe@gmail.com>
James Sanders <jimmyjazz14@gmail.com> (http://james-sanders.com/)
Reid Burke <me@reidburke.com> (http://reidburke.com/)
Arlo Breault <arlolra@gmail.com> (http://thoughtherder.com/)
Timo Derstappen <teemow@gmail.com> (http://teemow.com)
James Sanders <jimmyjazz14@gmail.com>
Reid Burke <me@reidburke.com>
Arlo Breault <arlolra@gmail.com>
Timo Derstappen <teemow@gmail.com>
Bradley Meck <bradley.meck@gmail.com>
Bart Teeuwisse <bart.teeuwisse@thecodemill.biz> (http://thecodemill.biz/)
Ben Noordhuis <info@bnoordhuis.nl> (http://bnoordhuis.nl/)
Tor Valamo <tor.valamo@gmail.com> (http://www.magnimedia.no/)
Whyme.Lyu <5longluna@gmail.com> (http://whyme.kuantu.com/)
Bart Teeuwisse <bart.teeuwisse@thecodemill.biz>
Ben Noordhuis <info@bnoordhuis.nl>
Tor Valamo <tor.valamo@gmail.com>
Whyme.Lyu <5longluna@gmail.com>
Olivier Melcher <olivier.melcher@gmail.com>
Tomaž Muraus <kami@k5-storitve.net> (http://www.tomaz-muraus.info)
Evan Meagher <evan.meagher@gmail.com> (http://evanmeagher.net/)
Orlando Vazquez <ovazquez@gmail.com> (http://2wycked.net/)
Tomaž Muraus <kami@k5-storitve.net>
Evan Meagher <evan.meagher@gmail.com>
Orlando Vazquez <ovazquez@gmail.com>
George Miroshnykov <gmiroshnykov@lohika.com>
Geoff Flarity (http://ca.linkedin.com/pub/geoff-flarity/a/536/43a)
Geoff Flarity <geoff.flarity@gmail.com>
Pete Kruckenberg <pete@kruckenberg.com>
Laurie Harper <laurie@holoweb.net> (http://laurie.holoweb.net/)
Laurie Harper <laurie@holoweb.net>
Chris Wong <chris@chriswongstudio.com>
Max Goodman <c@chromacode.com> (http://chromacode.com/)
Max Goodman <c@chromacode.com>
Scott Bronson <brons_github@rinspin.com>
Federico Romero <federomero@gmail.com>
Visnu Pitiyanuvath <visnupx@gmail.com> (http://visnup.com)
Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com/)
Mark Cahill <mark@tiemonster.info> (http://www.tiemonster.info/)
Visnu Pitiyanuvath <visnupx@gmail.com>
Irakli Gozalishvili <rfobic@gmail.com>
Mark Cahill <mark@tiemonster.info>
Zearin <zearin@gonk.net>
Iain Sproat <iainsproat@gmail.com>
Trent Mick <trentm@gmail.com> (http://trentm.com/)
Felix Geisendörfer <felix@debuggable.com> (http://www.debuggable.com/)
Conny Brunnkvist <cbrunnkvist@gmail.com> (http://twitter.com/connyb)
Will Elwood <w.elwood08@gmail.com> (https://github.com/welwood08)
Oleg Efimov <efimovov@gmail.com> (http://sannis.ru)
Trent Mick <trentm@gmail.com>
Felix Geisendörfer <felix@debuggable.com>
Conny Brunnkvist <cbrunnkvist@gmail.com>
Will Elwood <w.elwood08@gmail.com>
Oleg Efimov <efimovov@gmail.com>
Martin Cooper <mfncooper@gmail.com>
Jameson Little <t.jameson.little@gmail.com>
cspotcode <cspotcode@gmail.com>
@@ -90,3 +90,69 @@ Paul Miller <paul@paulmillr.com>
seebees <seebees@gmail.com>
Carl Lange <carl@flax.ie>
Jan Lehnardt <jan@apache.org>
Alexey Kreschuk <akrsch@gmail.com>
Di Wu <dwu@palantir.com>
Florian Margaine <florian@margaine.com>
Forbes Lindesay <forbes@lindesay.co.uk>
Ian Babrou <ibobrik@gmail.com>
Jaakko Manninen <jaakko@rocketpack.fi>
Johan Nordberg <its@johan-nordberg.com>
Johan Sköld <johan@skold.cc>
Larz Conwell <larz@larz-laptop.(none)>
Luke Arduini <luke.arduini@gmail.com>
Marcel Klehr <mklehr@gmx.net>
Mathias Bynens <mathias@qiwi.be>
Matt Lunn <matt@mattlunn.me.uk>
Matt McClure <matt.mcclure@mapmyfitness.com>
Nirk Niggler <nirk.niggler@gmail.com>
Paolo Fragomeni <paolo@async.ly>
Jake Verbaten (Raynos) <raynos2@gmail.com>
Robert Kowalski <rok@kowalski.gd>
Schabse Laks <Dev@SLaks.net>
Stuart Knightley <stuart@stuartk.com>
Stuart P. Bentley <stuart@testtrack4.com>
Vaz Allen <vaz@tryptid.com>
elisee <elisee@sparklin.org>
Evan You <yyx990803@gmail.com>
Wil Moore III <wil.moore@wilmoore.com>
Dylan Greene <dylang@gmail.com>
zeke <zeke@sikelianos.com>
Andrew Horton <andrew.j.horton@gmail.com>
Denis Gladkikh <outcoldman@gmail.com>
Daniel Santiago <daniel.santiago@highlevelwebs.com>
Alex Kocharin <alex@kocharin.ru>
Evan Lucas <evanlucas@me.com>
Steve Mason <stevem@brandwatch.com>
Quinn Slack <qslack@qslack.com>
Sébastien Santoro <dereckson@espace-win.org>
CamilleM <camille.moulin@alterway.fr>
Tom Huang <hzlhu.dargon@gmail.com>
Sergey Belov <peimei@ya.ru>
Younghoon Park <sola92@gmail.com>
Yazhong Liu <yorkiefixer@gmail.com>
Mikola Lysenko <mikolalysenko@gmail.com>
Rafael de Oleza <rafa@spotify.com>
Yeonghoon Park <sola92@gmail.com>
Franck Cuny <franck.cuny@gmail.com>
Alan Shaw <alan@freestyle-developments.co.uk>
Alex Rodionov <p0deje@gmail.com>
Alexej Yaroshevich <alex@qfox.ru>
Elan Shanker <elan.shanker@gmail.com>
François Frisch <francoisfrisch@gmail.com>
Gabriel Falkenberg <gabriel.falkenberg@gmail.com>
Jason Diamond <jason@diamond.name>
Jess Martin <jessmartin@gmail.com>
Jon Spencer <jon@jonspencer.ca>
Matt Colyer <matt@colyer.name>
Matt McClure <matt.mcclure@mapmyfitness.com>
Maximilian Antoni <maximilian.antoni@juliusbaer.com>
Nicholas Kinsey <pyro@feisty.io>
Paulo Cesar <pauloc062@gmail.com>
Quim Calpe <quim@kalpe.com>
Robert Gieseke <robert.gieseke@gmail.com>
Spain Train <michael.spainhower@opower.com>
TJ Holowaychuk <tj@vision-media.ca>
Thom Blake <tblake@brightroll.com>
Trevor Burnham <tburnham@hubspot.com>
bitspill <bitspill+github@bitspill.net>
Neil Gentleman <ngentleman@gmail.com>

737
deps/npm/CHANGELOG.md vendored Normal file
View File

@@ -0,0 +1,737 @@
### v1.4.28 (2014-09-12):
* [`f4540b6`](https://github.com/npm/npm/commit/f4540b6537a87e653d7495a9ddcf72949fdd4d14)
[#6043](https://github.com/npm/npm/issues/6043) defer rollbacks until just
before the CLI exits ([@isaacs](https://github.com/isaacs))
* [`1eabfd5`](https://github.com/npm/npm/commit/1eabfd5c03f33c2bd28823714ff02059eeee3899)
[#6043](https://github.com/npm/npm/issues/6043) `slide@1.1.6`: wait until all
callbacks have finished before proceeding
([@othiym23](https://github.com/othiym23))
### v1.4.27 (2014-09-04):
* [`4cf3c8f`](https://github.com/npm/npm/commit/4cf3c8fd78c9e2693a5f899f50c28f4823c88e2e)
[#6007](https://github.com/npm/npm/issues/6007) `request@2.42.0`: properly set
headers on proxy requests ([@isaacs](https://github.com/isaacs))
* [`403cb52`](https://github.com/npm/npm/commit/403cb526be1472bb7545fa8e62d4976382cdbbe5)
[#6055](https://github.com/npm/npm/issues/6055) `npmconf@1.1.8`: restore
case-insensitivity of environmental config
([@iarna](https://github.com/iarna))
### v1.4.26 (2014-08-28):
* [`eceea95`](https://github.com/npm/npm/commit/eceea95c804fa15b18e91c52c0beb08d42a3e77d)
`github-url-from-git@1.4.0`: add support for git+https and git+ssh
([@stefanbuck](https://github.com/stefanbuck))
* [`e561758`](https://github.com/npm/npm/commit/e5617587e7d7ab686192391ce55357dbc7fed0a3)
`columnify@1.2.1` ([@othiym23](https://github.com/othiym23))
* [`0c4fab3`](https://github.com/npm/npm/commit/0c4fab372ee76eab01dda83b6749429a8564902e)
`cmd-shim@2.0.0`: upgrade to graceful-fs 3
([@ForbesLindesay](https://github.com/ForbesLindesay))
* [`2d69e4d`](https://github.com/npm/npm/commit/2d69e4d95777671958b5e08d3b2f5844109d73e4)
`github-url-from-username-repo@1.0.0`: accept slashes in branch names
([@robertkowalski](https://github.com/robertkowalski))
* [`81f9b2b`](https://github.com/npm/npm/commit/81f9b2bac9d34c223ea093281ba3c495f23f10d1)
ensure lifecycle spawn errors caught properly
([@isaacs](https://github.com/isaacs))
* [`bfaab8c`](https://github.com/npm/npm/commit/bfaab8c6e0942382a96b250634ded22454c36b5a)
`npm-registry-client@2.0.7`: properly encode % in passwords
([@isaacs](https://github.com/isaacs))
* [`91cfb58`](https://github.com/npm/npm/commit/91cfb58dda851377ec604782263519f01fd96ad8)
doc: Fix 'npm help index' ([@isaacs](https://github.com/isaacs))
### v1.4.25 (2014-08-21):
* [`64c0ec2`](https://github.com/npm/npm/commit/64c0ec241ef5d83761ca8de54acb3c41b079956e)
`npm-registry-client@2.0.6`: Print the notification header returned by the
registry, and make sure status codes are printed without gratuitous quotes
around them.
([@othiym23](https://github.com/othiym23))
* [`a8ed12b`](https://github.com/npm/npm/commit/a8ed12b) `tar@1.0.1`:
Add test for removing an extract target immediately after unpacking.
([@isaacs](https://github.com/isaacs))
* [`70fd11d`](https://github.com/npm/npm/commit/70fd11d)
`lockfile@1.0.0`: Fix incorrect interaction between `wait`, `stale`,
and `retries` options. Part 2 of race condition leading to `ENOENT`
errors.
([@isaacs](https://github.com/isaacs))
* [`0072c4d`](https://github.com/npm/npm/commit/0072c4d)
`fstream@1.0.2`: Fix a double-finish call which can result in excess
FS operations after the `close` event. Part 2 of race condition
leading to `ENOENT` errors.
([@isaacs](https://github.com/isaacs))
### v1.4.24 (2014-08-14):
* [`9344bd9`](https://github.com/npm/npm/commit/9344bd9b2929b5c399a0e0e0b34d45bce7bc24bb)
doc: add new changelog ([@othiym23](https://github.com/othiym23))
* [`4be76fd`](https://github.com/npm/npm/commit/4be76fd65e895883c337a99f275ccc8c801adda3)
doc: update version doc to include `pre-*` increment args
([@isaacs](https://github.com/isaacs))
* [`e4f2620`](https://github.com/npm/npm/commit/e4f262036080a282ad60e236a9aeebd39fde9fe4)
build: add `make tag` to tag current release as `latest`
([@isaacs](https://github.com/isaacs))
* [`ec2596a`](https://github.com/npm/npm/commit/ec2596a7cb626772780b25b0a94a7e547a812bd5)
build: publish with `--tag=v1.4-next` ([@isaacs](https://github.com/isaacs))
* [`9ee55f8`](https://github.com/npm/npm/commit/9ee55f892b8b473032a43c59912c5684fd1b39e6)
build: add script to output `v1.4-next` publish tag
([@isaacs](https://github.com/isaacs))
* [`aecb56f`](https://github.com/npm/npm/commit/aecb56f95a84687ea46920a0b98aaa587fee1568)
build: remove outdated `docpublish` make target
([@isaacs](https://github.com/isaacs))
* [`b57a9b7`](https://github.com/npm/npm/commit/b57a9b7ccd13e6b38831ed63595c8ea5763da247)
build: remove unpublish step from `make publish`
([@isaacs](https://github.com/isaacs))
* [`2c6acb9`](https://github.com/npm/npm/commit/2c6acb96c71c16106965d5cd829b67195dd673c7)
install: rename `.gitignore` when unpacking foreign tarballs
([@isaacs](https://github.com/isaacs))
* [`22f3681`](https://github.com/npm/npm/commit/22f3681923e993a47fc1769ba735bfa3dd138082)
cache: detect non-gzipped tar files more reliably
([@isaacs](https://github.com/isaacs))
### v2.0.0-alpha-6 (2014-07-31):
* [`d987707`](https://github.com/npm/npm/commit/d987707) move fetch into
npm-registry-client ([@othiym23](https://github.com/othiym23))
* [`9b318e2`](https://github.com/npm/npm/commit/9b318e2) `read-installed@3.0.0`
([@isaacs](https://github.com/isaacs))
* [`9d73de7`](https://github.com/npm/npm/commit/9d73de7) remove unnecessary
mkdirps ([@isaacs](https://github.com/isaacs))
* [`ea547e2`](https://github.com/npm/npm/commit/ea547e2) Bump semver to version 3
([@isaacs](https://github.com/isaacs))
* [`33ccd13`](https://github.com/npm/npm/commit/33ccd13) Don't squash execute
perms in `_git-remotes/` dir ([@adammeadows](https://github.com/adammeadows))
* [`48fd233`](https://github.com/npm/npm/commit/48fd233) `npm-package-arg@2.0.1`
([@isaacs](https://github.com/isaacs))
### v1.4.23 (2014-07-31):
* [`8dd11d1`](https://github.com/npm/npm/commit/8dd11d1) update several
dependencies to avoid using `semver`s starting with 0.
### v1.4.22 (2014-07-31):
* [`d9a9e84`](https://github.com/npm/npm/commit/d9a9e84) `read-package-json@1.2.4`
([@isaacs](https://github.com/isaacs))
* [`86f0340`](https://github.com/npm/npm/commit/86f0340)
`github-url-from-git@1.2.0` ([@isaacs](https://github.com/isaacs))
* [`a94136a`](https://github.com/npm/npm/commit/a94136a) `fstream@0.1.29`
([@isaacs](https://github.com/isaacs))
* [`bb82d18`](https://github.com/npm/npm/commit/bb82d18) `glob@4.0.5`
([@isaacs](https://github.com/isaacs))
* [`5b6bcf4`](https://github.com/npm/npm/commit/5b6bcf4) `cmd-shim@1.1.2`
([@isaacs](https://github.com/isaacs))
* [`c2aa8b3`](https://github.com/npm/npm/commit/c2aa8b3) license: Cleaned up
legalese with actual lawyer ([@isaacs](https://github.com/isaacs))
* [`63fe0ee`](https://github.com/npm/npm/commit/63fe0ee) `init-package-json@1.0.0`
([@isaacs](https://github.com/isaacs))
### v2.0.0-alpha-5 (2014-07-22):
This release bumps up to 2.0 because of this breaking change, which could
potentially affect how your package's scripts are run:
* [`df4b0e7`](https://github.com/npm/npm/commit/df4b0e7fc1abd9a54f98db75ec9e4d03d37d125b)
[#5518](https://github.com/npm/npm/issues/5518) BREAKING CHANGE: support
passing arguments to `run` scripts ([@bcoe](https://github.com/bcoe))
Other changes:
* [`cd422c9`](https://github.com/npm/npm/commit/cd422c9de510766797c65720d70f085000f50543)
[#5748](https://github.com/npm/npm/issues/5748) link binaries for scoped
packages ([@othiym23](https://github.com/othiym23))
* [`4c3c778`](https://github.com/npm/npm/commit/4c3c77839920e830991e0c229c3c6a855c914d67)
[#5758](https://github.com/npm/npm/issues/5758) `npm link` includes scope
when linking scoped package ([@fengmk2](https://github.com/fengmk2))
* [`f9f58dd`](https://github.com/npm/npm/commit/f9f58dd0f5b715d4efa6619f13901916d8f99c47)
[#5707](https://github.com/npm/npm/issues/5707) document generic pre- /
post-commands ([@sudodoki](https://github.com/sudodoki))
* [`ac7a480`](https://github.com/npm/npm/commit/ac7a4801d80361b41dce4a18f22bcdf75e396000)
[#5406](https://github.com/npm/npm/issues/5406) `npm cache` displays usage
when called without arguments
([@michaelnisi](https://github.com/michaelnisi))
* [`f4554e9`](https://github.com/npm/npm/commit/f4554e99d34f77a8a02884493748f7d49a9a9d8b)
Test fixes for Windows ([@isaacs](https://github.com/isaacs))
* update dependencies ([@othiym23](https://github.com/othiym23))
### v1.5.0-alpha-4 (2014-07-18):
* fall back to `_auth` config as default auth when using default registry
([@isaacs](https://github.com/isaacs))
* support for 'init.version' for those who don't want to deal with semver 0.0.x
oddities ([@rvagg](https://github.com/rvagg))
* [`be06213`](https://github.com/npm/npm/commit/be06213415f2d51a50d2c792b4cd0d3412a9a7b1)
remove residual support for `win` log level
([@aterris](https://github.com/aterris))
### v1.5.0-alpha-3 (2014-07-17):
* [`a3a85dd`](https://github.com/npm/npm/commit/a3a85dd004c9245a71ad2f0213bd1a9a90d64cd6)
`--save` scoped packages correctly ([@othiym23](https://github.com/othiym23))
* [`18a3385`](https://github.com/npm/npm/commit/18a3385bcf8bfb8312239216afbffb7eec759150)
`npm-registry-client@3.0.2` ([@othiym23](https://github.com/othiym23))
* [`375988b`](https://github.com/npm/npm/commit/375988b9bf5aa5170f06a790d624d31b1eb32c6d)
invalid package names are an early error for optional deps
([@othiym23](https://github.com/othiym23))
* consistently use `node-package-arg` instead of arbitrary package spec
splitting ([@othiym23](https://github.com/othiym23))
### v1.4.21 (2014-07-14):
* [`88f51aa`](https://github.com/npm/npm/commit/88f51aa27eb9a958d1fa7ec50fee5cfdedd05110)
fix handling for 301s in `npm-registry-client@2.0.3`
([@Raynos](https://github.com/Raynos))
### v1.5.0-alpha-2 (2014-07-01):
* [`54cf625`](https://github.com/npm/npm/commit/54cf62534e3331e3f454e609e44f0b944e819283)
fix handling for 301s in `npm-registry-client@3.0.1`
([@Raynos](https://github.com/Raynos))
* [`e410861`](https://github.com/npm/npm/commit/e410861c69a3799c1874614cb5b87af8124ff98d)
don't crash if no username set on `whoami`
([@isaacs](https://github.com/isaacs))
* [`0353dde`](https://github.com/npm/npm/commit/0353ddeaca8171aa7dbdd8102b7e2eb581a86406)
respect `--json` for output ([@isaacs](https://github.com/isaacs))
* [`b3d112a`](https://github.com/npm/npm/commit/b3d112ae190b984cc1779b9e6de92218f22380c6)
outdated: Don't show headings if there's nothing to output
([@isaacs](https://github.com/isaacs))
* [`bb4b90c`](https://github.com/npm/npm/commit/bb4b90c80dbf906a1cb26d85bc0625dc2758acc3)
outdated: Default to `latest` rather than `*` for unspecified deps
([@isaacs](https://github.com/isaacs))
### v1.4.20 (2014-07-02):
* [`0353dde`](https://github.com/npm/npm/commit/0353ddeaca8171aa7dbdd8102b7e2eb581a86406)
respect `--json` for output ([@isaacs](https://github.com/isaacs))
* [`b3d112a`](https://github.com/npm/npm/commit/b3d112ae190b984cc1779b9e6de92218f22380c6)
outdated: Don't show headings if there's nothing to output
([@isaacs](https://github.com/isaacs))
* [`bb4b90c`](https://github.com/npm/npm/commit/bb4b90c80dbf906a1cb26d85bc0625dc2758acc3)
outdated: Default to `latest` rather than `*` for unspecified deps
([@isaacs](https://github.com/isaacs))
### v1.5.0-alpha-1 (2014-07-01):
* [`eef4884`](https://github.com/npm/npm/commit/eef4884d6487ee029813e60a5f9c54e67925d9fa)
use the correct piece of the spec for GitHub shortcuts
([@othiym23](https://github.com/othiym23))
### v1.5.0-alpha-0 (2014-07-01):
* [`7f55057`](https://github.com/npm/npm/commit/7f55057807cfdd9ceaf6331968e666424f48116c)
install scoped packages ([#5239](https://github.com/npm/npm/issues/5239))
([@othiym23](https://github.com/othiym23))
* [`0df7e16`](https://github.com/npm/npm/commit/0df7e16c0232d8f4d036ebf4ec3563215517caac)
publish scoped packages ([#5239](https://github.com/npm/npm/issues/5239))
([@othiym23](https://github.com/othiym23))
* [`0689ba2`](https://github.com/npm/npm/commit/0689ba249b92b4c6279a26804c96af6f92b3a501)
support (and save) --scope=@s config
([@othiym23](https://github.com/othiym23))
* [`f34878f`](https://github.com/npm/npm/commit/f34878fc4cee29901e4daf7bace94be01e25cad7)
scope credentials to registry ([@othiym23](https://github.com/othiym23))
* [`0ac7ca2`](https://github.com/npm/npm/commit/0ac7ca233f7a69751fe4386af6c4daa3ee9fc0da)
capture and store bearer tokens when sent by registry
([@othiym23](https://github.com/othiym23))
* [`63c3277`](https://github.com/npm/npm/commit/63c3277f089b2c4417e922826bdc313ac854cad6)
only delete files that are created by npm
([@othiym23](https://github.com/othiym23))
* [`4f54043`](https://github.com/npm/npm/commit/4f540437091d1cbca3915cd20c2da83c2a88bb8e)
`npm-package-arg@2.0.0` ([@othiym23](https://github.com/othiym23))
* [`9e1460e`](https://github.com/npm/npm/commit/9e1460e6ac9433019758481ec031358f4af4cd44)
`read-package-json@1.2.3` ([@othiym23](https://github.com/othiym23))
* [`719d8ad`](https://github.com/npm/npm/commit/719d8adb9082401f905ff4207ede494661f8a554)
`fs-vacuum@1.2.1` ([@othiym23](https://github.com/othiym23))
* [`9ef8fe4`](https://github.com/npm/npm/commit/9ef8fe4d6ead3acb3e88c712000e2d3a9480ebec)
`async-some@1.0.0` ([@othiym23](https://github.com/othiym23))
* [`a964f65`](https://github.com/npm/npm/commit/a964f65ab662107b62a4ca58535ce817e8cca331)
`npmconf@2.0.1` ([@othiym23](https://github.com/othiym23))
* [`113765b`](https://github.com/npm/npm/commit/113765bfb7d3801917c1d9f124b8b3d942bec89a)
`npm-registry-client@3.0.0` ([@othiym23](https://github.com/othiym23))
### v1.4.19 (2014-07-01):
* [`f687433`](https://github.com/npm/npm/commit/f687433) relative URLS for
working non-root registry URLS ([@othiym23](https://github.com/othiym23))
* [`bea190c`](https://github.com/npm/npm/commit/bea190c)
[#5591](https://github.com/npm/npm/issues/5591) bump nopt and npmconf
([@isaacs](https://github.com/isaacs))
### v1.4.18 (2014-06-29):
* Bump glob dependency from 4.0.2 to 4.0.3. It now uses graceful-fs when
available, increasing resilience to [various filesystem
errors](https://github.com/isaacs/node-graceful-fs#improvements-over-fs-module).
([@isaacs](https://github.com/isaacs))
### v1.4.17 (2014-06-27):
* replace escape codes with ansicolors
([@othiym23](https://github.com/othiym23))
* Allow to build all the docs OOTB. ([@GeJ](https://github.com/GeJ))
* Use core.longpaths on win32 git - fixes
[#5525](https://github.com/npm/npm/issues/5525) (Bradley Meck)
* `npmconf@1.1.2` ([@isaacs](https://github.com/isaacs))
* Consolidate color sniffing in config/log loading process
([@isaacs](https://github.com/isaacs))
* add verbose log when project config file is ignored
([@isaacs](https://github.com/isaacs))
* npmconf: Float patch to remove 'scope' from config defs
([@isaacs](https://github.com/isaacs))
* doc: npm-explore can't handle a version
([@robertkowalski](https://github.com/robertkowalski))
* Add user-friendly errors for ENOSPC and EROFS.
([@voodootikigod](https://github.com/voodootikigod))
* bump tar and fstream deps ([@isaacs](https://github.com/isaacs))
* Run the npm-registry-couchapp tests along with npm tests
([@isaacs](https://github.com/isaacs))
### v1.2.8000 (2014-06-17):
* Same as v1.4.16, but with the spinner disabled, and a version number that
starts with v1.2.
### v1.4.16 (2014-06-17):
* `npm-registry-client@2.0.2` ([@isaacs](https://github.com/isaacs))
* `fstream@0.1.27` ([@isaacs](https://github.com/isaacs))
* `sha@1.2.4` ([@isaacs](https://github.com/isaacs))
* `rimraf@2.2.8` ([@isaacs](https://github.com/isaacs))
* `npmlog@1.0.1` ([@isaacs](https://github.com/isaacs))
* `npm-registry-client@2.0.1` ([@isaacs](https://github.com/isaacs))
* removed redundant dependency ([@othiym23](https://github.com/othiym23))
* `npmconf@1.0.5` ([@isaacs](https://github.com/isaacs))
* Properly handle errors that can occur in the config-loading process
([@isaacs](https://github.com/isaacs))
### v1.4.15 (2014-06-10):
* cache: atomic de-race-ified package.json writing
([@isaacs](https://github.com/isaacs))
* `fstream@0.1.26` ([@isaacs](https://github.com/isaacs))
* `graceful-fs@3.0.2` ([@isaacs](https://github.com/isaacs))
* `osenv@0.1.0` ([@isaacs](https://github.com/isaacs))
* Only spin the spinner when we're fetching stuff
([@isaacs](https://github.com/isaacs))
* Update `osenv@0.1.0` which removes ~/tmp as possible tmp-folder
([@robertkowalski](https://github.com/robertkowalski))
* `ini@1.2.1` ([@isaacs](https://github.com/isaacs))
* `graceful-fs@3` ([@isaacs](https://github.com/isaacs))
* Update glob and things depending on glob
([@isaacs](https://github.com/isaacs))
* github-url-from-username-repo and read-package-json updates
([@isaacs](https://github.com/isaacs))
* `editor@0.1.0` ([@isaacs](https://github.com/isaacs))
* `columnify@1.1.0` ([@isaacs](https://github.com/isaacs))
* bump ansi and associated deps ([@isaacs](https://github.com/isaacs))
### v1.4.14 (2014-06-05):
* char-spinner: update to not bork windows
([@isaacs](https://github.com/isaacs))
### v1.4.13 (2014-05-23):
* Fix `npm install` on a tarball.
([`ed3abf1`](https://github.com/npm/npm/commit/ed3abf1aa10000f0f687330e976d78d1955557f6),
[#5330](https://github.com/npm/npm/issues/5330),
[@othiym23](https://github.com/othiym23))
* Fix an issue with the spinner on Node 0.8.
([`9f00306`](https://github.com/npm/npm/commit/9f003067909440390198c0b8f92560d84da37762),
[@isaacs](https://github.com/isaacs))
* Re-add `npm.commands.cache.clean` and `npm.commands.cache.read` APIs, and
document `npm.commands.cache.*` as npm-cache(3).
([`e06799e`](https://github.com/npm/npm/commit/e06799e77e60c1fc51869619083a25e074d368b3),
[@isaacs](https://github.com/isaacs))
### v1.4.12 (2014-05-23):
* remove normalize-package-data from top level, de-^-ify inflight dep
([@isaacs](https://github.com/isaacs))
* Always sort saved bundleDependencies ([@isaacs](https://github.com/isaacs))
* add inflight to bundledDependencies
([@othiym23](https://github.com/othiym23))
### v1.4.11 (2014-05-22):
* fix `npm ls` labeling issue
* `node-gyp@0.13.1`
* default repository to https:// instead of git://
* addLocalTarball: Remove extraneous unpack
([@isaacs](https://github.com/isaacs))
* Massive cache folder refactor ([@othiym23](https://github.com/othiym23) and
[@isaacs](https://github.com/isaacs))
* Busy Spinner, no http noise ([@isaacs](https://github.com/isaacs))
* Per-project .npmrc file support ([@isaacs](https://github.com/isaacs))
* `npmconf@1.0.0`, Refactor config/uid/prefix loading process
([@isaacs](https://github.com/isaacs))
* Allow once-disallowed characters in passwords
([@isaacs](https://github.com/isaacs))
* Send npm version as 'version' header ([@isaacs](https://github.com/isaacs))
* fix cygwin encoding issue (Karsten Tinnefeld)
* Allow non-github repositories with `npm repo`
([@evanlucas](https://github.com/evanlucas))
* Allow peer deps to be satisfied by grandparent
* Stop optional deps moving into deps on `update --save`
([@timoxley](https://github.com/timoxley))
* Ensure only matching deps update with `update --save*`
([@timoxley](https://github.com/timoxley))
* Add support for `prerelease`, `preminor`, `prepatch` to `npm version`
### v1.4.10 (2014-05-05):
* Don't set referer if already set
* fetch: Send referer and npm-session headers
* `run-script`: Support `--parseable` and `--json`
* list runnable scripts ([@evanlucas](https://github.com/evanlucas))
* Use marked instead of ronn for html docs
### v1.4.9 (2014-05-01):
* Send referer header (with any potentially private stuff redacted)
* Fix critical typo bug in previous npm release
### v1.4.8 (2014-05-01):
* Check SHA before using files from cache
* adduser: allow change of the saved password
* Make `npm install` respect `config.unicode`
* Fix lifecycle to pass `Infinity` for config env value
* Don't return 0 exit code on invalid command
* cache: Handle 404s and other HTTP errors as errors
* Resolve ~ in path configs to env.HOME
* Include npm version in default user-agent conf
* npm init: Use ISC as default license, use save-prefix for deps
* Many test and doc fixes
### v1.4.7 (2014-04-15):
* Add `--save-prefix` option that can be used to override the default of `^`
when using `npm install --save` and its counterparts.
([`64eefdf`](https://github.com/npm/npm/commit/64eefdfe26bb27db8dc90e3ab5d27a5ef18a4470),
[@thlorenz](https://github.com/thlorenz))
* Allow `--silent` to silence the echoing of commands that occurs with `npm
run`.
([`c95cf08`](https://github.com/npm/npm/commit/c95cf086e5b97dbb48ff95a72517b203a8f29eab),
[@Raynos](https://github.com/Raynos))
* Some speed improvements to the cache, which should improve install times.
([`cb94310`](https://github.com/npm/npm/commit/cb94310a6adb18cb7b881eacb8d67171eda8b744),
[`3b0870f`](https://github.com/npm/npm/commit/3b0870fb2f40358b3051abdab6be4319d196b99d),
[`120f5a9`](https://github.com/npm/npm/commit/120f5a93437bbbea9249801574a2f33e44e81c33),
[@isaacs](https://github.com/isaacs))
* Improve ability to retry registry requests when a subset of the registry
servers are down.
([`4a5257d`](https://github.com/npm/npm/commit/4a5257de3870ac3dafa39667379f19f6dcd6093e),
https://github.com/npm/npm-registry-client/commit/7686d02cb0b844626d6a401e58c0755ef3bc8432,
[@isaacs](https://github.com/isaacs))
* Fix marking of peer dependencies as extraneous.
([`779b164`](https://github.com/npm/npm/commit/779b1649764607b062c031c7e5c972151b4a1754),
https://github.com/npm/read-installed/commit/6680ba6ef235b1ca3273a00b70869798ad662ddc,
[@isaacs](https://github.com/isaacs))
* Fix npm crashing when doing `npm shrinkwrap` in the presence of a
`package.json` with no dependencies.
([`a9d9fa5`](https://github.com/npm/npm/commit/a9d9fa5ad3b8c925a589422b7be28d2735f320b0),
[@kislyuk](https://github.com/kislyuk))
* Fix error when using `npm view` on packages that have no versions or have
been unpublished.
([`94df2f5`](https://github.com/npm/npm/commit/94df2f56d684b35d1df043660180fc321b743dc8),
[@juliangruber](https://github.com/juliangruber);
[`2241a09`](https://github.com/npm/npm/commit/2241a09c843669c70633c399ce698cec3add40b3),
[@isaacs](https://github.com/isaacs))
### v1.4.6 (2014-03-19):
* Fix extraneous package detection to work in more cases.
([`f671286`](https://github.com/npm/npm/commit/f671286), npm/read-installed#20,
[@LaurentVB](https://github.com/LaurentVB))
### v1.4.5 (2014-03-18):
* Sort dependencies in `package.json` when doing `npm install --save` and all
its variants.
([`6fd6ff7`](https://github.com/npm/npm/commit/6fd6ff7e536ea6acd33037b1878d4eca1f931985),
[@domenic](https://github.com/domenic))
* Add `--save-exact` option, usable alongside `--save` and its variants, which
will write the exact version number into `package.json` instead of the
appropriate semver-compatibility range.
([`17f07df`](https://github.com/npm/npm/commit/17f07df8ad8e594304c2445bf7489cb53346f2c5),
[@timoxley](https://github.com/timoxley))
* Accept gzipped content from the registry to speed up downloads and save
bandwidth.
([`a3762de`](https://github.com/npm/npm/commit/a3762de843b842be8fa0ab57cdcd6b164f145942),
npm/npm-registry-client#40, [@fengmk2](https://github.com/fengmk2))
* Fix `npm ls`'s `--depth` and `--log` options.
([`1d29b17`](https://github.com/npm/npm/commit/1d29b17f5193d52a5c4faa412a95313dcf41ed91),
npm/read-installed#13, [@zertosh](https://github.com/zertosh))
* Fix "Adding a cache directory to the cache will make the world implode" in
certain cases.
([`9a4b2c4`](https://github.com/npm/npm/commit/9a4b2c4667c2b1e0054e3d5611ab86acb1760834),
domenic/path-is-inside#1, [@pmarques](https://github.com/pmarques))
* Fix readmes not being uploaded in certain rare cases.
([`527b72c`](https://github.com/npm/npm/commit/527b72cca6c55762b51e592c48a9f28cc7e2ff8b),
[@isaacs](https://github.com/isaacs))
### v1.4.4 (2014-02-20):
* Add `npm t` as an alias for `npm test` (which is itself an alias for `npm run
test`, or even `npm run-script test`). We like making running your tests
easy. ([`14e650b`](https://github.com/npm/npm/commit/14e650bce0bfebba10094c961ac104a61417a5de), [@isaacs](https://github.com/isaacs))
### v1.4.3 (2014-02-16):
* Add back `npm prune --production`, which was removed in 1.3.24.
([`acc4d02`](https://github.com/npm/npm/commit/acc4d023c57d07704b20a0955e4bf10ee91bdc83),
[@davglass](https://github.com/davglass))
* Default `npm install --save` and its counterparts to use the `^` version
specifier, instead of `~`.
([`0a3151c`](https://github.com/npm/npm/commit/0a3151c9cbeb50c1c65895685c2eabdc7e2608dc),
[@mikolalysenko](https://github.com/mikolalysenko))
* Make `npm shrinkwrap` output dependencies in a sorted order, so that diffs
between shrinkwrap files should be saner now.
([`059b2bf`](https://github.com/npm/npm/commit/059b2bfd06ae775205a37257dca80142596a0113),
[@Raynos](https://github.com/Raynos))
* Fix `npm dedupe` not correctly respecting dependency constraints.
([`86028e9`](https://github.com/npm/npm/commit/86028e9fd8524d5e520ce01ba2ebab5a030103fc),
[@rafeca](https://github.com/rafeca))
* Fix `npm ls` giving spurious warnings when you used `"latest"` as a version
specifier.
(https://github.com/npm/read-installed/commit/d2956400e0386931c926e0f30c334840e0938f14,
[@bajtos](https://github.com/bajtos))
* Fixed a bug where using `npm link` on packages without a `name` value could
cause npm to delete itself.
([`401a642`](https://github.com/npm/npm/commit/401a64286aa6665a94d1d2f13604f7014c5fce87),
[@isaacs](https://github.com/isaacs))
* Fixed `npm install ./pkg@1.2.3` to actually install the directory at
`pkg@1.2.3`; before it would try to find version `1.2.3` of the package
`./pkg` in the npm registry.
([`46d8768`](https://github.com/npm/npm/commit/46d876821d1dd94c050d5ebc86444bed12c56739),
[@rlidwka](https://github.com/rlidwka); see also
[`f851b79`](https://github.com/npm/npm/commit/f851b79a71d9a5f5125aa85877c94faaf91bea5f))
* Fix `npm outdated` to respect the `color` configuration option.
([`d4f6f3f`](https://github.com/npm/npm/commit/d4f6f3ff83bd14fb60d3ac6392cb8eb6b1c55ce1),
[@timoxley](https://github.com/timoxley))
* Fix `npm outdated --parseable`.
([`9575a23`](https://github.com/npm/npm/commit/9575a23f955ce3e75b509c89504ef0bd707c8cf6),
[@yhpark](https://github.com/yhpark))
* Fix a lockfile-related errors when using certain Git URLs.
([`164b97e`](https://github.com/npm/npm/commit/164b97e6089f64e686db7a9a24016f245effc37f),
[@nigelzor](https://github.com/nigelzor))
### v1.4.2 (2014-02-13):
* Fixed an issue related to mid-publish GET requests made against the registry.
(https://github.com/npm/npm-registry-client/commit/acbec48372bc1816c67c9e7cbf814cf50437ff93,
[@isaacs](https://github.com/isaacs))
### v1.4.1 (2014-02-13):
* Fix `npm shrinkwrap` forgetting to shrinkwrap dependencies that were also
development dependencies.
([`9c575c5`](https://github.com/npm/npm/commit/9c575c56efa9b0c8b0d4a17cb9c1de3833004bcd),
[@diwu1989](https://github.com/diwu1989))
* Fixed publishing of pre-existing packages with uppercase characters in their
name.
(https://github.com/npm/npm-registry-client/commit/9345d3b6c3d8510dd5c4418f27ee1fce59acebad,
[@isaacs](https://github.com/isaacs))
### v1.4.0 (2014-02-12):
* Remove `npm publish --force`. See
https://github.com/npm/npmjs.org/issues/148.
([@isaacs](https://github.com/isaacs),
npm/npm-registry-client@2c8dba990de6a59af6545b75cc00a6dc12777c2a)
* Other changes to the registry client related to saved configs and couch
logins. ([@isaacs](https://github.com/isaacs);
npm/npm-registry-client@25e2b019a1588155e5f87d035c27e79963b75951,
npm/npm-registry-client@9e41e9101b68036e0f078398785f618575f3cdde,
npm/npm-registry-client@2c8dba990de6a59af6545b75cc00a6dc12777c2a)
* Show an error to the user when doing `npm update` and the `package.json`
specifies a version that does not exist.
([@evanlucas](https://github.com/evanlucas),
[`027a33a`](https://github.com/npm/npm/commit/027a33a5c594124cc1d82ddec5aee2c18bc8dc32))
* Fix some issues with cache ownership in certain installation configurations.
([@outcoldman](https://github.com/outcoldman),
[`a132690`](https://github.com/npm/npm/commit/a132690a2876cda5dcd1e4ca751f21dfcb11cb9e))
* Fix issues where GitHub shorthand dependencies `user/repo` were not always
treated the same as full Git URLs.
([@robertkowalski](https://github.com/robertkowalski),
https://github.com/meryn/normalize-package-data/commit/005d0b637aec1895117fcb4e3b49185eebf9e240)
### v1.3.26 (2014-02-02):
* Fixes and updates to publishing code
([`735427a`](https://github.com/npm/npm/commit/735427a69ba4fe92aafa2d88f202aaa42920a9e2)
and
[`c0ac832`](https://github.com/npm/npm/commit/c0ac83224d49aa62e55577f8f27d53bbfd640dc5),
[@isaacs](https://github.com/isaacs))
* Fix `npm bugs` with no arguments.
([`b99d465`](https://github.com/npm/npm/commit/b99d465221ac03bca30976cbf4d62ca80ab34091),
[@Hoops](https://github.com/Hoops))
### v1.3.25 (2014-01-25):
* Remove gubblebum blocky font from documentation headers.
([`6940c9a`](https://github.com/npm/npm/commit/6940c9a100160056dc6be8f54a7ad7fa8ceda7e2),
[@isaacs](https://github.com/isaacs))
### v1.3.24 (2014-01-19):
* Make the search output prettier, with nice truncated columns, and a `--long`
option to create wrapping columns.
([`20439b2`](https://github.com/npm/npm/commit/20439b2) and
[`3a6942d`](https://github.com/npm/npm/commit/3a6942d),
[@timoxley](https://github.com/timoxley))
* Support multiple packagenames in `npm docs`.
([`823010b`](https://github.com/npm/npm/commit/823010b),
[@timoxley](https://github.com/timoxley))
* Fix the `npm adduser` bug regarding "Error: default value must be string or
number" again. ([`b9b4248`](https://github.com/npm/npm/commit/b9b4248),
[@isaacs](https://github.com/isaacs))
* Fix `scripts` entries containing whitespaces on Windows.
([`80282ed`](https://github.com/npm/npm/commit/80282ed),
[@robertkowalski](https://github.com/robertkowalski))
* Fix `npm update` for Git URLs that have credentials in them
([`93fc364`](https://github.com/npm/npm/commit/93fc364),
[@danielsantiago](https://github.com/danielsantiago))
* Fix `npm install` overwriting `npm link`-ed dependencies when they are tagged
Git dependencies. ([`af9bbd9`](https://github.com/npm/npm/commit/af9bbd9),
[@evanlucas](https://github.com/evanlucas))
* Remove `npm prune --production` since it buggily removed some dependencies
that were necessary for production; see
[#4509](https://github.com/npm/npm/issues/4509). Hopefully it can make its
triumphant return, one day.
([`1101b6a`](https://github.com/npm/npm/commit/1101b6a),
[@isaacs](https://github.com/isaacs))
Dependency updates:
* [`909cccf`](https://github.com/npm/npm/commit/909cccf) `read-package-json@1.1.6`
* [`a3891b6`](https://github.com/npm/npm/commit/a3891b6) `rimraf@2.2.6`
* [`ac6efbc`](https://github.com/npm/npm/commit/ac6efbc) `sha@1.2.3`
* [`dd30038`](https://github.com/npm/npm/commit/dd30038) `node-gyp@0.12.2`
* [`c8c3ebe`](https://github.com/npm/npm/commit/c8c3ebe) `npm-registry-client@0.3.3`
* [`4315286`](https://github.com/npm/npm/commit/4315286) `npmconf@0.1.12`
### v1.3.23 (2014-01-03):
* Properly handle installations that contained a certain class of circular
dependencies.
([`5dc93e8`](https://github.com/npm/npm/commit/5dc93e8c82604c45b6067b1acf1c768e0bfce754),
[@substack](https://github.com/substack))
### v1.3.22 (2013-12-25):
* Fix a critical bug in `npm adduser` that would manifest in the error message
"Error: default value must be string or number."
([`fba4bd2`](https://github.com/npm/npm/commit/fba4bd24bc2ab00ccfeda2043aa53af7d75ef7ce),
[@isaacs](https://github.com/isaacs))
* Allow `npm bugs` in the current directory to open the current package's bugs
URL.
([`d04cf64`](https://github.com/npm/npm/commit/d04cf6483932c693452f3f778c2fa90f6153a4af),
[@evanlucas](https://github.com/evanlucas))
* Several fixes to various error messages to include more useful or updated
information.
([`1e6f2a7`](https://github.com/npm/npm/commit/1e6f2a72ca058335f9f5e7ca22d01e1a8bb0f9f7),
[`ff46366`](https://github.com/npm/npm/commit/ff46366bd40ff0ef33c7bac8400bc912c56201d1),
[`8b4bb48`](https://github.com/npm/npm/commit/8b4bb4815d80a3612186dc5549d698e7b988eb03);
[@rlidwka](https://github.com/rlidwka),
[@evanlucas](https://github.com/evanlucas))
### v1.3.21 (2013-12-17):
* Fix a critical bug that prevented publishing due to incorrect hash
calculation.
([`4ca4a2c`](https://github.com/npm/npm-registry-client/commit/4ca4a2c6333144299428be6b572e2691aa59852e),
[@dominictarr](https://github.com/dominictarr))
### v1.3.20 (2013-12-17):
* Fixes a critical bug in v1.3.19. Thankfully, due to that bug, no one could
install npm v1.3.19 :)
### v1.3.19 (2013-12-16):
* Adds atomic PUTs for publishing packages, which should result in far fewer
requests and less room for replication errors on the server-side.
### v1.3.18 (2013-12-16):
* Added an `--ignore-scripts` option, which will prevent `package.json` scripts
from being run. Most notably, this will work on `npm install`, so e.g. `npm
install --ignore-scripts` will not run preinstall and prepublish scripts.
([`d7e67bf`](https://github.com/npm/npm/commit/d7e67bf0d94b085652ec1c87d595afa6f650a8f6),
[@sqs](https://github.com/sqs))
* Fixed a bug introduced in 1.3.16 that would manifest with certain cache
configurations, by causing spurious errors saying "Adding a cache directory
to the cache will make the world implode."
([`966373f`](https://github.com/npm/npm/commit/966373fad8d741637f9744882bde9f6e94000865),
[@domenic](https://github.com/domenic))
* Re-fixed the multiple download of URL dependencies, whose fix was reverted in
1.3.17.
([`a362c3f`](https://github.com/npm/npm/commit/a362c3f1919987419ed8a37c8defa19d2e6697b0),
[@spmason](https://github.com/spmason))
### v1.3.17 (2013-12-11):
* This release reverts
[`644c2ff`](https://github.com/npm/npm/commit/644c2ff3e3d9c93764f7045762477f48864d64a7),
which avoided re-downloading URL and shinkwrap dependencies when doing `npm
install`. You can see the in-depth reasoning in
[`d8c907e`](https://github.com/npm/npm/commit/d8c907edc2019b75cff0f53467e34e0ffd7e5fba);
the problem was, that the patch changed the behavior of `npm install -f` to
reinstall all dependencies.
* A new version of the no-re-downloading fix has been submitted as
[#4303](https://github.com/npm/npm/issues/4303) and will hopefully be
included in the next release.
### v1.3.16 (2013-12-11):
* Git URL dependencies are now updated on `npm install`, fixing a two-year old
bug
([`5829ecf`](https://github.com/npm/npm/commit/5829ecf032b392d2133bd351f53d3c644961396b),
[@robertkowalski](https://github.com/robertkowalski)). Additional progress on
reducing the resulting Git-related I/O is tracked as
[#4191](https://github.com/npm/npm/issues/4191), but for now, this will be a
big improvement.
* Added a `--json` mode to `npm outdated` to give a parseable output.
([`0b6c9b7`](https://github.com/npm/npm/commit/0b6c9b7c8c5579f4d7d37a0c24d9b7a12ccbe5fe),
[@yyx990803](https://github.com/yyx990803))
* Made `npm outdated` much prettier and more useful. It now outputs a
color-coded and easy-to-read table.
([`fd3017f`](https://github.com/npm/npm/commit/fd3017fc3e9d42acf6394a5285122edb4dc16106),
[@quimcalpe](https://github.com/quimcalpe))
* Added the `--depth` option to `npm outdated`, so that e.g. you can do `npm
outdated --depth=0` to show only top-level outdated dependencies.
([`1d184ef`](https://github.com/npm/npm/commit/1d184ef3f4b4bc309d38e9128732e3e6fb46d49c),
[@yyx990803](https://github.com/yyx990803))
* Added a `--no-git-tag-version` option to `npm version`, for doing the usual
job of `npm version` minus the Git tagging. This could be useful if you need
to increase the version in other related files before actually adding the
tag.
([`59ca984`](https://github.com/npm/npm/commit/59ca9841ba4f4b2f11b8e72533f385c77ae9f8bd),
[@evanlucas](https://github.com/evanlucas))
* Made `npm repo` and `npm docs` work without any arguments, adding them to the
list of npm commands that work on the package in the current directory when
invoked without arguments.
([`bf9048e`](https://github.com/npm/npm/commit/bf9048e2fa16d43fbc4b328d162b0a194ca484e8),
[@robertkowalski](https://github.com/robertkowalski);
[`07600d0`](https://github.com/npm/npm/commit/07600d006c652507cb04ac0dae9780e35073dd67),
[@wilmoore](https://github.com/wilmoore)). There are a few other commands we
still want to implement this for; see
[#4204](https://github.com/npm/npm/issues/4204).
* Pass through the `GIT_SSL_NO_VERIFY` environment variable to Git, if it is
set; we currently do this with a few other environment variables, but we
missed that one.
([`c625de9`](https://github.com/npm/npm/commit/c625de91770df24c189c77d2e4bc821f2265efa8),
[@arikon](https://github.com/arikon))
* Fixed `npm dedupe` on Windows due to incorrect path separators being used
([`7677de4`](https://github.com/npm/npm/commit/7677de4583100bc39407093ecc6bc13715bf8161),
[@mcolyer](https://github.com/mcolyer)).
* Fixed the `npm help` command when multiple words were searched for; it
previously gave a `ReferenceError`.
([`6a28dd1`](https://github.com/npm/npm/commit/6a28dd147c6957a93db12b1081c6e0da44fe5e3c),
[@dereckson](https://github.com/dereckson))
* Stopped re-downloading URL and shrinkwrap dependencies, as demonstrated in
[#3463](https://github.com/npm/npm/issues/3463)
([`644c2ff`](https://github.com/isaacs/npm/commit/644c2ff3e3d9c93764f7045762477f48864d64a7),
[@spmason](https://github.com/spmason)). You can use the `--force` option to
force re-download and installation of all dependencies.

9
deps/npm/CONTRIBUTING.md vendored Normal file
View File

@@ -0,0 +1,9 @@
## Before you submit a new issue
* Check if there's a simple solution in the
[Troubleshooting](https://github.com/npm/npm/wiki/Troubleshooting)
wiki.
* [Search for similar
issues](https://github.com/npm/npm/search?q=Similar%20issues&type=Issues).
* Ensure your new issue conforms to the [Contributing
Guidelines](https://github.com/npm/npm/wiki/Contributing-Guidelines).

294
deps/npm/LICENSE vendored
View File

@@ -1,52 +1,256 @@
Copyright (c) Isaac Z. Schlueter (the "Original Author")
Copyright (c) npm, Inc. and Contributors
All rights reserved.
MIT +no-false-attribs License
npm is released under the Artistic License 2.0, subject to additional terms
that are listed below.
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.
Distributions of all or part of the Software intended to be used
by the recipients as they would use the unmodified Software,
containing modifications that substantially alter, remove, or
disable functionality of the Software, outside of the documented
configuration mechanisms provided by the Software, shall be
modified such that the Original Author's bug reporting email
addresses and urls are either replaced with the contact information
of the parties responsible for the changes, or removed entirely.
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.
The text of the npm License follows and the text of the additional terms
follows the Artistic License 2.0 terms:
Except where noted, this license applies to any and all software
programs and associated documentation files created by the
Original Author, when distributed with the Software.
--------
"Node.js" and "node" trademark Joyent, Inc. npm is not officially
part of the Node.js project, and is neither owned by nor
officially affiliated with Joyent, Inc.
Packages published in the npm registry (other than the Software and
its included dependencies) are not part of npm itself, are the sole
property of their respective maintainers, and are not covered by
The Artistic License 2.0
Copyright (c) 2000-2006, The Perl Foundation.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
This license establishes the terms under which a given free software
Package may be copied, modified, distributed, and/or redistributed.
The intent is that the Copyright Holder maintains some artistic
control over the development of that Package while still keeping the
Package available as open source and free software.
You are always permitted to make arrangements wholly outside of this
license directly with the Copyright Holder of a given Package. If the
terms of this license do not permit the full use that you propose to
make of the Package, you should contact the Copyright Holder and seek
a different licensing arrangement.
Definitions
"Copyright Holder" means the individual(s) or organization(s)
named in the copyright notice for the entire Package.
"Contributor" means any party that has contributed code or other
material to the Package, in accordance with the Copyright Holder's
procedures.
"You" and "your" means any person who would like to copy,
distribute, or modify the Package.
"Package" means the collection of files distributed by the
Copyright Holder, and derivatives of that collection and/or of
those files. A given Package may consist of either the Standard
Version, or a Modified Version.
"Distribute" means providing a copy of the Package or making it
accessible to anyone else, or in the case of a company or
organization, to others outside of your company or organization.
"Distributor Fee" means any fee that you charge for Distributing
this Package or providing support for this Package to another
party. It does not mean licensing fees.
"Standard Version" refers to the Package if it has not been
modified, or has been modified only in ways explicitly requested
by the Copyright Holder.
"Modified Version" means the Package, if it has been changed, and
such changes were not explicitly requested by the Copyright
Holder.
"Original License" means this Artistic License as Distributed with
the Standard Version of the Package, in its current version or as
it may be modified by The Perl Foundation in the future.
"Source" form means the source code, documentation source, and
configuration files for the Package.
"Compiled" form means the compiled bytecode, object code, binary,
or any other form resulting from mechanical transformation or
translation of the Source form.
Permission for Use and Modification Without Distribution
(1) You are permitted to use the Standard Version and create and use
Modified Versions for any purpose without restriction, provided that
you do not Distribute the Modified Version.
Permissions for Redistribution of the Standard Version
(2) You may Distribute verbatim copies of the Source form of the
Standard Version of this Package in any medium without restriction,
either gratis or for a Distributor Fee, provided that you duplicate
all of the original copyright notices and associated disclaimers. At
your discretion, such verbatim copies may or may not include a
Compiled form of the Package.
(3) You may apply any bug fixes, portability changes, and other
modifications made available from the Copyright Holder. The resulting
Package will still be considered the Standard Version, and as such
will be subject to the Original License.
Distribution of Modified Versions of the Package as Source
(4) You may Distribute your Modified Version as Source (either gratis
or for a Distributor Fee, and with or without a Compiled form of the
Modified Version) provided that you clearly document how it differs
from the Standard Version, including, but not limited to, documenting
any non-standard features, executables, or modules, and provided that
you do at least ONE of the following:
(a) make the Modified Version available to the Copyright Holder
of the Standard Version, under the Original License, so that the
Copyright Holder may include your modifications in the Standard
Version.
(b) ensure that installation of your Modified Version does not
prevent the user installing or running the Standard Version. In
addition, the Modified Version must bear a name that is different
from the name of the Standard Version.
(c) allow anyone who receives a copy of the Modified Version to
make the Source form of the Modified Version available to others
under
(i) the Original License or
(ii) a license that permits the licensee to freely copy,
modify and redistribute the Modified Version using the same
licensing terms that apply to the copy that the licensee
received, and requires that the Source form of the Modified
Version, and of any works derived from it, be made freely
available in that license fees are prohibited but Distributor
Fees are allowed.
Distribution of Compiled Forms of the Standard Version
or Modified Versions without the Source
(5) You may Distribute Compiled forms of the Standard Version without
the Source, provided that you include complete instructions on how to
get the Source of the Standard Version. Such instructions must be
valid at the time of your distribution. If these instructions, at any
time while you are carrying out such distribution, become invalid, you
must provide new instructions on demand or cease further distribution.
If you provide valid instructions or cease distribution within thirty
days after you become aware that the instructions are invalid, then
you do not forfeit any of your rights under this license.
(6) You may Distribute a Modified Version in Compiled form without
the Source, provided that you comply with Section 4 with respect to
the Source of the Modified Version.
Aggregating or Linking the Package
(7) You may aggregate the Package (either the Standard Version or
Modified Version) with other packages and Distribute the resulting
aggregation provided that you do not charge a licensing fee for the
Package. Distributor Fees are permitted, and licensing fees for other
components in the aggregation are permitted. The terms of this license
apply to the use and Distribution of the Standard or Modified Versions
as included in the aggregation.
(8) You are permitted to link Modified and Standard Versions with
other works, to embed the Package in a larger work of your own, or to
build stand-alone binary or bytecode versions of applications that
include the Package, and Distribute the result without restriction,
provided the result does not expose a direct interface to the Package.
Items That are Not Considered Part of a Modified Version
(9) Works (including, but not limited to, modules and scripts) that
merely extend or make use of the Package, do not, by themselves, cause
the Package to be a Modified Version. In addition, such works are not
considered parts of the Package itself, and are not subject to the
terms of this license.
General Provisions
(10) Any use, modification, and distribution of the Standard or
Modified Versions is governed by this Artistic License. By using,
modifying or distributing the Package, you accept this license. Do not
use, modify, or distribute the Package, if you do not accept this
license.
(11) If your Modified Version has been derived from a Modified
Version made by someone other than you, you are nevertheless required
to ensure that your Modified Version complies with the requirements of
this license.
(12) This license does not grant you the right to use any trademark,
service mark, tradename, or logo of the Copyright Holder.
(13) This license includes the non-exclusive, worldwide,
free-of-charge patent license to make, have made, use, offer to sell,
sell, import and otherwise transfer the Package with respect to any
patent claims licensable by the Copyright Holder that are necessarily
infringed by the Package. If you institute patent litigation
(including a cross-claim or counterclaim) against any party alleging
that the Package constitutes direct or contributory patent
infringement, then this Artistic License to you shall terminate on the
date that such litigation is filed.
(14) Disclaimer of Warranty:
THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL
LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------
The following additional terms shall apply to use of the npm software, the npm
website, the npm repository and any other services or products offered by npm,
Inc.:
"Node.js" trademark Joyent, Inc. npm is not officially part of the Node.js
project, and is neither owned by nor affiliated with Joyent, Inc.
"npm" and "The npm Registry" are owned by npm, Inc. All rights reserved.
Modules published on the npm registry are not officially endorsed by npm, Inc.
or the Node.js project.
Data published to the npm registry is not part of npm itself, and is the sole
property of the publisher. While every effort is made to ensure accountability,
there is absolutely no guarantee, warrantee, or assertion expressed or implied
as to the quality, fitness for a specific purpose, or lack of malice in any
given npm package. Packages downloaded through the npm registry are
independently licensed and are not covered by this license.
Additional policies relating to, and restrictions on use of, npm products and
services are available on the npm website. All such policies and restrictions,
as updated from time to time, are hereby incorporated into this license
agreement. By using npm, you acknowledge your agreement to all such policies
and restrictions.
If you have a complaint about a package in the public npm registry, and cannot
resolve it with the package owner, please email support@npmjs.com and explain
the situation. See the [npm Dispute Resolution
policy](https://github.com/npm/policies/blob/master/disputes.md) for more
details.
Any data published to The npm Registry (including user account information) may
be removed or modified at the sole discretion of the npm server administrators.
"npm Logo" created by Mathias Pettersson and Brian Hammond,
used with permission.
@@ -55,11 +259,5 @@ Copyright (c) by Tjarda Koster, http://jelloween.deviantart.com
included for use in the npm website and documentation,
used with permission.
This program uses "request", Copyright (c) Mikeal Rogers,
according to the terms of the Apache license.
This program uses "mkdirp", Copyright (c) James Halliday,
according to the terms of the MIT/X11 license.
This program uses "opener", Copyright (c) Domenic Denicola,
according to the terms of the DWTFPL2 license.
This program uses several Node modules contained in the node_modules/
subdirectory, according to the terms of their respective licenses.

171
deps/npm/Makefile vendored
View File

@@ -1,31 +1,59 @@
# vim: set softtabstop=2 shiftwidth=2:
SHELL = bash
PUBLISHTAG = $(shell node scripts/publish-tag.js)
BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
markdowns = $(shell find doc -name '*.md' | grep -v 'index') README.md
html_docdeps = html/dochead.html \
html/docfoot.html \
scripts/doc-build.sh \
package.json
cli_mandocs = $(shell find doc/cli -name '*.md' \
|sed 's|.md|.1|g' \
|sed 's|doc/cli/|man/man1/|g' ) \
man/man1/README.1 \
man/man1/index.1
man/man1/npm-README.1
api_mandocs = $(shell find doc/api -name '*.md' \
|sed 's|.md|.3|g' \
|sed 's|doc/api/|man/man3/|g' )
files_mandocs = $(shell find doc/files -name '*.md' \
|sed 's|.md|.5|g' \
|sed 's|doc/files/|man/man5/|g' ) \
man/man5/npm-json.5 \
man/man5/npm-global.5
misc_mandocs = $(shell find doc/misc -name '*.md' \
|sed 's|.md|.7|g' \
|sed 's|doc/misc/|man/man7/|g' ) \
man/man7/npm-index.7
cli_htmldocs = $(shell find doc/cli -name '*.md' \
|grep -v 'index.md' \
|sed 's|.md|.html|g' \
|sed 's|doc/cli/|html/doc/|g' ) \
html/doc/README.html \
html/doc/index.html
|sed 's|doc/cli/|html/doc/cli/|g' ) \
html/doc/README.html
api_htmldocs = $(shell find doc/api -name '*.md' \
|sed 's|.md|.html|g' \
|sed 's|doc/api/|html/api/|g' )
|sed 's|doc/api/|html/doc/api/|g' )
mandocs = $(api_mandocs) $(cli_mandocs)
files_htmldocs = $(shell find doc/files -name '*.md' \
|sed 's|.md|.html|g' \
|sed 's|doc/files/|html/doc/files/|g' ) \
html/doc/files/npm-json.html \
html/doc/files/npm-global.html
htmldocs = $(api_htmldocs) $(cli_htmldocs)
misc_htmldocs = $(shell find doc/misc -name '*.md' \
|sed 's|.md|.html|g' \
|sed 's|doc/misc/|html/doc/misc/|g' ) \
html/doc/index.html
mandocs = $(api_mandocs) $(cli_mandocs) $(files_mandocs) $(misc_mandocs)
htmldocs = $(api_htmldocs) $(cli_htmldocs) $(files_htmldocs) $(misc_htmldocs)
all: doc
@@ -35,7 +63,7 @@ latest:
@echo "in this folder that you're looking at right now."
node cli.js install -g -f npm
install: all
install: docclean all
node cli.js install -g -f
# backwards compat
@@ -44,8 +72,8 @@ dev: install
link: uninstall
node cli.js link -f
clean: doc-clean uninstall
rm npmrc
clean: markedclean ronnclean doc-clean uninstall
rm -rf npmrc
node cli.js cache clean
uninstall:
@@ -53,22 +81,24 @@ uninstall:
doc: $(mandocs) $(htmldocs)
markedclean:
rm -rf node_modules/marked node_modules/.bin/marked .building_marked
ronnclean:
rm -rf node_modules/ronn node_modules/.bin/ronn .building_ronn
docclean: doc-clean
doc-clean:
rm -rf \
node_modules/ronn \
node_modules/.bin/ronn \
.building_ronn \
doc/cli/index.md \
doc/api/index.md \
$(api_mandocs) \
$(cli_mandocs) \
$(api_htmldocs) \
$(cli_htmldocs) \
&>/dev/null || true
.building_marked \
.building_ronn \
html/doc \
html/api \
man
# use `npm install ronn` for this to work.
man/man1/README.1: README.md scripts/doc-build.sh package.json
man/man1/npm-README.1: README.md scripts/doc-build.sh package.json
@[ -d man/man1 ] || mkdir -p man/man1
scripts/doc-build.sh $< $@
man/man1/%.1: doc/cli/%.md scripts/doc-build.sh package.json
@@ -79,61 +109,84 @@ man/man3/%.3: doc/api/%.md scripts/doc-build.sh package.json
@[ -d man/man3 ] || mkdir -p man/man3
scripts/doc-build.sh $< $@
html/doc/README.html: README.md html/dochead.html html/docfoot.html scripts/doc-build.sh package.json
man/man5/npm-json.5: man/man5/package.json.5
cp $< $@
man/man5/npm-global.5: man/man5/npm-folders.5
cp $< $@
man/man5/%.5: doc/files/%.md scripts/doc-build.sh package.json
@[ -d man/man5 ] || mkdir -p man/man5
scripts/doc-build.sh $< $@
html/doc/%.html: doc/cli/%.md html/dochead.html html/docfoot.html scripts/doc-build.sh package.json
scripts/doc-build.sh $< $@
html/api/%.html: doc/api/%.md html/dochead.html html/docfoot.html scripts/doc-build.sh package.json
scripts/doc-build.sh $< $@
doc/cli/index.md: $(markdowns) scripts/index-build.js scripts/doc-build.sh package.json
doc/misc/npm-index.md: scripts/index-build.js package.json
node scripts/index-build.js > $@
html/doc/index.html: doc/misc/npm-index.md $(html_docdeps)
@[ -d html/doc ] || mkdir -p html/doc
scripts/doc-build.sh $< $@
man/man7/%.7: doc/misc/%.md scripts/doc-build.sh package.json
@[ -d man/man7 ] || mkdir -p man/man7
scripts/doc-build.sh $< $@
html/doc/README.html: README.md $(html_docdeps)
@[ -d html/doc ] || mkdir -p html/doc
scripts/doc-build.sh $< $@
html/doc/cli/%.html: doc/cli/%.md $(html_docdeps)
@[ -d html/doc/cli ] || mkdir -p html/doc/cli
scripts/doc-build.sh $< $@
html/doc/api/%.html: doc/api/%.md $(html_docdeps)
@[ -d html/doc/api ] || mkdir -p html/doc/api
scripts/doc-build.sh $< $@
html/doc/files/npm-json.html: html/doc/files/package.json.html
cp $< $@
html/doc/files/npm-global.html: html/doc/files/npm-folders.html
cp $< $@
html/doc/files/%.html: doc/files/%.md $(html_docdeps)
@[ -d html/doc/files ] || mkdir -p html/doc/files
scripts/doc-build.sh $< $@
html/doc/misc/%.html: doc/misc/%.md $(html_docdeps)
@[ -d html/doc/misc ] || mkdir -p html/doc/misc
scripts/doc-build.sh $< $@
marked: node_modules/.bin/marked
node_modules/.bin/marked:
node cli.js install marked --no-global
ronn: node_modules/.bin/ronn
node_modules/.bin/ronn:
node cli.js install ronn
node cli.js install ronn --no-global
doc: man
man: $(cli_docs) $(api_docs)
test:
test: doc
node cli.js test
tag:
npm tag npm@$(PUBLISHTAG) latest
publish: link doc
@git push origin :v$(shell npm -v) 2>&1 || true
@npm unpublish npm@$(shell npm -v) 2>&1 || true
git clean -fd &&\
git push origin &&\
git push origin $(BRANCH) &&\
git push origin --tags &&\
npm publish &&\
npm tag npm@$(shell npm -v) $(shell npm -v | awk -F. '{print $$1 "." $$2}') &&\
make doc-publish &&\
make zip-publish
docpublish: doc-publish
doc-publish: doc
rsync -vazu --stats --no-implied-dirs --delete \
html/doc/ \
node@npmjs.org:/home/node/npm-www/doc
rsync -vazu --stats --no-implied-dirs --delete \
html/api/ \
node@npmjs.org:/home/node/npm-www/api
rsync -vazu --stats --no-implied-dirs --delete \
html/static/webfonts/ \
node@npmjs.org:/home/node/npm-www/static/webfonts
rsync -vazu --stats --no-implied-dirs --delete \
html/static/style.css \
node@npmjs.org:/home/node/npm-www/static/
zip-publish: release
scp release/* node@nodejs.org:dist/npm/
npm publish --tag=$(PUBLISHTAG)
release:
@bash scripts/release.sh
sandwich:
@[ $$(whoami) = "root" ] && (echo "ok"; echo "ham" > sandwich) || echo "make it yourself" && exit 13
@[ $$(whoami) = "root" ] && (echo "ok"; echo "ham" > sandwich) || (echo "make it yourself" && exit 13)
.PHONY: all latest install dev link doc clean uninstall test man doc-publish doc-clean docclean docpublish release zip-publish
.PHONY: all latest install dev link doc clean uninstall test man doc-clean docclean release

74
deps/npm/README.md vendored
View File

@@ -1,6 +1,6 @@
npm(1) -- node package manager
==============================
[![Build Status](https://img.shields.io/travis/npm/npm/master.svg)](https://travis-ci.org/npm/npm)
## SYNOPSIS
This is just enough info to get you up and running.
@@ -36,7 +36,11 @@ paths, etc.) then read on.
## Fancy Install (Unix)
There's a pretty robust install script at
<https://npmjs.org/install.sh>. You can download that and run it.
<https://www.npmjs.org/install.sh>. You can download that and run it.
Here's an example using curl:
curl -L https://npmjs.org/install.sh | sh
### Slightly Fancier
@@ -169,59 +173,61 @@ help config` to learn about all the options you can set there.
## More Docs
Check out the [docs](https://npmjs.org/doc/),
especially the [faq](https://npmjs.org/doc/faq.html).
Check out the [docs](https://www.npmjs.org/doc/),
especially the [faq](https://www.npmjs.org/doc/faq.html).
You can use the `npm help` command to read any of them.
If you're a developer, and you want to use npm to publish your program,
you should [read this](https://npmjs.org/doc/developers.html)
you should [read this](https://www.npmjs.org/doc/developers.html)
## Legal Stuff
"npm" and "the npm registry" are owned by Isaac Z. Schlueter. All
rights not explicitly granted in the MIT license are reserved. See the
included LICENSE file for more details.
"npm" and "The npm Registry" are owned by npm, Inc.
All rights reserved. See the included LICENSE file for more details.
"Node.js" and "node" are trademarks owned by Joyent, Inc. npm is not
officially part of the Node.js project, and is neither owned by nor
officially affiliated with Joyent, Inc.
"Node.js" and "node" are trademarks owned by Joyent, Inc.
The packages in the npm registry are not part of npm itself, and are the
sole property of their respective maintainers. While every effort is
made to ensure accountability, there is absolutely no guarantee,
warrantee, or assertion made as to the quality, fitness for a specific
purpose, or lack of malice in any given npm package. Modules
published on the npm registry are not affiliated with or endorsed by
Joyent, Inc., Isaac Z. Schlueter, Ryan Dahl, or the Node.js project.
Modules published on the npm registry are not officially endorsed by
npm, Inc. or the Node.js project.
If you have a complaint about a package in the npm registry, and cannot
resolve it with the package owner, please express your concerns to
Isaac Z. Schlueter at <i@izs.me>.
Data published to the npm registry is not part of npm itself, and is
the sole property of the publisher. While every effort is made to
ensure accountability, there is absolutely no guarantee, warrantee, or
assertion expressed or implied as to the quality, fitness for a
specific purpose, or lack of malice in any given npm package.
### In plain english
If you have a complaint about a package in the public npm registry,
and cannot [resolve it with the package
owner](https://www.npmjs.org/doc/misc/npm-disputes.html), please email
<support@npmjs.com> and explain the situation.
This is mine; not my employer's, not Node's, not Joyent's, not Ryan
Dahl's.
Any data published to The npm Registry (including user account
information) may be removed or modified at the sole discretion of the
npm server administrators.
### In plainer english
npm is the property of npm, Inc.
If you publish something, it's yours, and you are solely accountable
for it. Not me, not Node, not Joyent, not Ryan Dahl.
for it.
If other people publish something, it's theirs. Not mine, not Node's,
not Joyent's, not Ryan Dahl's.
If other people publish something, it's theirs.
Yes, you can publish something evil. It will be removed promptly if
reported, and we'll lose respect for you. But there is no vetting
process for published modules.
Users can publish Bad Stuff. It will be removed promptly if reported.
But there is no vetting process for published modules, and you use
them at your own risk. Please inspect the source.
If this concerns you, inspect the source before using packages.
If you publish Bad Stuff, we may delete it from the registry, or even
ban your account in extreme cases. So don't do that.
## BUGS
When you find issues, please report them:
* web:
<https://github.com/isaacs/npm/issues>
<https://github.com/npm/npm/issues>
* email:
<npm-@googlegroups.com>
@@ -234,6 +240,6 @@ will no doubt tell you to put the output in a gist or email.
## SEE ALSO
* npm(1)
* npm-faq(1)
* npm-faq(7)
* npm-help(1)
* npm-index(1)
* npm-index(7)

1
deps/npm/bin/npm vendored
View File

@@ -1,4 +1,5 @@
#!/bin/sh
(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix
basedir=`dirname "$0"`

View File

@@ -1,22 +0,0 @@
npm-commands(3) -- npm commands
===============================
## SYNOPSIS
npm.commands[<command>](args, callback)
## DESCRIPTION
npm comes with a full set of commands, and each of the commands takes a
similar set of arguments.
In general, all commands on the command object take an **array** of positional
argument **strings**. The last argument to any function is a callback. Some
commands are special and take other optional arguments.
All commands have their own man page. See `man npm-<command>` for command-line
usage, or `man 3 npm-<command>` for programmatic usage.
## SEE ALSO
* npm-index(1)

View File

@@ -1,34 +0,0 @@
npm-deprecate(3) -- Deprecate a version of a package
====================================================
## SYNOPSIS
npm.commands.deprecate(args, callback)
## DESCRIPTION
This command will update the npm registry entry for a package, providing
a deprecation warning to all who attempt to install it.
The 'args' parameter must have exactly two elements:
* `package[@version]`
The `version` portion is optional, and may be either a range, or a
specific version, or a tag.
* `message`
The warning message that will be printed whenever a user attempts to
install the package.
Note that you must be the package owner to deprecate something. See the
`owner` and `adduser` help topics.
To un-deprecate a package, specify an empty string (`""`) for the `message` argument.
## SEE ALSO
* npm-publish(3)
* npm-unpublish(3)
* npm-registry(1)

View File

@@ -1,29 +0,0 @@
npm init(3) -- Interactively create a package.json file
=======================================================
## SYNOPSIS
npm.commands.init(args, callback)
## DESCRIPTION
This will ask you a bunch of questions, and then write a package.json for you.
It attempts to make reasonable guesses about what you want things to be set to,
and then writes a package.json file with the options you've selected.
If you already have a package.json file, it'll read that first, and default to
the options in there.
It is strictly additive, so it does not delete options from your package.json
without a really good reason to do so.
Since this function expects to be run on the command-line, it doesn't work very
well as a programmatically. The best option is to roll your own, and since
JavaScript makes it stupid simple to output formatted JSON, that is the
preferred method. If you're sure you want to handle command-line prompting,
then go ahead and use this programmatically.
## SEE ALSO
npm-json(1)

View File

@@ -1,33 +0,0 @@
npm-link(3) -- Symlink a package folder
=======================================
## SYNOPSIS
npm.command.link(callback)
npm.command.link(packages, callback)
## DESCRIPTION
Package linking is a two-step process.
Without parameters, link will create a globally-installed
symbolic link from `prefix/package-name` to the current folder.
With a parameters, link will create a symlink from the local `node_modules`
folder to the global symlink.
When creating tarballs for `npm publish`, the linked packages are
"snapshotted" to their current state by resolving the symbolic links.
This is
handy for installing your own stuff, so that you can work on it and test it
iteratively without having to continually rebuild.
For example:
npm.commands.link(cb) # creates global link from the cwd
# (say redis package)
npm.commands.link('redis', cb) # link-install the package
Now, any changes to the redis package will be reflected in
the package in the current working directory

30
deps/npm/doc/api/npm-cache.md vendored Normal file
View File

@@ -0,0 +1,30 @@
npm-cache(3) -- manage the npm cache programmatically
=====================================================
## SYNOPSIS
npm.commands.cache([args], callback)
// helpers
npm.commands.cache.clean([args], callback)
npm.commands.cache.add([args], callback)
npm.commands.cache.read(name, version, forceBypass, callback)
## DESCRIPTION
This acts much the same ways as the npm-cache(1) command line
functionality.
The callback is called with the package.json data of the thing that is
eventually added to or read from the cache.
The top level `npm.commands.cache(...)` functionality is a public
interface, and like all commands on the `npm.commands` object, it will
match the command line behavior exactly.
However, the cache folder structure and the cache helper functions are
considered **internal** API surface, and as such, may change in future
releases of npm, potentially without warning or significant version
incrementation.
Use at your own risk.

22
deps/npm/doc/api/npm-commands.md vendored Normal file
View File

@@ -0,0 +1,22 @@
npm-commands(3) -- npm commands
===============================
## SYNOPSIS
npm.commands[<command>](args, callback)
## DESCRIPTION
npm comes with a full set of commands, and each of the commands takes a
similar set of arguments.
In general, all commands on the command object take an **array** of positional
argument **strings**. The last argument to any function is a callback. Some
commands are special and take other optional arguments.
All commands have their own man page. See `man npm-<command>` for command-line
usage, or `man 3 npm-<command>` for programmatic usage.
## SEE ALSO
* npm-index(7)

34
deps/npm/doc/api/npm-deprecate.md vendored Normal file
View File

@@ -0,0 +1,34 @@
npm-deprecate(3) -- Deprecate a version of a package
====================================================
## SYNOPSIS
npm.commands.deprecate(args, callback)
## DESCRIPTION
This command will update the npm registry entry for a package, providing
a deprecation warning to all who attempt to install it.
The 'args' parameter must have exactly two elements:
* `package[@version]`
The `version` portion is optional, and may be either a range, or a
specific version, or a tag.
* `message`
The warning message that will be printed whenever a user attempts to
install the package.
Note that you must be the package owner to deprecate something. See the
`owner` and `adduser` help topics.
To un-deprecate a package, specify an empty string (`""`) for the `message` argument.
## SEE ALSO
* npm-publish(3)
* npm-unpublish(3)
* npm-registry(7)

29
deps/npm/doc/api/npm-init.md vendored Normal file
View File

@@ -0,0 +1,29 @@
npm init(3) -- Interactively create a package.json file
=======================================================
## SYNOPSIS
npm.commands.init(args, callback)
## DESCRIPTION
This will ask you a bunch of questions, and then write a package.json for you.
It attempts to make reasonable guesses about what you want things to be set to,
and then writes a package.json file with the options you've selected.
If you already have a package.json file, it'll read that first, and default to
the options in there.
It is strictly additive, so it does not delete options from your package.json
without a really good reason to do so.
Since this function expects to be run on the command-line, it doesn't work very
well as a programmatically. The best option is to roll your own, and since
JavaScript makes it stupid simple to output formatted JSON, that is the
preferred method. If you're sure you want to handle command-line prompting,
then go ahead and use this programmatically.
## SEE ALSO
package.json(5)

33
deps/npm/doc/api/npm-link.md vendored Normal file
View File

@@ -0,0 +1,33 @@
npm-link(3) -- Symlink a package folder
=======================================
## SYNOPSIS
npm.commands.link(callback)
npm.commands.link(packages, callback)
## DESCRIPTION
Package linking is a two-step process.
Without parameters, link will create a globally-installed
symbolic link from `prefix/package-name` to the current folder.
With a parameters, link will create a symlink from the local `node_modules`
folder to the global symlink.
When creating tarballs for `npm publish`, the linked packages are
"snapshotted" to their current state by resolving the symbolic links.
This is
handy for installing your own stuff, so that you can work on it and test it
iteratively without having to continually rebuild.
For example:
npm.commands.link(cb) # creates global link from the cwd
# (say redis package)
npm.commands.link('redis', cb) # link-install the package
Now, any changes to the redis package will be reflected in
the package in the current working directory

31
deps/npm/doc/api/npm-owner.md vendored Normal file
View File

@@ -0,0 +1,31 @@
npm-owner(3) -- Manage package owners
=====================================
## SYNOPSIS
npm.commands.owner(args, callback)
## DESCRIPTION
The first element of the 'args' parameter defines what to do, and the subsequent
elements depend on the action. Possible values for the action are (order of
parameters are given in parenthesis):
* ls (package):
List all the users who have access to modify a package and push new versions.
Handy when you need to know who to bug for help.
* add (user, package):
Add a new user as a maintainer of a package. This user is enabled to modify
metadata, publish new versions, and add other owners.
* rm (user, package):
Remove a user from the package owner list. This immediately revokes their
privileges.
Note that there is only one level of access. Either you can modify a package,
or you can't. Future versions may contain more fine-grained access levels, but
that is not implemented at this time.
## SEE ALSO
* npm-publish(3)
* npm-registry(7)

30
deps/npm/doc/api/npm-publish.md vendored Normal file
View File

@@ -0,0 +1,30 @@
npm-publish(3) -- Publish a package
===================================
## SYNOPSIS
npm.commands.publish([packages,] callback)
## DESCRIPTION
Publishes a package to the registry so that it can be installed by name.
Possible values in the 'packages' array are:
* `<folder>`:
A folder containing a package.json file
* `<tarball>`:
A url or file path to a gzipped tar archive containing a single folder
with a package.json file inside.
If the package array is empty, npm will try to publish something in the
current working directory.
This command could fails if one of the packages specified already exists in
the registry. Overwrites when the "force" environment variable is set.
## SEE ALSO
* npm-registry(7)
* npm-adduser(1)
* npm-owner(3)

19
deps/npm/doc/api/npm-repo.md vendored Normal file
View File

@@ -0,0 +1,19 @@
npm-repo(3) -- Open package repository page in the browser
========================================================
## SYNOPSIS
npm.commands.repo(package, callback)
## DESCRIPTION
This command tries to guess at the likely location of a package's
repository URL, and then tries to open it using the `--browser`
config param.
Like other commands, the first parameter is an array. This command only
uses the first element, which is expected to be a package name with an
optional version number.
This command will launch a browser, so this command may not be the most
friendly for programmatic use.

27
deps/npm/doc/api/npm-run-script.md vendored Normal file
View File

@@ -0,0 +1,27 @@
npm-run-script(3) -- Run arbitrary package scripts
==================================================
## SYNOPSIS
npm.commands.run-script(args, callback)
## DESCRIPTION
This runs an arbitrary command from a package's "scripts" object.
It is used by the test, start, restart, and stop commands, but can be
called directly, as well.
The 'args' parameter is an array of strings. Behavior depends on the number
of elements. If there is only one element, npm assumes that the element
represents a command to be run on the local repository. If there is more than
one element, then the first is assumed to be the package and the second is
assumed to be the command to run. All other elements are ignored.
## SEE ALSO
* npm-scripts(7)
* npm-test(3)
* npm-start(3)
* npm-restart(3)
* npm-stop(3)

View File

@@ -4,7 +4,7 @@ npm(3) -- node package manager
## SYNOPSIS
var npm = require("npm")
npm.load([configObject,] function (er, npm) {
npm.load([configObject, ]function (er, npm) {
// use the npm object, now that it's loaded.
npm.config.set(key, val)
@@ -30,11 +30,11 @@ If you provide `configObject` as an object hash of top-level
configs, they override the values stored in the various config
locations. In the npm command line client, this set of configs
is parsed from the command line options. Additional configuration
params are loaded from two configuration files. See `npm-config(1)`
for more information.
params are loaded from two configuration files. See `npm-config(1)`,
`npm-config(7)`, and `npmrc(5)` for more information.
After that, each of the functions are accessible in the
commands object: `npm.commands.<cmd>`. See `npm-index(1)` for a list of
commands object: `npm.commands.<cmd>`. See `npm-index(7)` for a list of
all possible commands.
All commands on the command object take an **array** of positional argument

View File

@@ -1,31 +0,0 @@
npm-owner(3) -- Manage package owners
=====================================
## SYNOPSIS
npm.commands.owner(args, callback)
## DESCRIPTION
The first element of the 'args' parameter defines what to do, and the subsequent
elements depend on the action. Possible values for the action are (order of
parameters are given in parenthesis):
* ls (package):
List all the users who have access to modify a package and push new versions.
Handy when you need to know who to bug for help.
* add (user, package):
Add a new user as a maintainer of a package. This user is enabled to modify
metadata, publish new versions, and add other owners.
* rm (user, package):
Remove a user from the package owner list. This immediately revokes their
privileges.
Note that there is only one level of access. Either you can modify a package,
or you can't. Future versions may contain more fine-grained access levels, but
that is not implemented at this time.
## SEE ALSO
* npm-publish(3)
* npm-registry(1)

View File

@@ -1,30 +0,0 @@
npm-publish(3) -- Publish a package
===================================
## SYNOPSIS
npm.commands.publish([packages,] callback)
## DESCRIPTION
Publishes a package to the registry so that it can be installed by name.
Possible values in the 'packages' array are:
* `<folder>`:
A folder containing a package.json file
* `<tarball>`:
A url or file path to a gzipped tar archive containing a single folder
with a package.json file inside.
If the package array is empty, npm will try to publish something in the
current working directory.
This command could fails if one of the packages specified already exists in
the registry. Overwrites when the "force" environment variable is set.
## SEE ALSO
* npm-registry(1)
* npm-adduser(1)
* npm-owner(3)

View File

@@ -1,27 +0,0 @@
npm-run-script(3) -- Run arbitrary package scripts
==================================================
## SYNOPSIS
npm.commands.run-script(args, callback)
## DESCRIPTION
This runs an arbitrary command from a package's "scripts" object.
It is used by the test, start, restart, and stop commands, but can be
called directly, as well.
The 'args' parameter is an array of strings. Behavior depends on the number
of elements. If there is only one element, npm assumes that the element
represents a command to be run on the local repository. If there is more than
one element, then the first is assumed to be the package and the second is
assumed to be the command to run. All other elements are ignored.
## SEE ALSO
* npm-scripts(1)
* npm-test(3)
* npm-start(3)
* npm-restart(3)
* npm-stop(3)

View File

@@ -1,36 +0,0 @@
npm-adduser(1) -- Add a registry user account
=============================================
## SYNOPSIS
npm adduser
## DESCRIPTION
Create or verify a user named `<username>` in the npm registry, and
save the credentials to the `.npmrc` file.
The username, password, and email are read in from prompts.
You may use this command to change your email address, but not username
or password.
To reset your password, go to <http://admin.npmjs.org/>
You may use this command multiple times with the same user account to
authorize on a new machine.
## CONFIGURATION
### registry
Default: http://registry.npmjs.org/
The base URL of the npm package registry.
## SEE ALSO
* npm-registry(1)
* npm-config(1)
* npm-owner(1)
* npm-whoami(1)

View File

@@ -1,17 +0,0 @@
npm-bin(1) -- Display npm bin folder
====================================
## SYNOPSIS
npm bin
## DESCRIPTION
Print the folder where npm will install executables.
## SEE ALSO
* npm-prefix(1)
* npm-root(1)
* npm-folders(1)
* npm-config(1)

View File

@@ -1,38 +0,0 @@
npm-bugs(1) -- Bugs for a package in a web browser maybe
========================================================
## SYNOPSIS
npm bugs <pkgname>
## DESCRIPTION
This command tries to guess at the likely location of a package's
bug tracker URL, and then tries to open it using the `--browser`
config param.
## CONFIGURATION
### browser
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
* Type: String
The browser that is called by the `npm bugs` command to open websites.
### registry
* Default: https://registry.npmjs.org/
* Type: url
The base URL of the npm package registry.
## SEE ALSO
* npm-docs(1)
* npm-view(1)
* npm-publish(1)
* npm-registry(1)
* npm-config(1)
* npm-json(1)

View File

@@ -1,22 +0,0 @@
npm-build(1) -- Build a package
===============================
## SYNOPSIS
npm build <package-folder>
* `<package-folder>`:
A folder containing a `package.json` file in its root.
## DESCRIPTION
This is the plumbing command called by `npm link` and `npm install`.
It should generally not be called directly.
## SEE ALSO
* npm-install(1)
* npm-link(1)
* npm-scripts(1)
* npm-json(1)

View File

@@ -1,70 +0,0 @@
npm-cache(1) -- Manipulates packages cache
==========================================
## SYNOPSIS
npm cache add <tarball file>
npm cache add <folder>
npm cache add <tarball url>
npm cache add <name>@<version>
npm cache ls [<path>]
npm cache clean [<path>]
## DESCRIPTION
Used to add, list, or clear the npm cache folder.
* add:
Add the specified package to the local cache. This command is primarily
intended to be used internally by npm, but it can provide a way to
add data to the local installation cache explicitly.
* ls:
Show the data in the cache. Argument is a path to show in the cache
folder. Works a bit like the `find` program, but limited by the
`depth` config.
* clean:
Delete data out of the cache folder. If an argument is provided, then
it specifies a subpath to delete. If no argument is provided, then
the entire cache is cleared.
## DETAILS
npm stores cache data in `$HOME/.npm`. For each package that is added
to the cache, three pieces of information are stored in
`{cache}/{name}/{version}`:
* .../package/:
A folder containing the package contents as they appear in the tarball.
* .../package.json:
The package.json file, as npm sees it, with overlays applied and a _id attribute.
* .../package.tgz:
The tarball for that version.
Additionally, whenever a registry request is made, a `.cache.json` file
is placed at the corresponding URI, to store the ETag and the requested
data.
Commands that make non-essential registry requests (such as `search` and
`view`, or the completion scripts) generally specify a minimum timeout.
If the `.cache.json` file is younger than the specified timeout, then
they do not make an HTTP request to the registry.
## CONFIGURATION
### cache
Default: `$HOME/.npm` on Posix, or `$HOME/npm-cache` on Windows.
The root cache folder.
## SEE ALSO
* npm-folders(1)
* npm-config(1)
* npm-install(1)
* npm-publish(1)
* npm-pack(1)

View File

@@ -1,80 +0,0 @@
npm-changelog(1) -- Changes
===========================
## HISTORY
### 1.1.3, 1.1.4
* Update request to support HTTPS-over-HTTP proxy tunneling
* Throw on undefined envs in config settings
* Update which to 1.0.5
* Fix windows UNC busyloop in findPrefix
* Bundle nested bundleDependencies properly
* Alias adduser to add-user
* Doc updates (Christian Howe, Henrik Hodne, Andrew Lunny)
* ignore logfd/outfd streams in makeEnv() (Rod Vagg)
* shrinkwrap: Behave properly with url-installed deps
* install: Support --save with url install targets
* Support installing naked tars or single-file modules from urls etc.
* init: Don't add engines section
* Don't run make clean on rebuild
* Added missing unicode replacement (atomizer)
### 1.1.2
Dave Pacheco (2):
add "npm shrinkwrap"
Martin Cooper (1):
Fix #1753 Make a copy of the cached objects we'll modify.
Tim Oxley (1):
correctly remove readme from default npm view command.
Tyler Green (1):
fix #2187 set terminal columns to Infinity if 0
isaacs (19):
update minimatch
update request
Experimental: single-file modules
Fix #2172 Don't remove global mans uninstalling local pkgs
Add --versions flag to show the version of node as well
Support --json flag for ls output
update request to 2.9.151
### 1.1
* Replace system tar dependency with a JS tar
* Continue to refine
### 1.0
* Greatly simplified folder structure
* Install locally (bundle by default)
* Drastic rearchitecture
### 0.3
* More correct permission/uid handling when running as root
* Require node 0.4.0
* Reduce featureset
* Packages without "main" modules don't export modules
* Remove support for invalid JSON (since node doesn't support it)
### 0.2
* First allegedly "stable" release
* Most functionality implemented
* Used shim files and `name@version` symlinks
* Feature explosion
* Kind of a mess
### 0.1
* push to beta, and announce
* Solaris and Cygwin support
### 0.0
* Lots of sketches and false starts; abandoned a few times
* Core functionality established
## SEE ALSO
* npm(1)
* npm-faq(1)

View File

@@ -1,181 +0,0 @@
npm-coding-style(1) -- npm's "funny" coding style
=================================================
## DESCRIPTION
npm's coding style is a bit unconventional. It is not different for
difference's sake, but rather a carefully crafted style that is
designed to reduce visual clutter and make bugs more apparent.
If you want to contribute to npm (which is very encouraged), you should
make your code conform to npm's style.
Note: this concerns npm's code not the specific packages at npmjs.org
## Line Length
Keep lines shorter than 80 characters. It's better for lines to be
too short than to be too long. Break up long lists, objects, and other
statements onto multiple lines.
## Indentation
Two-spaces. Tabs are better, but they look like hell in web browsers
(and on github), and node uses 2 spaces, so that's that.
Configure your editor appropriately.
## Curly braces
Curly braces belong on the same line as the thing that necessitates them.
Bad:
function ()
{
Good:
function () {
If a block needs to wrap to the next line, use a curly brace. Don't
use it if it doesn't.
Bad:
if (foo) { bar() }
while (foo)
bar()
Good:
if (foo) bar()
while (foo) {
bar()
}
## Semicolons
Don't use them except in four situations:
* `for (;;)` loops. They're actually required.
* null loops like: `while (something) ;` (But you'd better have a good
reason for doing that.)
* `case "foo": doSomething(); break`
* In front of a leading `(` or `[` at the start of the line.
This prevents the expression from being interpreted
as a function call or property access, respectively.
Some examples of good semicolon usage:
;(x || y).doSomething()
;[a, b, c].forEach(doSomething)
for (var i = 0; i < 10; i ++) {
switch (state) {
case "begin": start(); continue
case "end": finish(); break
default: throw new Error("unknown state")
}
end()
}
Note that starting lines with `-` and `+` also should be prefixed
with a semicolon, but this is much less common.
## Comma First
If there is a list of things separated by commas, and it wraps
across multiple lines, put the comma at the start of the next
line, directly below the token that starts the list. Put the
final token in the list on a line by itself. For example:
var magicWords = [ "abracadabra"
, "gesundheit"
, "ventrilo"
]
, spells = { "fireball" : function () { setOnFire() }
, "water" : function () { putOut() }
}
, a = 1
, b = "abc"
, etc
, somethingElse
## Whitespace
Put a single space in front of ( for anything other than a function call.
Also use a single space wherever it makes things more readable.
Don't leave trailing whitespace at the end of lines. Don't indent empty
lines. Don't use more spaces than are helpful.
## Functions
Use named functions. They make stack traces a lot easier to read.
## Callbacks, Sync/async Style
Use the asynchronous/non-blocking versions of things as much as possible.
It might make more sense for npm to use the synchronous fs APIs, but this
way, the fs and http and child process stuff all uses the same callback-passing
methodology.
The callback should always be the last argument in the list. Its first
argument is the Error or null.
Be very careful never to ever ever throw anything. It's worse than useless.
Just send the error message back as the first argument to the callback.
## Errors
Always create a new Error object with your message. Don't just return a
string message to the callback. Stack traces are handy.
## Logging
Logging is done using the [npmlog](https://github.com/isaacs/npmlog)
utility.
Please clean up logs when they are no longer helpful. In particular,
logging the same object over and over again is not helpful. Logs should
report what's happening so that it's easier to track down where a fault
occurs.
Use appropriate log levels. See `npm-config(1)` and search for
"loglevel".
## Case, naming, etc.
Use `lowerCamelCase` for multiword identifiers when they refer to objects,
functions, methods, members, or anything not specified in this section.
Use `UpperCamelCase` for class names (things that you'd pass to "new").
Use `all-lower-hyphen-css-case` for multiword filenames and config keys.
Use named functions. They make stack traces easier to follow.
Use `CAPS_SNAKE_CASE` for constants, things that should never change
and are rarely used.
Use a single uppercase letter for function names where the function
would normally be anonymous, but needs to call itself recursively. It
makes it clear that it's a "throwaway" function.
## null, undefined, false, 0
Boolean variables and functions should always be either `true` or
`false`. Don't set it to 0 unless it's supposed to be a number.
When something is intentionally missing or removed, set it to `null`.
Don't set things to `undefined`. Reserve that value to mean "not yet
set to anything."
Boolean objects are verboten.
## SEE ALSO
* npm-developers(1)
* npm-faq(1)
* npm(1)

View File

@@ -1,29 +0,0 @@
npm-completion(1) -- Tab Completion for npm
===========================================
## SYNOPSIS
. <(npm completion)
## DESCRIPTION
Enables tab-completion in all npm commands.
The synopsis above
loads the completions into your current shell. Adding it to
your ~/.bashrc or ~/.zshrc will make the completions available
everywhere.
You may of course also pipe the output of npm completion to a file
such as `/usr/local/etc/bash_completion.d/npm` if you have a system
that will read that file for you.
When `COMP_CWORD`, `COMP_LINE`, and `COMP_POINT` are defined in the
environment, `npm completion` acts in "plumbing mode", and outputs
completions based on the arguments.
## SEE ALSO
* npm-developers(1)
* npm-faq(1)
* npm(1)

View File

@@ -1,882 +0,0 @@
npm-config(1) -- Manage the npm configuration file
==================================================
## SYNOPSIS
npm config set <key> <value> [--global]
npm config get <key>
npm config delete <key>
npm config list
npm config edit
npm get <key>
npm set <key> <value> [--global]
## DESCRIPTION
npm gets its configuration values from 6 sources, in this priority:
### Command Line Flags
Putting `--foo bar` on the command line sets the
`foo` configuration parameter to `"bar"`. A `--` argument tells the cli
parser to stop reading flags. A `--flag` parameter that is at the *end* of
the command will be given the value of `true`.
### Environment Variables
Any environment variables that start with `npm_config_` will be interpreted
as a configuration parameter. For example, putting `npm_config_foo=bar` in
your environment will set the `foo` configuration parameter to `bar`. Any
environment configurations that are not given a value will be given the value
of `true`. Config values are case-insensitive, so `NPM_CONFIG_FOO=bar` will
work the same.
### Per-user config file
`$HOME/.npmrc` (or the `userconfig` param, if set above)
This file is an ini-file formatted list of `key = value` parameters.
Environment variables can be replaced using `${VARIABLE_NAME}`. For example:
prefix = ${HOME}/.npm-packages
### Global config file
`$PREFIX/etc/npmrc` (or the `globalconfig` param, if set above):
This file is an ini-file formatted list of `key = value` parameters.
Environment variables can be replaced as above.
### Built-in config file
`path/to/npm/itself/npmrc`
This is an unchangeable "builtin"
configuration file that npm keeps consistent across updates. Set
fields in here using the `./configure` script that comes with npm.
This is primarily for distribution maintainers to override default
configs in a standard and consistent manner.
### Default Configs
A set of configuration parameters that are internal to npm, and are
defaults if nothing else is specified.
## Sub-commands
Config supports the following sub-commands:
### set
npm config set key value
Sets the config key to the value.
If value is omitted, then it sets it to "true".
### get
npm config get key
Echo the config value to stdout.
### list
npm config list
Show all the config settings.
### delete
npm config delete key
Deletes the key from all configuration files.
### edit
npm config edit
Opens the config file in an editor. Use the `--global` flag to edit the
global config.
## Shorthands and Other CLI Niceties
The following shorthands are parsed on the command-line:
* `-v`: `--version`
* `-h`, `-?`, `--help`, `-H`: `--usage`
* `-s`, `--silent`: `--loglevel silent`
* `-q`, `--quiet`: `--loglevel warn`
* `-d`: `--loglevel info`
* `-dd`, `--verbose`: `--loglevel verbose`
* `-ddd`: `--loglevel silly`
* `-g`: `--global`
* `-l`: `--long`
* `-m`: `--message`
* `-p`, `--porcelain`: `--parseable`
* `-reg`: `--registry`
* `-v`: `--version`
* `-f`: `--force`
* `-desc`: `--description`
* `-S`: `--save`
* `-D`: `--save-dev`
* `-O`: `--save-optional`
* `-B`: `--save-bundle`
* `-y`: `--yes`
* `-n`: `--yes false`
* `ll` and `la` commands: `ls --long`
If the specified configuration param resolves unambiguously to a known
configuration parameter, then it is expanded to that configuration
parameter. For example:
npm ls --par
# same as:
npm ls --parseable
If multiple single-character shorthands are strung together, and the
resulting combination is unambiguously not some other configuration
param, then it is expanded to its various component pieces. For
example:
npm ls -gpld
# same as:
npm ls --global --parseable --long --loglevel info
## Per-Package Config Settings
When running scripts (see `npm-scripts(1)`)
the package.json "config" keys are overwritten in the environment if
there is a config param of `<name>[@<version>]:<key>`. For example, if
the package.json has this:
{ "name" : "foo"
, "config" : { "port" : "8080" }
, "scripts" : { "start" : "node server.js" } }
and the server.js is this:
http.createServer(...).listen(process.env.npm_package_config_port)
then the user could change the behavior by doing:
npm config set foo:port 80
## Config Settings
### always-auth
* Default: false
* Type: Boolean
Force npm to always require authentication when accessing the registry,
even for `GET` requests.
### bin-links
* Default: `true`
* Type: Boolean
Tells npm to create symlinks (or `.cmd` shims on Windows) for package
executables.
Set to false to have it not do this. This can be used to work around
the fact that some file systems don't support symlinks, even on
ostensibly Unix systems.
### browser
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
* Type: String
The browser that is called by the `npm docs` command to open websites.
### ca
* Default: The npm CA certificate
* Type: String or null
The Certificate Authority signing certificate that is trusted for SSL
connections to the registry.
Set to `null` to only allow "known" registrars, or to a specific CA cert
to trust only that specific signing authority.
See also the `strict-ssl` config.
### cache
* Default: Windows: `%APPDATA%\npm-cache`, Posix: `~/.npm`
* Type: path
The location of npm's cache directory. See `npm-cache(1)`
### cache-lock-stale
* Default: 60000 (1 minute)
* Type: Number
The number of ms before cache folder lockfiles are considered stale.
### cache-lock-retries
* Default: 10
* Type: Number
Number of times to retry to acquire a lock on cache folder lockfiles.
### cache-lock-wait
* Default: 10000 (10 seconds)
* Type: Number
Number of ms to wait for cache lock files to expire.
### cache-max
* Default: Infinity
* Type: Number
The maximum time (in seconds) to keep items in the registry cache before
re-checking against the registry.
Note that no purging is done unless the `npm cache clean` command is
explicitly used, and that only GET requests use the cache.
### cache-min
* Default: 10
* Type: Number
The minimum time (in seconds) to keep items in the registry cache before
re-checking against the registry.
Note that no purging is done unless the `npm cache clean` command is
explicitly used, and that only GET requests use the cache.
### color
* Default: true on Posix, false on Windows
* Type: Boolean or `"always"`
If false, never shows colors. If `"always"` then always shows colors.
If true, then only prints color codes for tty file descriptors.
### coverage
* Default: false
* Type: Boolean
A flag to tell test-harness to run with their coverage options enabled,
if they respond to the `npm_config_coverage` environment variable.
### depth
* Default: Infinity
* Type: Number
The depth to go when recursing directories for `npm ls` and
`npm cache ls`.
### description
* Default: true
* Type: Boolean
Show the description in `npm search`
### dev
* Default: false
* Type: Boolean
Install `dev-dependencies` along with packages.
Note that `dev-dependencies` are also installed if the `npat` flag is
set.
### editor
* Default: `EDITOR` environment variable if set, or `"vi"` on Posix,
or `"notepad"` on Windows.
* Type: path
The command to run for `npm edit` or `npm config edit`.
### engine-strict
* Default: false
* Type: Boolean
If set to true, then npm will stubbornly refuse to install (or even
consider installing) any package that claims to not be compatible with
the current Node.js version.
### force
* Default: false
* Type: Boolean
Makes various commands more forceful.
* lifecycle script failure does not block progress.
* publishing clobbers previously published versions.
* skips cache when requesting from the registry.
* prevents checks against clobbering non-npm files.
### fetch-retries
* Default: 2
* Type: Number
The "retries" config for the `retry` module to use when fetching
packages from the registry.
### fetch-retry-factor
* Default: 10
* Type: Number
The "factor" config for the `retry` module to use when fetching
packages.
### fetch-retry-mintimeout
* Default: 10000 (10 seconds)
* Type: Number
The "minTimeout" config for the `retry` module to use when fetching
packages.
### fetch-retry-maxtimeout
* Default: 60000 (1 minute)
* Type: Number
The "maxTimeout" config for the `retry` module to use when fetching
packages.
### git
* Default: `"git"`
* Type: String
The command to use for git commands. If git is installed on the
computer, but is not in the `PATH`, then set this to the full path to
the git binary.
### global
* Default: false
* Type: Boolean
Operates in "global" mode, so that packages are installed into the
`prefix` folder instead of the current working directory. See
`npm-folders(1)` for more on the differences in behavior.
* packages are installed into the `{prefix}/lib/node_modules` folder, instead of the
current working directory.
* bin files are linked to `{prefix}/bin`
* man pages are linked to `{prefix}/share/man`
### globalconfig
* Default: {prefix}/etc/npmrc
* Type: path
The config file to read for global config options.
### globalignorefile
* Default: {prefix}/etc/npmignore
* Type: path
The config file to read for global ignore patterns to apply to all users
and all projects.
If not found, but there is a "gitignore" file in the
same directory, then that will be used instead.
### group
* Default: GID of the current process
* Type: String or Number
The group to use when running package scripts in global mode as the root
user.
### https-proxy
* Default: the `HTTPS_PROXY` or `https_proxy` or `HTTP_PROXY` or
`http_proxy` environment variables.
* Type: url
A proxy to use for outgoing https requests.
### user-agent
* Default: node/{process.version} {process.platform} {process.arch}
* Type: String
Sets a User-Agent to the request header
### ignore
* Default: ""
* Type: string
A white-space separated list of glob patterns of files to always exclude
from packages when building tarballs.
### init-module
* Default: ~/.npm-init.js
* Type: path
A module that will be loaded by the `npm init` command. See the
documentation for the
[init-package-json](https://github.com/isaacs/init-package-json) module
for more information, or npm-init(1).
### init.version
* Default: "0.0.0"
* Type: semver
The value `npm init` should use by default for the package version.
### init.author.name
* Default: ""
* Type: String
The value `npm init` should use by default for the package author's name.
### init.author.email
* Default: ""
* Type: String
The value `npm init` should use by default for the package author's email.
### init.author.url
* Default: ""
* Type: String
The value `npm init` should use by default for the package author's homepage.
### json
* Default: false
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
This feature is currently experimental, and the output data structures
for many commands is either not implemented in JSON yet, or subject to
change. Only the output from `npm ls --json` is currently valid.
### link
* Default: false
* Type: Boolean
If true, then local installs will link if there is a suitable globally
installed package.
Note that this means that local installs can cause things to be
installed into the global space at the same time. The link is only done
if one of the two conditions are met:
* The package is not already installed globally, or
* the globally installed version is identical to the version that is
being installed locally.
### loglevel
* Default: "http"
* Type: String
* Values: "silent", "win", "error", "warn", "http", "info", "verbose", "silly"
What level of logs to report. On failure, *all* logs are written to
`npm-debug.log` in the current working directory.
Any logs of a higher level than the setting are shown.
The default is "http", which shows http, warn, and error output.
### logstream
* Default: process.stderr
* Type: Stream
This is the stream that is passed to the
[npmlog](https://github.com/isaacs/npmlog) module at run time.
It cannot be set from the command line, but if you are using npm
programmatically, you may wish to send logs to somewhere other than
stderr.
If the `color` config is set to true, then this stream will receive
colored output if it is a TTY.
### long
* Default: false
* Type: Boolean
Show extended information in `npm ls`
### message
* Default: "%s"
* Type: String
Commit message which is used by `npm version` when creating version commit.
Any "%s" in the message will be replaced with the version number.
### node-version
* Default: process.version
* Type: semver or false
The node version to use when checking package's "engines" hash.
### npat
* Default: false
* Type: Boolean
Run tests on installation and report results to the
`npaturl`.
### npaturl
* Default: Not yet implemented
* Type: url
The url to report npat test results.
### onload-script
* Default: false
* Type: path
A node module to `require()` when npm loads. Useful for programmatic
usage.
### optional
* Default: true
* Type: Boolean
Attempt to install packages in the `optionalDependencies` hash. Note
that if these packages fail to install, the overall installation
process is not aborted.
### parseable
* Default: false
* Type: Boolean
Output parseable results from commands that write to
standard output.
### prefix
* Default: see npm-folders(1)
* Type: path
The location to install global items. If set on the command line, then
it forces non-global commands to run in the specified folder.
### production
* Default: false
* Type: Boolean
Set to true to run in "production" mode.
1. devDependencies are not installed at the topmost level when running
local `npm install` without any arguments.
2. Set the NODE_ENV="production" for lifecycle scripts.
### proprietary-attribs
* Default: true
* Type: Boolean
Whether or not to include proprietary extended attributes in the
tarballs created by npm.
Unless you are expecting to unpack package tarballs with something other
than npm -- particularly a very outdated tar implementation -- leave
this as true.
### proxy
* Default: `HTTP_PROXY` or `http_proxy` environment variable, or null
* Type: url
A proxy to use for outgoing http requests.
### rebuild-bundle
* Default: true
* Type: Boolean
Rebuild bundled dependencies after installation.
### registry
* Default: https://registry.npmjs.org/
* Type: url
The base URL of the npm package registry.
### rollback
* Default: true
* Type: Boolean
Remove failed installs.
### save
* Default: false
* Type: Boolean
Save installed packages to a package.json file as dependencies.
When used with the `npm rm` command, it removes it from the dependencies
hash.
Only works if there is already a package.json file present.
### save-bundle
* Default: false
* Type: Boolean
If a package would be saved at install time by the use of `--save`,
`--save-dev`, or `--save-optional`, then also put it in the
`bundleDependencies` list.
When used with the `npm rm` command, it removes it from the
bundledDependencies list.
### save-dev
* Default: false
* Type: Boolean
Save installed packages to a package.json file as devDependencies.
When used with the `npm rm` command, it removes it from the devDependencies
hash.
Only works if there is already a package.json file present.
### save-optional
* Default: false
* Type: Boolean
Save installed packages to a package.json file as optionalDependencies.
When used with the `npm rm` command, it removes it from the devDependencies
hash.
Only works if there is already a package.json file present.
### searchopts
* Default: ""
* Type: String
Space-separated options that are always passed to search.
### searchexclude
* Default: ""
* Type: String
Space-separated options that limit the results from search.
### searchsort
* Default: "name"
* Type: String
* Values: "name", "-name", "date", "-date", "description",
"-description", "keywords", "-keywords"
Indication of which field to sort search results by. Prefix with a `-`
character to indicate reverse sort.
### shell
* Default: SHELL environment variable, or "bash" on Posix, or "cmd" on
Windows
* Type: path
The shell to run for the `npm explore` command.
### shrinkwrap
* Default: true
* Type: Boolean
If set to false, then ignore `npm-shrinkwrap.json` files when
installing.
### sign-git-tag
* Default: false
* Type: Boolean
If set to true, then the `npm version` command will tag the version
using `-s` to add a signature.
Note that git requires you to have set up GPG keys in your git configs
for this to work properly.
### strict-ssl
* Default: true
* Type: Boolean
Whether or not to do SSL key validation when making requests to the
registry via https.
See also the `ca` config.
### tag
* Default: latest
* Type: String
If you ask npm to install a package and don't tell it a specific version, then
it will install the specified tag.
Also the tag that is added to the package@version specified by the `npm
tag` command, if no explicit tag is given.
### tmp
* Default: TMPDIR environment variable, or "/tmp"
* Type: path
Where to store temporary files and folders. All temp files are deleted
on success, but left behind on failure for forensic purposes.
### unicode
* Default: true
* Type: Boolean
When set to true, npm uses unicode characters in the tree output. When
false, it uses ascii characters to draw trees.
### unsafe-perm
* Default: false if running as root, true otherwise
* Type: Boolean
Set to true to suppress the UID/GID switching when running package
scripts. If set explicitly to false, then installing as a non-root user
will fail.
### usage
* Default: false
* Type: Boolean
Set to show short usage output (like the -H output)
instead of complete help when doing `npm-help(1)`.
### user
* Default: "nobody"
* Type: String or Number
The UID to set to when running package scripts as root.
### username
* Default: null
* Type: String
The username on the npm registry. Set with `npm adduser`
### userconfig
* Default: ~/.npmrc
* Type: path
The location of user-level configuration settings.
### userignorefile
* Default: ~/.npmignore
* Type: path
The location of a user-level ignore file to apply to all packages.
If not found, but there is a .gitignore file in the same directory, then
that will be used instead.
### umask
* Default: 022
* Type: Octal numeric string
The "umask" value to use when setting the file creation mode on files
and folders.
Folders and executables are given a mode which is `0777` masked against
this value. Other files are given a mode which is `0666` masked against
this value. Thus, the defaults are `0755` and `0644` respectively.
### version
* Default: false
* Type: boolean
If true, output the npm version and exit successfully.
Only relevant when specified explicitly on the command line.
### versions
* Default: false
* Type: boolean
If true, output the npm version as well as node's `process.versions`
hash, and exit successfully.
Only relevant when specified explicitly on the command line.
### viewer
* Default: "man" on Posix, "browser" on Windows
* Type: path
The program to use to view help content.
Set to `"browser"` to view html help content in the default web browser.
### yes
* Default: null
* Type: Boolean or null
If set to `null`, then prompt the user for responses in some
circumstances.
If set to `true`, then answer "yes" to any prompt. If set to `false`
then answer "no" to any prompt.
## SEE ALSO
* npm-folders(1)
* npm(1)

View File

@@ -1,53 +0,0 @@
npm-dedupe(1) -- Reduce duplication
===================================
## SYNOPSIS
npm dedupe [package names...]
## DESCRIPTION
Searches the local package tree and attempts to simplify the overall
structure by moving dependencies further up the tree, where they can
be more effectively shared by multiple dependent packages.
For example, consider this dependency graph:
a
+-- b <-- depends on c@1.0.x
| `-- c@1.0.3
`-- d <-- depends on c@~1.0.9
`-- c@1.0.10
In this case, `npm-dedupe(1)` will transform the tree to:
a
+-- b
+-- d
`-- c@1.0.10
Because of the hierarchical nature of node's module lookup, b and d
will both get their dependency met by the single c package at the root
level of the tree.
If a suitable version exists at the target location in the tree
already, then it will be left untouched, but the other duplicates will
be deleted.
If no suitable version can be found, then a warning is printed, and
nothing is done.
If any arguments are supplied, then they are filters, and only the
named packages will be touched.
Note that this operation transforms the dependency tree, and may
result in packages getting updated versions, perhaps from the npm
registry.
This feature is experimental, and may change in future versions.
## SEE ALSO
* npm-ls(1)
* npm-update(1)
* npm-install(1)

View File

@@ -1,26 +0,0 @@
npm-deprecate(1) -- Deprecate a version of a package
====================================================
## SYNOPSIS
npm deprecate <name>[@<version>] <message>
## DESCRIPTION
This command will update the npm registry entry for a package, providing
a deprecation warning to all who attempt to install it.
It works on version ranges as well as specific versions, so you can do
something like this:
npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3"
Note that you must be the package owner to deprecate something. See the
`owner` and `adduser` help topics.
To un-deprecate a package, specify an empty string (`""`) for the `message` argument.
## SEE ALSO
* npm-publish(1)
* npm-registry(1)

View File

@@ -1,207 +0,0 @@
npm-developers(1) -- Developer Guide
====================================
## DESCRIPTION
So, you've decided to use npm to develop (and maybe publish/deploy)
your project.
Fantastic!
There are a few things that you need to do above the simple steps
that your users will do to install your program.
## About These Documents
These are man pages. If you install npm, you should be able to
then do `man npm-thing` to get the documentation on a particular
topic, or `npm help thing` to see the same information.
## What is a `package`
A package is:
* a) a folder containing a program described by a package.json file
* b) a gzipped tarball containing (a)
* c) a url that resolves to (b)
* d) a `<name>@<version>` that is published on the registry with (c)
* e) a `<name>@<tag>` that points to (d)
* f) a `<name>` that has a "latest" tag satisfying (e)
* g) a `git` url that, when cloned, results in (a).
Even if you never publish your package, you can still get a lot of
benefits of using npm if you just want to write a node program (a), and
perhaps if you also want to be able to easily install it elsewhere
after packing it up into a tarball (b).
Git urls can be of the form:
git://github.com/user/project.git#commit-ish
git+ssh://user@hostname:project.git#commit-ish
git+http://user@hostname/project/blah.git#commit-ish
git+https://user@hostname/project/blah.git#commit-ish
The `commit-ish` can be any tag, sha, or branch which can be supplied as
an argument to `git checkout`. The default is `master`.
## The package.json File
You need to have a `package.json` file in the root of your project to do
much of anything with npm. That is basically the whole interface.
See `npm-json(1)` for details about what goes in that file. At the very
least, you need:
* name:
This should be a string that identifies your project. Please do not
use the name to specify that it runs on node, or is in JavaScript.
You can use the "engines" field to explicitly state the versions of
node (or whatever else) that your program requires, and it's pretty
well assumed that it's javascript.
It does not necessarily need to match your github repository name.
So, `node-foo` and `bar-js` are bad names. `foo` or `bar` are better.
* version:
A semver-compatible version.
* engines:
Specify the versions of node (or whatever else) that your program
runs on. The node API changes a lot, and there may be bugs or new
functionality that you depend on. Be explicit.
* author:
Take some credit.
* scripts:
If you have a special compilation or installation script, then you
should put it in the `scripts` hash. You should definitely have at
least a basic smoke-test command as the "scripts.test" field.
See npm-scripts(1).
* main:
If you have a single module that serves as the entry point to your
program (like what the "foo" package gives you at require("foo")),
then you need to specify that in the "main" field.
* directories:
This is a hash of folders. The best ones to include are "lib" and
"doc", but if you specify a folder full of man pages in "man", then
they'll get installed just like these ones.
You can use `npm init` in the root of your package in order to get you
started with a pretty basic package.json file. See `npm-init(1)` for
more info.
## Keeping files *out* of your package
Use a `.npmignore` file to keep stuff out of your package. If there's
no `.npmignore` file, but there *is* a `.gitignore` file, then npm will
ignore the stuff matched by the `.gitignore` file. If you *want* to
include something that is excluded by your `.gitignore` file, you can
create an empty `.npmignore` file to override it.
By default, the following paths and files are ignored, so there's no
need to add them to `.npmignore` explicitly:
* `.*.swp`
* `._*`
* `.DS_Store`
* `.git`
* `.hg`
* `.lock-wscript`
* `.svn`
* `.wafpickle-*`
* `CVS`
* `npm-debug.log`
Additionally, everything in `node_modules` is ignored, except for
bundled dependencies. npm automatically handles this for you, so don't
bother adding `node_modules` to `.npmignore`.
The following paths and files are never ignored, so adding them to
`.npmignore` is pointless:
* `package.json`
* `README.*`
## Link Packages
`npm link` is designed to install a development package and see the
changes in real time without having to keep re-installing it. (You do
need to either re-link or `npm rebuild -g` to update compiled packages,
of course.)
More info at `npm-link(1)`.
## Before Publishing: Make Sure Your Package Installs and Works
**This is important.**
If you can not install it locally, you'll have
problems trying to publish it. Or, worse yet, you'll be able to
publish it, but you'll be publishing a broken or pointless package.
So don't do that.
In the root of your package, do this:
npm install . -g
That'll show you that it's working. If you'd rather just create a symlink
package that points to your working directory, then do this:
npm link
Use `npm ls -g` to see if it's there.
To test a local install, go into some other folder, and then do:
cd ../some-other-folder
npm install ../my-package
to install it locally into the node_modules folder in that other place.
Then go into the node-repl, and try using require("my-thing") to
bring in your module's main module.
## Create a User Account
Create a user with the adduser command. It works like this:
npm adduser
and then follow the prompts.
This is documented better in npm-adduser(1).
## Publish your package
This part's easy. IN the root of your folder, do this:
npm publish
You can give publish a url to a tarball, or a filename of a tarball,
or a path to a folder.
Note that pretty much **everything in that folder will be exposed**
by default. So, if you have secret stuff in there, use a
`.npmignore` file to list out the globs to ignore, or publish
from a fresh checkout.
## Brag about it
Send emails, write blogs, blab in IRC.
Tell the world how easy it is to install your program!
## SEE ALSO
* npm-faq(1)
* npm(1)
* npm-init(1)
* npm-json(1)
* npm-scripts(1)
* npm-publish(1)
* npm-adduser(1)
* npm-registry(1)

View File

@@ -1,98 +0,0 @@
npm-disputes(1) -- Handling Module Name Disputes
================================================
## SYNOPSIS
1. Get the author email with `npm owner ls <pkgname>`
2. Email the author, CC <i@izs.me>.
3. After a few weeks, if there's no resolution, we'll sort it out.
Don't squat on package names. Publish code or move out of the way.
## DESCRIPTION
There sometimes arise cases where a user publishes a module, and then
later, some other user wants to use that name. Here are some common
ways that happens (each of these is based on actual events.)
1. Joe writes a JavaScript module `foo`, which is not node-specific.
Joe doesn't use node at all. Bob wants to use `foo` in node, so he
wraps it in an npm module. Some time later, Joe starts using node,
and wants to take over management of his program.
2. Bob writes an npm module `foo`, and publishes it. Perhaps much
later, Joe finds a bug in `foo`, and fixes it. He sends a pull
request to Bob, but Bob doesn't have the time to deal with it,
because he has a new job and a new baby and is focused on his new
erlang project, and kind of not involved with node any more. Joe
would like to publish a new `foo`, but can't, because the name is
taken.
3. Bob writes a 10-line flow-control library, and calls it `foo`, and
publishes it to the npm registry. Being a simple little thing, it
never really has to be updated. Joe works for Foo Inc, the makers
of the critically acclaimed and widely-marketed `foo` JavaScript
toolkit framework. They publish it to npm as `foojs`, but people are
routinely confused when `npm install foo` is some different thing.
4. Bob writes a parser for the widely-known `foo` file format, because
he needs it for work. Then, he gets a new job, and never updates the
prototype. Later on, Joe writes a much more complete `foo` parser,
but can't publish, because Bob's `foo` is in the way.
The validity of Joe's claim in each situation can be debated. However,
Joe's appropriate course of action in each case is the same.
1. `npm owner ls foo`. This will tell Joe the email address of the
owner (Bob).
2. Joe emails Bob, explaining the situation **as respectfully as possible**,
and what he would like to do with the module name. He adds
isaacs <i@izs.me> to the CC list of the email. Mention in the email
that Bob can run `npm owner add joe foo` to add Joe as an owner of
the `foo` package.
3. After a reasonable amount of time, if Bob has not responded, or if
Bob and Joe can't come to any sort of resolution, email isaacs
<i@izs.me> and we'll sort it out. ("Reasonable" is usually about 4
weeks, but extra time is allowed around common holidays.)
## REASONING
In almost every case so far, the parties involved have been able to reach
an amicable resolution without any major intervention. Most people
really do want to be reasonable, and are probably not even aware that
they're in your way.
Module ecosystems are most vibrant and powerful when they are as
self-directed as possible. If an admin one day deletes something you
had worked on, then that is going to make most people quite upset,
regardless of the justification. When humans solve their problems by
talking to other humans with respect, everyone has the chance to end up
feeling good about the interaction.
## EXCEPTIONS
Some things are not allowed, and will be removed without discussion if
they are brought to the attention of the npm registry admins, including
but not limited to:
1. Malware (that is, a package designed to exploit or harm the machine on
which it is installed).
2. Violations of copyright or licenses (for example, cloning an
MIT-licensed program, and then removing or changing the copyright and
license statement).
3. Illegal content.
4. "Squatting" on a package name that you *plan* to use, but aren't
actually using. Sorry, I don't care how great the name is, or how
perfect a fit it is for the thing that someday might happen. If
someone wants to use it today, and you're just taking up space with
an empty tarball, you're going to be evicted.
5. Putting empty packages in the registry. Packages must have SOME
functionality. It can be silly, but it can't be *nothing*. (See
also: squatting.)
6. Doing weird things with the registry, like using it as your own
personal application database or otherwise putting non-packagey
things into it.
If you see bad behavior like this, please report it right away.
## SEE ALSO
* npm-registry(1)
* npm-owner(1)

View File

@@ -1,38 +0,0 @@
npm-docs(1) -- Docs for a package in a web browser maybe
========================================================
## SYNOPSIS
npm docs <pkgname>
npm home <pkgname>
## DESCRIPTION
This command tries to guess at the likely location of a package's
documentation URL, and then tries to open it using the `--browser`
config param.
## CONFIGURATION
### browser
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
* Type: String
The browser that is called by the `npm docs` command to open websites.
### registry
* Default: https://registry.npmjs.org/
* Type: url
The base URL of the npm package registry.
## SEE ALSO
* npm-view(1)
* npm-publish(1)
* npm-registry(1)
* npm-config(1)
* npm-json(1)

View File

@@ -1,35 +0,0 @@
npm-edit(1) -- Edit an installed package
========================================
## SYNOPSIS
npm edit <name>[@<version>]
## DESCRIPTION
Opens the package folder in the default editor (or whatever you've
configured as the npm `editor` config -- see `npm-config(1)`.)
After it has been edited, the package is rebuilt so as to pick up any
changes in compiled packages.
For instance, you can do `npm install connect` to install connect
into your package, and then `npm edit connect` to make a few
changes to your locally installed copy.
## CONFIGURATION
### editor
* Default: `EDITOR` environment variable if set, or `"vi"` on Posix,
or `"notepad"` on Windows.
* Type: path
The command to run for `npm edit` or `npm config edit`.
## SEE ALSO
* npm-folders(1)
* npm-explore(1)
* npm-install(1)
* npm-config(1)

View File

@@ -1,40 +0,0 @@
npm-explore(1) -- Browse an installed package
=============================================
## SYNOPSIS
npm explore <name>[@<version>] [ -- <cmd>]
## DESCRIPTION
Spawn a subshell in the directory of the installed package specified.
If a command is specified, then it is run in the subshell, which then
immediately terminates.
This is particularly handy in the case of git submodules in the
`node_modules` folder:
npm explore some-dependency -- git pull origin master
Note that the package is *not* automatically rebuilt afterwards, so be
sure to use `npm rebuild <pkg>` if you make any changes.
## CONFIGURATION
### shell
* Default: SHELL environment variable, or "bash" on Posix, or "cmd" on
Windows
* Type: path
The shell to run for the `npm explore` command.
## SEE ALSO
* npm-submodule(1)
* npm-folders(1)
* npm-edit(1)
* npm-rebuild(1)
* npm-build(1)
* npm-install(1)

View File

@@ -1,352 +0,0 @@
npm-faq(1) -- Frequently Asked Questions
========================================
## Where can I find these docs in HTML?
<https://npmjs.org/doc/>, or run:
npm config set viewer browser
to open these documents in your default web browser rather than `man`.
## It didn't work.
That's not really a question.
## Why didn't it work?
I don't know yet.
Read the error output, and if you can't figure out what it means,
do what it says and post a bug with all the information it asks for.
## Where does npm put stuff?
See `npm-folders(1)`
tl;dr:
* Use the `npm root` command to see where modules go, and the `npm bin`
command to see where executables go
* Global installs are different from local installs. If you install
something with the `-g` flag, then its executables go in `npm bin -g`
and its modules go in `npm root -g`.
## How do I install something on my computer in a central location?
Install it globally by tacking `-g` or `--global` to the command. (This
is especially important for command line utilities that need to add
their bins to the global system `PATH`.)
## I installed something globally, but I can't `require()` it
Install it locally.
The global install location is a place for command-line utilities
to put their bins in the system `PATH`. It's not for use with `require()`.
If you `require()` a module in your code, then that means it's a
dependency, and a part of your program. You need to install it locally
in your program.
## Why can't npm just put everything in one place, like other package managers?
Not every change is an improvement, but every improvement is a change.
This would be like asking git to do network IO for every commit. It's
not going to happen, because it's a terrible idea that causes more
problems than it solves.
It is much harder to avoid dependency conflicts without nesting
dependencies. This is fundamental to the way that npm works, and has
proven to be an extremely successful approach. See `npm-folders(1)` for
more details.
If you want a package to be installed in one place, and have all your
programs reference the same copy of it, then use the `npm link` command.
That's what it's for. Install it globally, then link it into each
program that uses it.
## Whatever, I really want the old style 'everything global' style.
Write your own package manager, then. It's not that hard.
npm will not help you do something that is known to be a bad idea.
## Should I check my `node_modules` folder into git?
Mikeal Rogers answered this question very well:
<http://www.mikealrogers.com/posts/nodemodules-in-git.html>
tl;dr
* Check `node_modules` into git for things you **deploy**, such as
websites and apps.
* Do not check `node_modules` into git for libraries and modules
intended to be reused.
* Use npm to manage dependencies in your dev environment, but not in
your deployment scripts.
## Is it 'npm' or 'NPM' or 'Npm'?
npm should never be capitalized unless it is being displayed in a
location that is customarily all-caps (such as the title of man pages.)
## If 'npm' is an acronym, why is it never capitalized?
Contrary to the belief of many, "npm" is not in fact an abbreviation for
"Node Package Manager". It is a recursive bacronymic abbreviation for
"npm is not an acronym". (If it was "ninaa", then it would be an
acronym, and thus incorrectly named.)
"NPM", however, *is* an acronym (more precisely, a capitonym) for the
National Association of Pastoral Musicians. You can learn more
about them at <http://npm.org/>.
In software, "NPM" is a Non-Parametric Mapping utility written by
Chris Rorden. You can analyze pictures of brains with it. Learn more
about the (capitalized) NPM program at <http://www.cabiatl.com/mricro/npm/>.
The first seed that eventually grew into this flower was a bash utility
named "pm", which was a shortened descendent of "pkgmakeinst", a
bash function that was used to install various different things on different
platforms, most often using Yahoo's `yinst`. If `npm` was ever an
acronym for anything, it was `node pm` or maybe `new pm`.
So, in all seriousness, the "npm" project is named after its command-line
utility, which was organically selected to be easily typed by a right-handed
programmer using a US QWERTY keyboard layout, ending with the
right-ring-finger in a postition to type the `-` key for flags and
other command-line arguments. That command-line utility is always
lower-case, though it starts most sentences it is a part of.
## How do I list installed packages?
`npm ls`
## How do I search for packages?
`npm search`
Arguments are greps. `npm search jsdom` shows jsdom packages.
## How do I update npm?
npm update npm -g
You can also update all outdated local packages by doing `npm update` without
any arguments, or global packages by doing `npm update -g`.
Occasionally, the version of npm will progress such that the current
version cannot be properly installed with the version that you have
installed already. (Consider, if there is ever a bug in the `update`
command.)
In those cases, you can do this:
curl https://npmjs.org/install.sh | sh
## What is a `package`?
A package is:
* a) a folder containing a program described by a package.json file
* b) a gzipped tarball containing (a)
* c) a url that resolves to (b)
* d) a `<name>@<version>` that is published on the registry with (c)
* e) a `<name>@<tag>` that points to (d)
* f) a `<name>` that has a "latest" tag satisfying (e)
* g) a `git` url that, when cloned, results in (a).
Even if you never publish your package, you can still get a lot of
benefits of using npm if you just want to write a node program (a), and
perhaps if you also want to be able to easily install it elsewhere
after packing it up into a tarball (b).
Git urls can be of the form:
git://github.com/user/project.git#commit-ish
git+ssh://user@hostname:project.git#commit-ish
git+http://user@hostname/project/blah.git#commit-ish
git+https://user@hostname/project/blah.git#commit-ish
The `commit-ish` can be any tag, sha, or branch which can be supplied as
an argument to `git checkout`. The default is `master`.
## What is a `module`?
A module is anything that can be loaded with `require()` in a Node.js
program. The following things are all examples of things that can be
loaded as modules:
* A folder with a `package.json` file containing a `main` field.
* A folder with an `index.js` file in it.
* A JavaScript file.
Most npm packages are modules, because they are libraries that you
load with `require`. However, there's no requirement that an npm
package be a module! Some only contain an executable command-line
interface, and don't provide a `main` field for use in Node programs.
Almost all npm packages (at least, those that are Node programs)
*contain* many modules within them (because every file they load with
`require()` is a module).
In the context of a Node program, the `module` is also the thing that
was loaded *from* a file. For example, in the following program:
var req = require('request')
we might say that "The variable `req` refers to the `request` module".
## So, why is it the "`node_modules`" folder, but "`package.json`" file? Why not `node_packages` or `module.json`?
The `package.json` file defines the package. (See "What is a
package?" above.)
The `node_modules` folder is the place Node.js looks for modules.
(See "What is a module?" above.)
For example, if you create a file at `node_modules/foo.js` and then
had a program that did `var f = require('foo.js')` then it would load
the module. However, `foo.js` is not a "package" in this case,
because it does not have a package.json.
Alternatively, if you create a package which does not have an
`index.js` or a `"main"` field in the `package.json` file, then it is
not a module. Even if it's installed in `node_modules`, it can't be
an argument to `require()`.
## `"node_modules"` is the name of my deity's arch-rival, and a Forbidden Word in my religion. Can I configure npm to use a different folder?
No. This will never happen. This question comes up sometimes,
because it seems silly from the outside that npm couldn't just be
configured to put stuff somewhere else, and then npm could load them
from there. It's an arbitrary spelling choice, right? What's the big
deal?
At the time of this writing, the string `'node_modules'` appears 151
times in 53 separate files in npm and node core (excluding tests and
documentation).
Some of these references are in node's built-in module loader. Since
npm is not involved **at all** at run-time, node itself would have to
be configured to know where you've decided to stick stuff. Complexity
hurdle #1. Since the Node module system is locked, this cannot be
changed, and is enough to kill this request. But I'll continue, in
deference to your deity's delicate feelings regarding spelling.
Many of the others are in dependencies that npm uses, which are not
necessarily tightly coupled to npm (in the sense that they do not read
npm's configuration files, etc.) Each of these would have to be
configured to take the name of the `node_modules` folder as a
parameter. Complexity hurdle #2.
Furthermore, npm has the ability to "bundle" dependencies by adding
the dep names to the `"bundledDependencies"` list in package.json,
which causes the folder to be included in the package tarball. What
if the author of a module bundles its dependencies, and they use a
different spelling for `node_modules`? npm would have to rename the
folder at publish time, and then be smart enough to unpack it using
your locally configured name. Complexity hurdle #3.
Furthermore, what happens when you *change* this name? Fine, it's
easy enough the first time, just rename the `node_modules` folders to
`./blergyblerp/` or whatever name you choose. But what about when you
change it again? npm doesn't currently track any state about past
configuration settings, so this would be rather difficult to do
properly. It would have to track every previous value for this
config, and always accept any of them, or else yesterday's install may
be broken tomorrow. Complexity hurdle #5.
Never going to happen. The folder is named `node_modules`. It is
written indelibly in the Node Way, handed down from the ancient times
of Node 0.3.
## How do I install node with npm?
You don't. Try one of these node version managers:
Unix:
* <http://github.com/isaacs/nave>
* <http://github.com/visionmedia/n>
* <http://github.com/creationix/nvm>
Windows:
* <http://github.com/marcelklehr/nodist>
* <https://github.com/hakobera/nvmw>
## How can I use npm for development?
See `npm-developers(1)` and `npm-json(1)`.
You'll most likely want to `npm link` your development folder. That's
awesomely handy.
To set up your own private registry, check out `npm-registry(1)`.
## Can I list a url as a dependency?
Yes. It should be a url to a gzipped tarball containing a single folder
that has a package.json in its root, or a git url.
(See "what is a package?" above.)
## How do I symlink to a dev folder so I don't have to keep re-installing?
See `npm-link(1)`
## The package registry website. What is that exactly?
See `npm-registry(1)`.
## I forgot my password, and can't publish. How do I reset it?
Go to <https://npmjs.org/forgot>.
## I get ECONNREFUSED a lot. What's up?
Either the registry is down, or node's DNS isn't able to reach out.
To check if the registry is down, open up <http://registry.npmjs.org/>
in a web browser. This will also tell you if you are just unable to
access the internet for some reason.
If the registry IS down, let me know by emailing <i@izs.me> or posting
an issue at <https://github.com/isaacs/npm/issues>. We'll have
someone kick it or something.
## Why no namespaces?
Please see this discussion: <https://github.com/isaacs/npm/issues/798>
tl;dr - It doesn't actually make things better, and can make them worse.
If you want to namespace your own packages, you may: simply use the
`-` character to separate the names. npm is a mostly anarchic system.
There is not sufficient need to impose namespace rules on everyone.
## Who does npm?
`npm view npm author`
`npm view npm contributors`
## I have a question or request not addressed here. Where should I put it?
Post an issue on the github project:
* <https://github.com/isaacs/npm/issues>
## Why does npm hate me?
npm is not capable of hatred. It loves everyone, especially you.
## SEE ALSO
* npm(1)
* npm-developers(1)
* npm-json(1)
* npm-config(1)
* npm-folders(1)

View File

@@ -1,209 +0,0 @@
npm-folders(1) -- Folder Structures Used by npm
===============================================
## DESCRIPTION
npm puts various things on your computer. That's its job.
This document will tell you what it puts where.
### tl;dr
* Local install (default): puts stuff in `./node_modules` of the current
package root.
* Global install (with `-g`): puts stuff in /usr/local or wherever node
is installed.
* Install it **locally** if you're going to `require()` it.
* Install it **globally** if you're going to run it on the command line.
* If you need both, then install it in both places, or use `npm link`.
### prefix Configuration
The `prefix` config defaults to the location where node is installed.
On most systems, this is `/usr/local`, and most of the time is the same
as node's `process.installPrefix`.
On windows, this is the exact location of the node.exe binary. On Unix
systems, it's one level up, since node is typically installed at
`{prefix}/bin/node` rather than `{prefix}/node.exe`.
When the `global` flag is set, npm installs things into this prefix.
When it is not set, it uses the root of the current package, or the
current working directory if not in a package already.
### Node Modules
Packages are dropped into the `node_modules` folder under the `prefix`.
When installing locally, this means that you can
`require("packagename")` to load its main module, or
`require("packagename/lib/path/to/sub/module")` to load other modules.
Global installs on Unix systems go to `{prefix}/lib/node_modules`.
Global installs on Windows go to `{prefix}/node_modules` (that is, no
`lib` folder.)
If you wish to `require()` a package, then install it locally.
### Executables
When in global mode, executables are linked into `{prefix}/bin` on Unix,
or directly into `{prefix}` on Windows.
When in local mode, executables are linked into
`./node_modules/.bin` so that they can be made available to scripts run
through npm. (For example, so that a test runner will be in the path
when you run `npm test`.)
### Man Pages
When in global mode, man pages are linked into `{prefix}/share/man`.
When in local mode, man pages are not installed.
Man pages are not installed on Windows systems.
### Cache
See `npm-cache(1)`. Cache files are stored in `~/.npm` on Posix, or
`~/npm-cache` on Windows.
This is controlled by the `cache` configuration param.
### Temp Files
Temporary files are stored by default in the folder specified by the
`tmp` config, which defaults to the TMPDIR, TMP, or TEMP environment
variables, or `/tmp` on Unix and `c:\windows\temp` on Windows.
Temp files are given a unique folder under this root for each run of the
program, and are deleted upon successful exit.
## More Information
When installing locally, npm first tries to find an appropriate
`prefix` folder. This is so that `npm install foo@1.2.3` will install
to the sensible root of your package, even if you happen to have `cd`ed
into some other folder.
Starting at the $PWD, npm will walk up the folder tree checking for a
folder that contains either a `package.json` file, or a `node_modules`
folder. If such a thing is found, then that is treated as the effective
"current directory" for the purpose of running npm commands. (This
behavior is inspired by and similar to git's .git-folder seeking
logic when running git commands in a working dir.)
If no package root is found, then the current folder is used.
When you run `npm install foo@1.2.3`, then the package is loaded into
the cache, and then unpacked into `./node_modules/foo`. Then, any of
foo's dependencies are similarly unpacked into
`./node_modules/foo/node_modules/...`.
Any bin files are symlinked to `./node_modules/.bin/`, so that they may
be found by npm scripts when necessary.
### Global Installation
If the `global` configuration is set to true, then npm will
install packages "globally".
For global installation, packages are installed roughly the same way,
but using the folders described above.
### Cycles, Conflicts, and Folder Parsimony
Cycles are handled using the property of node's module system that it
walks up the directories looking for `node_modules` folders. So, at every
stage, if a package is already installed in an ancestor `node_modules`
folder, then it is not installed at the current location.
Consider the case above, where `foo -> bar -> baz`. Imagine if, in
addition to that, baz depended on bar, so you'd have:
`foo -> bar -> baz -> bar -> baz ...`. However, since the folder
structure is: `foo/node_modules/bar/node_modules/baz`, there's no need to
put another copy of bar into `.../baz/node_modules`, since when it calls
require("bar"), it will get the copy that is installed in
`foo/node_modules/bar`.
This shortcut is only used if the exact same
version would be installed in multiple nested `node_modules` folders. It
is still possible to have `a/node_modules/b/node_modules/a` if the two
"a" packages are different versions. However, without repeating the
exact same package multiple times, an infinite regress will always be
prevented.
Another optimization can be made by installing dependencies at the
highest level possible, below the localized "target" folder.
#### Example
Consider this dependency graph:
foo
+-- blerg@1.2.5
+-- bar@1.2.3
| +-- blerg@1.x (latest=1.3.7)
| +-- baz@2.x
| | `-- quux@3.x
| | `-- bar@1.2.3 (cycle)
| `-- asdf@*
`-- baz@1.2.3
`-- quux@3.x
`-- bar
In this case, we might expect a folder structure like this:
foo
+-- node_modules
+-- blerg (1.2.5) <---[A]
+-- bar (1.2.3) <---[B]
| `-- node_modules
| +-- baz (2.0.2) <---[C]
| | `-- node_modules
| | `-- quux (3.2.0)
| `-- asdf (2.3.4)
`-- baz (1.2.3) <---[D]
`-- node_modules
`-- quux (3.2.0) <---[E]
Since foo depends directly on `bar@1.2.3` and `baz@1.2.3`, those are
installed in foo's `node_modules` folder.
Even though the latest copy of blerg is 1.3.7, foo has a specific
dependency on version 1.2.5. So, that gets installed at [A]. Since the
parent installation of blerg satisfies bar's dependency on `blerg@1.x`,
it does not install another copy under [B].
Bar [B] also has dependencies on baz and asdf, so those are installed in
bar's `node_modules` folder. Because it depends on `baz@2.x`, it cannot
re-use the `baz@1.2.3` installed in the parent `node_modules` folder [D],
and must install its own copy [C].
Underneath bar, the `baz -> quux -> bar` dependency creates a cycle.
However, because bar is already in quux's ancestry [B], it does not
unpack another copy of bar into that folder.
Underneath `foo -> baz` [D], quux's [E] folder tree is empty, because its
dependency on bar is satisfied by the parent folder copy installed at [B].
For a graphical breakdown of what is installed where, use `npm ls`.
### Publishing
Upon publishing, npm will look in the `node_modules` folder. If any of
the items there are not in the `bundledDependencies` array, then they will
not be included in the package tarball.
This allows a package maintainer to install all of their dependencies
(and dev dependencies) locally, but only re-publish those items that
cannot be found elsewhere. See `npm-json(1)` for more information.
## SEE ALSO
* npm-faq(1)
* npm-json(1)
* npm-install(1)
* npm-pack(1)
* npm-cache(1)
* npm-config(1)
* npm-publish(1)

View File

@@ -1,209 +0,0 @@
npm-folders(1) -- Folder Structures Used by npm
===============================================
## DESCRIPTION
npm puts various things on your computer. That's its job.
This document will tell you what it puts where.
### tl;dr
* Local install (default): puts stuff in `./node_modules` of the current
package root.
* Global install (with `-g`): puts stuff in /usr/local or wherever node
is installed.
* Install it **locally** if you're going to `require()` it.
* Install it **globally** if you're going to run it on the command line.
* If you need both, then install it in both places, or use `npm link`.
### prefix Configuration
The `prefix` config defaults to the location where node is installed.
On most systems, this is `/usr/local`, and most of the time is the same
as node's `process.installPrefix`.
On windows, this is the exact location of the node.exe binary. On Unix
systems, it's one level up, since node is typically installed at
`{prefix}/bin/node` rather than `{prefix}/node.exe`.
When the `global` flag is set, npm installs things into this prefix.
When it is not set, it uses the root of the current package, or the
current working directory if not in a package already.
### Node Modules
Packages are dropped into the `node_modules` folder under the `prefix`.
When installing locally, this means that you can
`require("packagename")` to load its main module, or
`require("packagename/lib/path/to/sub/module")` to load other modules.
Global installs on Unix systems go to `{prefix}/lib/node_modules`.
Global installs on Windows go to `{prefix}/node_modules` (that is, no
`lib` folder.)
If you wish to `require()` a package, then install it locally.
### Executables
When in global mode, executables are linked into `{prefix}/bin` on Unix,
or directly into `{prefix}` on Windows.
When in local mode, executables are linked into
`./node_modules/.bin` so that they can be made available to scripts run
through npm. (For example, so that a test runner will be in the path
when you run `npm test`.)
### Man Pages
When in global mode, man pages are linked into `{prefix}/share/man`.
When in local mode, man pages are not installed.
Man pages are not installed on Windows systems.
### Cache
See `npm-cache(1)`. Cache files are stored in `~/.npm` on Posix, or
`~/npm-cache` on Windows.
This is controlled by the `cache` configuration param.
### Temp Files
Temporary files are stored by default in the folder specified by the
`tmp` config, which defaults to the TMPDIR, TMP, or TEMP environment
variables, or `/tmp` on Unix and `c:\windows\temp` on Windows.
Temp files are given a unique folder under this root for each run of the
program, and are deleted upon successful exit.
## More Information
When installing locally, npm first tries to find an appropriate
`prefix` folder. This is so that `npm install foo@1.2.3` will install
to the sensible root of your package, even if you happen to have `cd`ed
into some other folder.
Starting at the $PWD, npm will walk up the folder tree checking for a
folder that contains either a `package.json` file, or a `node_modules`
folder. If such a thing is found, then that is treated as the effective
"current directory" for the purpose of running npm commands. (This
behavior is inspired by and similar to git's .git-folder seeking
logic when running git commands in a working dir.)
If no package root is found, then the current folder is used.
When you run `npm install foo@1.2.3`, then the package is loaded into
the cache, and then unpacked into `./node_modules/foo`. Then, any of
foo's dependencies are similarly unpacked into
`./node_modules/foo/node_modules/...`.
Any bin files are symlinked to `./node_modules/.bin/`, so that they may
be found by npm scripts when necessary.
### Global Installation
If the `global` configuration is set to true, then npm will
install packages "globally".
For global installation, packages are installed roughly the same way,
but using the folders described above.
### Cycles, Conflicts, and Folder Parsimony
Cycles are handled using the property of node's module system that it
walks up the directories looking for `node_modules` folders. So, at every
stage, if a package is already installed in an ancestor `node_modules`
folder, then it is not installed at the current location.
Consider the case above, where `foo -> bar -> baz`. Imagine if, in
addition to that, baz depended on bar, so you'd have:
`foo -> bar -> baz -> bar -> baz ...`. However, since the folder
structure is: `foo/node_modules/bar/node_modules/baz`, there's no need to
put another copy of bar into `.../baz/node_modules`, since when it calls
require("bar"), it will get the copy that is installed in
`foo/node_modules/bar`.
This shortcut is only used if the exact same
version would be installed in multiple nested `node_modules` folders. It
is still possible to have `a/node_modules/b/node_modules/a` if the two
"a" packages are different versions. However, without repeating the
exact same package multiple times, an infinite regress will always be
prevented.
Another optimization can be made by installing dependencies at the
highest level possible, below the localized "target" folder.
#### Example
Consider this dependency graph:
foo
+-- blerg@1.2.5
+-- bar@1.2.3
| +-- blerg@1.x (latest=1.3.7)
| +-- baz@2.x
| | `-- quux@3.x
| | `-- bar@1.2.3 (cycle)
| `-- asdf@*
`-- baz@1.2.3
`-- quux@3.x
`-- bar
In this case, we might expect a folder structure like this:
foo
+-- node_modules
+-- blerg (1.2.5) <---[A]
+-- bar (1.2.3) <---[B]
| +-- node_modules
| | `-- baz (2.0.2) <---[C]
| | `-- node_modules
| | `-- quux (3.2.0)
| `-- asdf (2.3.4)
`-- baz (1.2.3) <---[D]
`-- node_modules
`-- quux (3.2.0) <---[E]
Since foo depends directly on bar@1.2.3 and baz@1.2.3, those are
installed in foo's `node_modules` folder.
Even though the latest copy of blerg is 1.3.7, foo has a specific
dependency on version 1.2.5. So, that gets installed at [A]. Since the
parent installation of blerg satisfie's bar's dependency on blerg@1.x,
it does not install another copy under [B].
Bar [B] also has dependencies on baz and asdf, so those are installed in
bar's `node_modules` folder. Because it depends on `baz@2.x`, it cannot
re-use the `baz@1.2.3` installed in the parent `node_modules` folder [D],
and must install its own copy [C].
Underneath bar, the `baz->quux->bar` dependency creates a cycle.
However, because `bar` is already in `quux`'s ancestry [B], it does not
unpack another copy of bar into that folder.
Underneath `foo->baz` [D], quux's [E] folder tree is empty, because its
dependency on bar is satisfied by the parent folder copy installed at [B].
For a graphical breakdown of what is installed where, use `npm ls`.
### Publishing
Upon publishing, npm will look in the `node_modules` folder. If any of
the items there are not in the `bundledDependencies` array, then they will
not be included in the package tarball.
This allows a package maintainer to install all of their dependencies
(and dev dependencies) locally, but only re-publish those items that
cannot be found elsewhere. See `npm-json(1)` for more information.
## SEE ALSO
* npm-faq(1)
* npm-json(1)
* npm-install(1)
* npm-pack(1)
* npm-cache(1)
* npm-config(1)
* npm-publish(1)

View File

@@ -1,35 +0,0 @@
npm-help-search(1) -- Search npm help documentation
===================================================
## SYNOPSIS
npm help-search some search terms
## DESCRIPTION
This command will search the npm markdown documentation files for the
terms provided, and then list the results, sorted by relevance.
If only one result is found, then it will show that help topic.
If the argument to `npm help` is not a known help topic, then it will
call `help-search`. It is rarely if ever necessary to call this
command directly.
## CONFIGURATION
### long
* Type: Boolean
* Default false
If true, the "long" flag will cause help-search to output context around
where the terms were found in the documentation.
If false, then help-search will just list out the help topics found.
## SEE ALSO
* npm(1)
* npm-faq(1)
* npm-help(1)

View File

@@ -1,38 +0,0 @@
npm-help(1) -- Get help on npm
==============================
## SYNOPSIS
npm help <topic>
npm help some search terms
## DESCRIPTION
If supplied a topic, then show the appropriate documentation page.
If the topic does not exist, or if multiple terms are provided, then run
the `help-search` command to find a match. Note that, if `help-search`
finds a single subject, then it will run `help` on that topic, so unique
matches are equivalent to specifying a topic name.
## CONFIGURATION
### viewer
* Default: "man" on Posix, "browser" on Windows
* Type: path
The program to use to view help content.
Set to `"browser"` to view html help content in the default web browser.
## SEE ALSO
* npm(1)
* README
* npm-faq(1)
* npm-folders(1)
* npm-config(1)
* npm-json(1)
* npm-help-search(1)
* npm-index(1)

View File

@@ -1,393 +0,0 @@
npm-index(1) -- Index of all npm documentation
==============================================
## npm-README(1)
node package manager
# Command Line Documentation
## npm-adduser(1)
Add a registry user account
## npm-bin(1)
Display npm bin folder
## npm-bugs(1)
Bugs for a package in a web browser maybe
## npm-build(1)
Build a package
## npm-bundle(1)
REMOVED
## npm-cache(1)
Manipulates packages cache
## npm-changelog(1)
Changes
## npm-coding-style(1)
npm's "funny" coding style
## npm-completion(1)
Tab Completion for npm
## npm-config(1)
Manage the npm configuration file
## npm-dedupe(1)
Reduce duplication
## npm-deprecate(1)
Deprecate a version of a package
## npm-developers(1)
Developer Guide
## npm-disputes(1)
Handling Module Name Disputes
## npm-docs(1)
Docs for a package in a web browser maybe
## npm-edit(1)
Edit an installed package
## npm-explore(1)
Browse an installed package
## npm-faq(1)
Frequently Asked Questions
## npm-folders(1)
Folder Structures Used by npm
## npm-global(1)
Folder Structures Used by npm
## npm-help-search(1)
Search npm help documentation
## npm-help(1)
Get help on npm
## npm-init(1)
Interactively create a package.json file
## npm-install(1)
Install a package
## npm-json(1)
Specifics of npm's package.json handling
## npm-link(1)
Symlink a package folder
## npm-ls(1)
List installed packages
## npm-npm(1)
node package manager
## npm-outdated(1)
Check for outdated packages
## npm-owner(1)
Manage package owners
## npm-pack(1)
Create a tarball from a package
## npm-prefix(1)
Display prefix
## npm-prune(1)
Remove extraneous packages
## npm-publish(1)
Publish a package
## npm-rebuild(1)
Rebuild a package
## npm-registry(1)
The JavaScript Package Registry
## npm-removing-npm(1)
Cleaning the Slate
## npm-restart(1)
Start a package
## npm-rm(1)
Remove a package
## npm-root(1)
Display npm root
## npm-run-script(1)
Run arbitrary package scripts
## npm-scripts(1)
How npm handles the "scripts" field
## npm-search(1)
Search for packages
## npm-semver(1)
The semantic versioner for npm
## npm-shrinkwrap(1)
Lock down dependency versions
## npm-star(1)
Mark your favorite packages
## npm-stars(1)
View packages marked as favorites
## npm-start(1)
Start a package
## npm-stop(1)
Stop a package
## npm-submodule(1)
Add a package as a git submodule
## npm-tag(1)
Tag a published version
## npm-test(1)
Test a package
## npm-uninstall(1)
Remove a package
## npm-unpublish(1)
Remove a package from the registry
## npm-update(1)
Update a package
## npm-version(1)
Bump a package version
## npm-view(1)
View registry info
## npm-whoami(1)
Display npm username
# API Documentation
## npm-bin(3)
Display npm bin folder
## npm-bugs(3)
Bugs for a package in a web browser maybe
## npm-commands(3)
npm commands
## npm-config(3)
Manage the npm configuration files
## npm-deprecate(3)
Deprecate a version of a package
## npm-docs(3)
Docs for a package in a web browser maybe
## npm-edit(3)
Edit an installed package
## npm-explore(3)
Browse an installed package
## npm-help-search(3)
Search the help pages
## npm-init(3)
Interactively create a package.json file
## npm-install(3)
install a package programmatically
## npm-link(3)
Symlink a package folder
## npm-load(3)
Load config settings
## npm-ls(3)
List installed packages
## npm-npm(3)
node package manager
## npm-outdated(3)
Check for outdated packages
## npm-owner(3)
Manage package owners
## npm-pack(3)
Create a tarball from a package
## npm-prefix(3)
Display prefix
## npm-prune(3)
Remove extraneous packages
## npm-publish(3)
Publish a package
## npm-rebuild(3)
Rebuild a package
## npm-restart(3)
Start a package
## npm-root(3)
Display npm root
## npm-run-script(3)
Run arbitrary package scripts
## npm-search(3)
Search for packages
## npm-shrinkwrap(3)
programmatically generate package shrinkwrap file
## npm-start(3)
Start a package
## npm-stop(3)
Stop a package
## npm-submodule(3)
Add a package as a git submodule
## npm-tag(3)
Tag a published version
## npm-test(3)
Test a package
## npm-uninstall(3)
uninstall a package programmatically
## npm-unpublish(3)
Remove a package from the registry
## npm-update(3)
Update a package
## npm-version(3)
Bump a package version
## npm-view(3)
View registry info
## npm-whoami(3)
Display npm username

View File

@@ -1,25 +0,0 @@
npm-init(1) -- Interactively create a package.json file
=======================================================
## SYNOPSIS
npm init
## DESCRIPTION
This will ask you a bunch of questions, and then write a package.json for you.
It attempts to make reasonable guesses about what you want things to be set to,
and then writes a package.json file with the options you've selected.
If you already have a package.json file, it'll read that first, and default to
the options in there.
It is strictly additive, so it does not delete options from your package.json
without a really good reason to do so.
## SEE ALSO
* <https://github.com/isaacs/init-package-json>
* npm-json(1)
* npm-version(1)

View File

@@ -1,242 +0,0 @@
npm-install(1) -- Install a package
===================================
## SYNOPSIS
npm install (with no args in a package dir)
npm install <tarball file>
npm install <tarball url>
npm install <folder>
npm install <name> [--save|--save-dev|--save-optional]
npm install <name>@<tag>
npm install <name>@<version>
npm install <name>@<version range>
npm install <name>@<version range>
## DESCRIPTION
This command installs a package, and any packages that it depends on. If the
package has a shrinkwrap file, the installation of dependencies will be driven
by that. See npm-shrinkwrap(1).
A `package` is:
* a) a folder containing a program described by a package.json file
* b) a gzipped tarball containing (a)
* c) a url that resolves to (b)
* d) a `<name>@<version>` that is published on the registry with (c)
* e) a `<name>@<tag>` that points to (d)
* f) a `<name>` that has a "latest" tag satisfying (e)
* g) a `<git remote url>` that resolves to (b)
Even if you never publish your package, you can still get a lot of
benefits of using npm if you just want to write a node program (a), and
perhaps if you also want to be able to easily install it elsewhere
after packing it up into a tarball (b).
* `npm install` (in package directory, no arguments):
Install the dependencies in the local node_modules folder.
In global mode (ie, with `-g` or `--global` appended to the command),
it installs the current package context (ie, the current working
directory) as a global package.
* `npm install <folder>`:
Install a package that is sitting in a folder on the filesystem.
* `npm install <tarball file>`:
Install a package that is sitting on the filesystem. Note: if you just want
to link a dev directory into your npm root, you can do this more easily by
using `npm link`.
Example:
npm install ./package.tgz
* `npm install <tarball url>`:
Fetch the tarball url, and then install it. In order to distinguish between
this and other options, the argument must start with "http://" or "https://"
Example:
npm install https://github.com/indexzero/forever/tarball/v0.5.6
* `npm install <name> [--save|--save-dev|--save-optional]`:
Do a `<name>@<tag>` install, where `<tag>` is the "tag" config. (See
`npm-config(1)`.)
In most cases, this will install the latest version
of the module published on npm.
Example:
npm install sax
`npm install` takes 3 exclusive, optional flags which save or update
the package version in your main package.json:
* `--save`: Package will appear in your `dependencies`.
* `--save-dev`: Package will appear in your `devDependencies`.
* `--save-optional`: Package will appear in your `optionalDependencies`.
Examples:
npm install sax --save
npm install node-tap --save-dev
npm install dtrace-provider --save-optional
**Note**: If there is a file or folder named `<name>` in the current
working directory, then it will try to install that, and only try to
fetch the package by name if it is not valid.
* `npm install <name>@<tag>`:
Install the version of the package that is referenced by the specified tag.
If the tag does not exist in the registry data for that package, then this
will fail.
Example:
npm install sax@latest
* `npm install <name>@<version>`:
Install the specified version of the package. This will fail if the version
has not been published to the registry.
Example:
npm install sax@0.1.1
* `npm install <name>@<version range>`:
Install a version of the package matching the specified version range. This
will follow the same rules for resolving dependencies described in `npm-json(1)`.
Note that most version ranges must be put in quotes so that your shell will
treat it as a single argument.
Example:
npm install sax@">=0.1.0 <0.2.0"
* `npm install <git remote url>`:
Install a package by cloning a git remote url. The format of the git
url is:
<protocol>://[<user>@]<hostname><separator><path>[#<commit-ish>]
`<protocol>` is one of `git`, `git+ssh`, `git+http`, or
`git+https`. If no `<commit-ish>` is specified, then `master` is
used.
Examples:
git+ssh://git@github.com:isaacs/npm.git#v1.0.27
git+https://isaacs@github.com/isaacs/npm.git
git://github.com/isaacs/npm.git#v1.0.27
You may combine multiple arguments, and even multiple types of arguments.
For example:
npm install sax@">=0.1.0 <0.2.0" bench supervisor
The `--tag` argument will apply to all of the specified install targets.
The `--force` argument will force npm to fetch remote resources even if a
local copy exists on disk.
npm install sax --force
The `--global` argument will cause npm to install the package globally
rather than locally. See `npm-folders(1)`.
The `--link` argument will cause npm to link global installs into the
local space in some cases.
The `--no-bin-links` argument will prevent npm from creating symlinks for
any binaries the package might contain.
The `--no-shrinkwrap` argument, which will ignore an available
shrinkwrap file and use the package.json instead.
The `--nodedir=/path/to/node/source` argument will allow npm to find the
node source code so that npm can compile native modules.
See `npm-config(1)`. Many of the configuration params have some
effect on installation, since that's most of what npm does.
## ALGORITHM
To install a package, npm uses the following algorithm:
install(where, what, family, ancestors)
fetch what, unpack to <where>/node_modules/<what>
for each dep in what.dependencies
resolve dep to precise version
for each dep@version in what.dependencies
not in <where>/node_modules/<what>/node_modules/*
and not in <family>
add precise version deps to <family>
install(<where>/node_modules/<what>, dep, family)
For this `package{dep}` structure: `A{B,C}, B{C}, C{D}`,
this algorithm produces:
A
+-- B
`-- C
`-- D
That is, the dependency from B to C is satisfied by the fact that A
already caused C to be installed at a higher level.
See npm-folders(1) for a more detailed description of the specific
folder structures that npm creates.
### Limitations of npm's Install Algorithm
There are some very rare and pathological edge-cases where a cycle can
cause npm to try to install a never-ending tree of packages. Here is
the simplest case:
A -> B -> A' -> B' -> A -> B -> A' -> B' -> A -> ...
where `A` is some version of a package, and `A'` is a different version
of the same package. Because `B` depends on a different version of `A`
than the one that is already in the tree, it must install a separate
copy. The same is true of `A'`, which must install `B'`. Because `B'`
depends on the original version of `A`, which has been overridden, the
cycle falls into infinite regress.
To avoid this situation, npm flat-out refuses to install any
`name@version` that is already present anywhere in the tree of package
folder ancestors. A more correct, but more complex, solution would be
to symlink the existing version into the new location. If this ever
affects a real use-case, it will be investigated.
## SEE ALSO
* npm-folders(1)
* npm-update(1)
* npm-link(1)
* npm-rebuild(1)
* npm-scripts(1)
* npm-build(1)
* npm-config(1)
* npm-registry(1)
* npm-folders(1)
* npm-tag(1)
* npm-rm(1)
* npm-shrinkwrap(1)

View File

@@ -1,587 +0,0 @@
npm-json(1) -- Specifics of npm's package.json handling
=======================================================
## DESCRIPTION
This document is all you need to know about what's required in your package.json
file. It must be actual JSON, not just a JavaScript object literal.
A lot of the behavior described in this document is affected by the config
settings described in `npm-config(1)`.
## DEFAULT VALUES
npm will default some values based on package contents.
* `"scripts": {"start": "node server.js"}`
If there is a `server.js` file in the root of your package, then npm
will default the `start` command to `node server.js`.
* `"scripts":{"preinstall": "node-waf clean || true; node-waf configure build"}`
If there is a `wscript` file in the root of your package, npm will
default the `preinstall` command to compile using node-waf.
* `"scripts":{"preinstall": "node-gyp rebuild"}`
If there is a `binding.gyp` file in the root of your package, npm will
default the `preinstall` command to compile using node-gyp.
* `"contributors": [...]`
If there is an `AUTHORS` file in the root of your package, npm will
treat each line as a `Name <email> (url)` format, where email and url
are optional. Lines which start with a `#` or are blank, will be
ignored.
## name
The *most* important things in your package.json are the name and version fields.
Those are actually required, and your package won't install without
them. The name and version together form an identifier that is assumed
to be completely unique. Changes to the package should come along with
changes to the version.
The name is what your thing is called. Some tips:
* Don't put "js" or "node" in the name. It's assumed that it's js, since you're
writing a package.json file, and you can specify the engine using the "engines"
field. (See below.)
* The name ends up being part of a URL, an argument on the command line, and a
folder name. Any name with non-url-safe characters will be rejected.
Also, it can't start with a dot or an underscore.
* The name will probably be passed as an argument to require(), so it should
be something short, but also reasonably descriptive.
* You may want to check the npm registry to see if there's something by that name
already, before you get too attached to it. http://registry.npmjs.org/
## version
The *most* important things in your package.json are the name and version fields.
Those are actually required, and your package won't install without
them. The name and version together form an identifier that is assumed
to be completely unique. Changes to the package should come along with
changes to the version.
Version must be parseable by
[node-semver](https://github.com/isaacs/node-semver), which is bundled
with npm as a dependency. (`npm install semver` to use it yourself.)
Here's how npm's semver implementation deviates from what's on semver.org:
* Versions can start with "v"
* A numeric item separated from the main three-number version by a hyphen
will be interpreted as a "build" number, and will *increase* the version.
But, if the tag is not a number separated by a hyphen, then it's treated
as a pre-release tag, and is *less than* the version without a tag.
So, `0.1.2-7 > 0.1.2-7-beta > 0.1.2-6 > 0.1.2 > 0.1.2beta`
This is a little bit confusing to explain, but matches what you see in practice
when people create tags in git like "v1.2.3" and then do "git describe" to generate
a patch version.
## description
Put a description in it. It's a string. This helps people discover your
package, as it's listed in `npm search`.
## keywords
Put keywords in it. It's an array of strings. This helps people
discover your package as it's listed in `npm search`.
## homepage
The url to the project homepage.
**NOTE**: This is *not* the same as "url". If you put a "url" field,
then the registry will think it's a redirection to your package that has
been published somewhere else, and spit at you.
Literally. Spit. I'm so not kidding.
## bugs
The url to your project's issue tracker and / or the email address to which
issues should be reported. These are helpful for people who encounter issues
with your package.
It should look like this:
{ "url" : "http://github.com/owner/project/issues"
, "email" : "project@hostname.com"
}
You can specify either one or both values. If you want to provide only a url,
you can specify the value for "bugs" as a simple string instead of an object.
If a url is provided, it will be used by the `npm bugs` command.
## license
You should specify a license for your package so that people know how they are
permitted to use it, and any restrictions you're placing on it.
The simplest way, assuming you're using a common license such as BSD or MIT, is
to just specify the name of the license you're using, like this:
{ "license" : "BSD" }
If you have more complex licensing terms, or you want to provide more detail
in your package.json file, you can use the more verbose plural form, like this:
"licenses" : [
{ "type" : "MyLicense"
, "url" : "http://github.com/owner/project/path/to/license"
}
]
It's also a good idea to include a license file at the top level in your package.
## people fields: author, contributors
The "author" is one person. "contributors" is an array of people. A "person"
is an object with a "name" field and optionally "url" and "email", like this:
{ "name" : "Barney Rubble"
, "email" : "b@rubble.com"
, "url" : "http://barnyrubble.tumblr.com/"
}
Or you can shorten that all into a single string, and npm will parse it for you:
"Barney Rubble <b@rubble.com> (http://barnyrubble.tumblr.com/)
Both email and url are optional either way.
npm also sets a top-level "maintainers" field with your npm user info.
## files
The "files" field is an array of files to include in your project. If
you name a folder in the array, then it will also include the files
inside that folder. (Unless they would be ignored by another rule.)
You can also provide a ".npmignore" file in the root of your package,
which will keep files from being included, even if they would be picked
up by the files array. The ".npmignore" file works just like a
".gitignore".
## main
The main field is a module ID that is the primary entry point to your program.
That is, if your package is named `foo`, and a user installs it, and then does
`require("foo")`, then your main module's exports object will be returned.
This should be a module ID relative to the root of your package folder.
For most modules, it makes the most sense to have a main script and often not
much else.
## bin
A lot of packages have one or more executable files that they'd like to
install into the PATH. npm makes this pretty easy (in fact, it uses this
feature to install the "npm" executable.)
To use this, supply a `bin` field in your package.json which is a map of
command name to local file name. On install, npm will symlink that file into
`prefix/bin` for global installs, or `./node_modules/.bin/` for local
installs.
For example, npm has this:
{ "bin" : { "npm" : "./cli.js" } }
So, when you install npm, it'll create a symlink from the `cli.js` script to
`/usr/local/bin/npm`.
If you have a single executable, and its name should be the name
of the package, then you can just supply it as a string. For example:
{ "name": "my-program"
, "version": "1.2.5"
, "bin": "./path/to/program" }
would be the same as this:
{ "name": "my-program"
, "version": "1.2.5"
, "bin" : { "my-program" : "./path/to/program" } }
## man
Specify either a single file or an array of filenames to put in place for the
`man` program to find.
If only a single file is provided, then it's installed such that it is the
result from `man <pkgname>`, regardless of its actual filename. For example:
{ "name" : "foo"
, "version" : "1.2.3"
, "description" : "A packaged foo fooer for fooing foos"
, "main" : "foo.js"
, "man" : "./man/doc.1"
}
would link the `./man/doc.1` file in such that it is the target for `man foo`
If the filename doesn't start with the package name, then it's prefixed.
So, this:
{ "name" : "foo"
, "version" : "1.2.3"
, "description" : "A packaged foo fooer for fooing foos"
, "main" : "foo.js"
, "man" : [ "./man/foo.1", "./man/bar.1" ]
}
will create files to do `man foo` and `man foo-bar`.
Man files must end with a number, and optionally a `.gz` suffix if they are
compressed. The number dictates which man section the file is installed into.
{ "name" : "foo"
, "version" : "1.2.3"
, "description" : "A packaged foo fooer for fooing foos"
, "main" : "foo.js"
, "man" : [ "./man/foo.1", "./man/foo.2" ]
}
will create entries for `man foo` and `man 2 foo`
## directories
The CommonJS [Packages](http://wiki.commonjs.org/wiki/Packages/1.0) spec details a
few ways that you can indicate the structure of your package using a `directories`
hash. If you look at [npm's package.json](http://registry.npmjs.org/npm/latest),
you'll see that it has directories for doc, lib, and man.
In the future, this information may be used in other creative ways.
### directories.lib
Tell people where the bulk of your library is. Nothing special is done
with the lib folder in any way, but it's useful meta info.
### directories.bin
If you specify a "bin" directory, then all the files in that folder will
be used as the "bin" hash.
If you have a "bin" hash already, then this has no effect.
### directories.man
A folder that is full of man pages. Sugar to generate a "man" array by
walking the folder.
### directories.doc
Put markdown files in here. Eventually, these will be displayed nicely,
maybe, someday.
### directories.example
Put example scripts in here. Someday, it might be exposed in some clever way.
## repository
Specify the place where your code lives. This is helpful for people who
want to contribute. If the git repo is on github, then the `npm docs`
command will be able to find you.
Do it like this:
"repository" :
{ "type" : "git"
, "url" : "http://github.com/isaacs/npm.git"
}
"repository" :
{ "type" : "svn"
, "url" : "http://v8.googlecode.com/svn/trunk/"
}
The URL should be a publicly available (perhaps read-only) url that can be handed
directly to a VCS program without any modification. It should not be a url to an
html project page that you put in your browser. It's for computers.
## scripts
The "scripts" member is an object hash of script commands that are run
at various times in the lifecycle of your package. The key is the lifecycle
event, and the value is the command to run at that point.
See `npm-scripts(1)` to find out more about writing package scripts.
## config
A "config" hash can be used to set configuration
parameters used in package scripts that persist across upgrades. For
instance, if a package had the following:
{ "name" : "foo"
, "config" : { "port" : "8080" } }
and then had a "start" command that then referenced the
`npm_package_config_port` environment variable, then the user could
override that by doing `npm config set foo:port 8001`.
See `npm-config(1)` and `npm-scripts(1)` for more on package
configs.
## dependencies
Dependencies are specified with a simple hash of package name to version
range. The version range is EITHER a string which has one or more
space-separated descriptors, OR a range like "fromVersion - toVersion"
**Please do not put test harnesses in your `dependencies` hash.** See
`devDependencies`, below.
Version range descriptors may be any of the following styles, where "version"
is a semver compatible version identifier.
* `version` Must match `version` exactly
* `=version` Same as just `version`
* `>version` Must be greater than `version`
* `>=version` etc
* `<version`
* `<=version`
* `~version` See 'Tilde Version Ranges' below
* `1.2.x` See 'X Version Ranges' below
* `http://...` See 'URLs as Dependencies' below
* `*` Matches any version
* `""` (just an empty string) Same as `*`
* `version1 - version2` Same as `>=version1 <=version2`.
* `range1 || range2` Passes if either range1 or range2 are satisfied.
* `git...` See 'Git URLs as Dependencies' below
For example, these are all valid:
{ "dependencies" :
{ "foo" : "1.0.0 - 2.9999.9999"
, "bar" : ">=1.0.2 <2.1.2"
, "baz" : ">1.0.2 <=2.3.4"
, "boo" : "2.0.1"
, "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0"
, "asd" : "http://asdf.com/asdf.tar.gz"
, "til" : "~1.2"
, "elf" : "~1.2.3"
, "two" : "2.x"
, "thr" : "3.3.x"
}
}
### Tilde Version Ranges
A range specifier starting with a tilde `~` character is matched against
a version in the following fashion.
* The version must be at least as high as the range.
* The version must be less than the next major revision above the range.
For example, the following are equivalent:
* `"~1.2.3" = ">=1.2.3 <1.3.0"`
* `"~1.2" = ">=1.2.0 <1.3.0"`
* `"~1" = ">=1.0.0 <1.1.0"`
### X Version Ranges
An "x" in a version range specifies that the version number must start
with the supplied digits, but any digit may be used in place of the x.
The following are equivalent:
* `"1.2.x" = ">=1.2.0 <1.3.0"`
* `"1.x.x" = ">=1.0.0 <2.0.0"`
* `"1.2" = "1.2.x"`
* `"1.x" = "1.x.x"`
* `"1" = "1.x.x"`
You may not supply a comparator with a version containing an x. Any
digits after the first "x" are ignored.
### URLs as Dependencies
Starting with npm version 0.2.14, you may specify a tarball URL in place
of a version range.
This tarball will be downloaded and installed locally to your package at
install time.
### Git URLs as Dependencies
Git urls can be of the form:
git://github.com/user/project.git#commit-ish
git+ssh://user@hostname:project.git#commit-ish
git+ssh://user@hostname/project.git#commit-ish
git+http://user@hostname/project/blah.git#commit-ish
git+https://user@hostname/project/blah.git#commit-ish
The `commit-ish` can be any tag, sha, or branch which can be supplied as
an argument to `git checkout`. The default is `master`.
## devDependencies
If someone is planning on downloading and using your module in their
program, then they probably don't want or need to download and build
the external test or documentation framework that you use.
In this case, it's best to list these additional items in a
`devDependencies` hash.
These things will be installed whenever the `--dev` configuration flag
is set. This flag is set automatically when doing `npm link` or when doing
`npm install` from the root of a package, and can be managed like any other npm
configuration param. See `npm-config(1)` for more on the topic.
## bundledDependencies
Array of package names that will be bundled when publishing the package.
If this is spelled `"bundleDependencies"`, then that is also honorable.
## optionalDependencies
If a dependency can be used, but you would like npm to proceed if it
cannot be found or fails to install, then you may put it in the
`optionalDependencies` hash. This is a map of package name to version
or url, just like the `dependencies` hash. The difference is that
failure is tolerated.
It is still your program's responsibility to handle the lack of the
dependency. For example, something like this:
try {
var foo = require('foo')
var fooVersion = require('foo/package.json').version
} catch (er) {
foo = null
}
if ( notGoodFooVersion(fooVersion) ) {
foo = null
}
// .. then later in your program ..
if (foo) {
foo.doFooThings()
}
Entries in `optionalDependencies` will override entries of the same name in
`dependencies`, so it's usually best to only put in one place.
## engines
You can specify the version of node that your stuff works on:
{ "engines" : { "node" : ">=0.1.27 <0.1.30" } }
And, like with dependencies, if you don't specify the version (or if you
specify "\*" as the version), then any version of node will do.
If you specify an "engines" field, then npm will require that "node" be
somewhere on that list. If "engines" is omitted, then npm will just assume
that it works on node.
You can also use the "engines" field to specify which versions of npm
are capable of properly installing your program. For example:
{ "engines" : { "npm" : "~1.0.20" } }
Note that, unless the user has set the `engine-strict` config flag, this
field is advisory only.
## engineStrict
If you are sure that your module will *definitely not* run properly on
versions of Node/npm other than those specified in the `engines` hash,
then you can set `"engineStrict": true` in your package.json file.
This will override the user's `engine-strict` config setting.
Please do not do this unless you are really very very sure. If your
engines hash is something overly restrictive, you can quite easily and
inadvertently lock yourself into obscurity and prevent your users from
updating to new versions of Node. Consider this choice carefully. If
people abuse it, it will be removed in a future version of npm.
## os
You can specify which operating systems your
module will run on:
"os" : [ "darwin", "linux" ]
You can also blacklist instead of whitelist operating systems,
just prepend the blacklisted os with a '!':
"os" : [ "!win32" ]
The host operating system is determined by `process.platform`
It is allowed to both blacklist, and whitelist, although there isn't any
good reason to do this.
## cpu
If your code only runs on certain cpu architectures,
you can specify which ones.
"cpu" : [ "x64", "ia32" ]
Like the `os` option, you can also blacklist architectures:
"cpu" : [ "!arm", "!mips" ]
The host architecture is determined by `process.arch`
## preferGlobal
If your package is primarily a command-line application that should be
installed globally, then set this value to `true` to provide a warning
if it is installed locally.
It doesn't actually prevent users from installing it locally, but it
does help prevent some confusion if it doesn't work as expected.
## private
If you set `"private": true` in your package.json, then npm will refuse
to publish it.
This is a way to prevent accidental publication of private repositories.
If you would like to ensure that a given package is only ever published
to a specific registry (for example, an internal registry),
then use the `publishConfig` hash described below
to override the `registry` config param at publish-time.
## publishConfig
This is a set of config values that will be used at publish-time. It's
especially handy if you want to set the tag or registry, so that you can
ensure that a given package is not tagged with "latest" or published to
the global public registry by default.
Any config values can be overridden, but of course only "tag" and
"registry" probably matter for the purposes of publishing.
See `npm-config(1)` to see the list of config options that can be
overridden.
## SEE ALSO
* npm-semver(1)
* npm-init(1)
* npm-version(1)
* npm-config(1)
* npm-help(1)
* npm-faq(1)
* npm-install(1)
* npm-publish(1)
* npm-rm(1)

View File

@@ -1,60 +0,0 @@
npm-link(1) -- Symlink a package folder
=======================================
## SYNOPSIS
npm link (in package folder)
npm link <pkgname>
## DESCRIPTION
Package linking is a two-step process.
First, `npm link` in a package folder will create a globally-installed
symbolic link from `prefix/package-name` to the current folder.
Next, in some other location, `npm link package-name` will create a
symlink from the local `node_modules` folder to the global symlink.
Note that `package-name` is taken from `package.json` ,
not from directory name.
When creating tarballs for `npm publish`, the linked packages are
"snapshotted" to their current state by resolving the symbolic links.
This is
handy for installing your own stuff, so that you can work on it and test it
iteratively without having to continually rebuild.
For example:
cd ~/projects/node-redis # go into the package directory
npm link # creates global link
cd ~/projects/node-bloggy # go into some other package directory.
npm link redis # link-install the package
Now, any changes to ~/projects/node-redis will be reflected in
~/projects/node-bloggy/node_modules/redis/
You may also shortcut the two steps in one. For example, to do the
above use-case in a shorter way:
cd ~/projects/node-bloggy # go into the dir of your main project
npm link ../node-redis # link the dir of your dependency
The second line is the equivalent of doing:
(cd ../node-redis; npm link)
npm link redis
That is, it first creates a global link, and then links the global
installation target into your project's `node_modules` folder.
## SEE ALSO
* npm-developers(1)
* npm-faq(1)
* npm-json(1)
* npm-install(1)
* npm-folders(1)
* npm-config(1)

View File

@@ -1,68 +0,0 @@
npm-ls(1) -- List installed packages
======================================
## SYNOPSIS
npm list [<pkg> ...]
npm ls [<pkg> ...]
npm la [<pkg> ...]
npm ll [<pkg> ...]
## DESCRIPTION
This command will print to stdout all the versions of packages that are
installed, as well as their dependencies, in a tree-structure.
Positional arguments are `name@version-range` identifiers, which will
limit the results to only the paths to the packages named. Note that
nested packages will *also* show the paths to the specified packages.
For example, running `npm ls promzard` in npm's source tree will show:
npm@@VERSION@ /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
It will show print out extraneous, missing, and invalid packages.
When run as `ll` or `la`, it shows extended information by default.
## CONFIGURATION
### json
* Default: false
* Type: Boolean
Show information in JSON format.
### long
* Default: false
* Type: Boolean
Show extended information.
### parseable
* Default: false
* Type: Boolean
Show parseable output instead of tree view.
### global
* Default: false
* Type: Boolean
List packages in the global install prefix instead of in the current
project.
## SEE ALSO
* npm-config(1)
* npm-folders(1)
* npm-install(1)
* npm-link(1)
* npm-prune(1)
* npm-outdated(1)
* npm-update(1)

38
deps/npm/doc/cli/npm-adduser.md vendored Normal file
View File

@@ -0,0 +1,38 @@
npm-adduser(1) -- Add a registry user account
=============================================
## SYNOPSIS
npm adduser
## DESCRIPTION
Create or verify a user named `<username>` in the npm registry, and
save the credentials to the `.npmrc` file.
The username, password, and email are read in from prompts.
You may use this command to change your email address, but not username
or password.
To reset your password, go to <https://npmjs.org/forgot>
You may use this command multiple times with the same user account to
authorize on a new machine.
## CONFIGURATION
### registry
Default: http://registry.npmjs.org/
The base URL of the npm package registry.
## SEE ALSO
* npm-registry(7)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* npm-owner(1)
* npm-whoami(1)

Some files were not shown because too many files have changed in this diff Show More