diff --git a/.gitignore b/.gitignore
index e00450690da9ed56cc3b7cde6e73a5c768a5cc3d..6581dee9d1f8dbb6179229a004f8ca212738f483 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,6 +45,7 @@ ipch/
/test/addons/doc-*/
email.md
deps/v8-*
+deps/icu
./node_modules
.svn/
@@ -67,3 +68,4 @@ deps/zlib/zlib.target.mk
# test artifacts
tools/faketime
+icu_config.gypi
diff --git a/ChangeLog b/ChangeLog
index 00cc51d4d0ffd4ab2f37ae98e47f89460dda38b9..ef860651fc8f91aafbf8cbe35f60426b73dfff03 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,172 @@
+2014.09.24, Version 0.11.14 (Unstable)
+
+* uv: Upgrade to v1.0.0-rc1
+
+* http_parser: Upgrade to v2.3.0
+
+* npm: Upgrade to v2.0.0
+
+* openssl: Upgrade to v1.0.1i
+
+* v8: Upgrade to 3.26.33
+
+* Add fast path for simple URL parsing (Gabriel Wicke)
+
+* Added support for options parameter in console.dir() (Xavi Magrinyà)
+
+* Cluster: fix shared handles on Windows (Alexis Campailla)
+
+* buffer: Fix incorrect Buffer.compare behavior (Feross Aboukhadijeh)
+
+* buffer: construct new buffer from buffer toJSON() output (cjihrig)
+
+* buffer: improve Buffer constructor (Kang-Hao Kenny)
+
+* build: linking CoreFoundation framework for OSX (Thorsten Lorenz)
+
+* child_process: accept uid/gid everywhere (Fedor Indutny)
+
+* child_process: add path to spawn ENOENT Error (Ryan Cole)
+
+* child_process: copy spawnSync() cwd option to proper buffer (cjihrig)
+
+* child_process: do not access stderr when stdio set to 'ignore' (cjihrig)
+
+* child_process: don't throw on EAGAIN (Charles)
+
+* child_process: don't throw on EMFILE/ENFILE (Ben Noordhuis)
+
+* child_process: use full path for cmd.exe on Win32 (Ed Morley)
+
+* cluster: allow multiple calls to setupMaster() (Ryan Graham)
+
+* cluster: centralize removal from workers list. (Julien Gilli)
+
+* cluster: enable error/message events using .worker (cjihrig)
+
+* cluster: include settings object in 'setup' event (Ryan Graham)
+
+* cluster: restore v0.10.x setupMaster() behaviour (Ryan Graham)
+
+* cluster: support options in Worker constructor (cjihrig)
+
+* cluster: test events emit on cluster.worker (Sam Roberts)
+
+* console: console.dir() accepts options object (Xavi Magrinyà)
+
+* crypto: add `honorCipherOrder` argument (Fedor Indutny)
+
+* crypto: allow padding in RSA methods (Fedor Indutny)
+
+* crypto: clarify RandomBytes() error msg (Mickael van der Beek)
+
+* crypto: never store pointer to conn in SSL_CTX (Fedor Indutny)
+
+* crypto: unsigned value can't be negative (Brian White)
+
+* dgram: remove new keyword from errnoException (Jackson Tian)
+
+* dns: always set variable family in lookup() (cjihrig)
+
+* dns: include host name in error message if available (Maciej Małecki)
+
+* dns: introduce lookupService function (Saúl Ibarra Corretgé)
+
+* dns: send lookup c-ares errors to callback (Chris Dickinson)
+
+* dns: throw if hostname is not string or falsey (cjihrig)
+
+* events: Output the event that is leaking (Arnout Kazemier)
+
+* fs: close file if fstat() fails in readFile() (cjihrig)
+
+* fs: fs.readFile should not throw uncaughtException (Jackson Tian)
+
+* http: add 308 status_code, see RFC7238 (Yazhong Liu)
+
+* http: don't default OPTIONS to chunked encoding (Nick Muerdter)
+
+* http: fix bailout for writeHead (Alex Kocharin)
+
+* http: remove unused code block (Fedor Indutny)
+
+* http: write() after end() emits an error. (Julien Gilli)
+
+* lib, src: add vm.runInDebugContext() (Ben Noordhuis)
+
+* lib: noisy deprecation of child_process customFds (Ryan Graham)
+
+* module: don't require fs several times (Robert Kowalski)
+
+* net,dgram: workers can listen on exclusive ports (cjihrig)
+
+* net,stream: add isPaused, don't read() when paused (Chris Dickinson)
+
+* net: Ensure consistent binding to IPV6 if address is absent (Raymond Feng)
+
+* net: add remoteFamily for socket (Jackson Tian)
+
+* net: don't emit listening if handle is closed (Eli Skeggs)
+
+* net: don't prefer IPv4 addresses during resolution (cjihrig)
+
+* net: don't throw on net.Server.close() (cjihrig)
+
+* net: reset `errorEmitted` on reconnect (Ed Umansky)
+
+* node: set names for prototype methods (Trevor Norris)
+
+* node: support v8 microtask queue (Vladimir Kurchatkin)
+
+* path: fix slice OOB in trim (Lucio M. Tato)
+
+* path: isAbsolute() should always return boolean (Herman Lee)
+
+* process: throw TypeError if kill pid not a number (Sam Roberts)
+
+* querystring: custom encode and decode (fengmk2)
+
+* querystring: do not add sep for empty array (cjihrig)
+
+* querystring: remove prepended ? from query field (Ezequiel Rabinovich)
+
+* readline: fix close event of readline.Interface() (Yazhong Liu)
+
+* readline: fixes scoping bug (Dan Kaplun)
+
+* readline: implements keypress buffering (Dan Kaplun)
+
+* repl: fix multi-line input (Fedor Indutny)
+
+* repl: fix overwrite for this._prompt (Yazhong Liu)
+
+* repl: proper `setPrompt()` and `multiline` support (Fedor Indutny)
+
+* stream: don't try to finish if buffer is not empty (Vladimir Kurchatkin)
+
+* stream: only end reading on null, not undefined (Jonathan Reem)
+
+* streams: set default hwm properly for Duplex (Andrew Oppenlander)
+
+* string_bytes: ucs2 support big endian (Andrew Low)
+
+* tls, crypto: add DHE support (Shigeki Ohtsu)
+
+* tls: `checkServerIdentity` option (Trevor Livingston)
+
+* tls: add DHE-RSA-AES128-SHA256 to the def ciphers (Shigeki Ohtsu)
+
+* tls: better error reporting at cert validation (Fedor Indutny)
+
+* tls: support multiple keys/certs (Fedor Indutny)
+
+* tls: throw an error, not string (Jackson Tian)
+
+* udp: make it possible to receive empty udp packets (Andrius Bentkus)
+
+* url: treat \ the same as / (isaacs)
+
+
2014.05.01, Version 0.11.13 (Unstable), 99c9930ad626e2796af23def7cac19b65c608d18
* v8: upgrade to 3.24.35.22
diff --git a/Makefile b/Makefile
index 11304e118f38ca85aae22b2692b9f5e54c9cae11..a28c66fc0a8814800933bbdabee4ca4cabab4d6d 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,13 @@ DESTDIR ?=
SIGN ?=
PREFIX ?= /usr/local
-NODE ?= ./node
+# Determine EXEEXT
+EXEEXT := $(shell $(PYTHON) -c \
+ "import sys; print('.exe' if sys.platform == 'win32' else '')")
+
+NODE ?= ./node$(EXEEXT)
+NODE_EXE = node$(EXEEXT)
+NODE_G_EXE = node_g$(EXEEXT)
# Default to verbose builds.
# To do quiet/pretty builds, run `make V=` to set V to an empty string,
@@ -23,31 +29,31 @@ endif
# BUILDTYPE=Debug builds both release and debug builds. If you want to compile
# just the debug build, run `make -C out BUILDTYPE=Debug` instead.
ifeq ($(BUILDTYPE),Release)
-all: out/Makefile node
+all: out/Makefile $(NODE_EXE)
else
-all: out/Makefile node node_g
+all: out/Makefile $(NODE_EXE) $(NODE_G_EXE)
endif
# The .PHONY is needed to ensure that we recursively use the out/Makefile
# to check for changes.
-.PHONY: node node_g
+.PHONY: $(NODE_EXE) $(NODE_G_EXE)
ifeq ($(USE_NINJA),1)
-node: config.gypi
+$(NODE_EXE): config.gypi
$(NINJA) -C out/Release/
- ln -fs out/Release/node node
+ ln -fs out/Release/$(NODE_EXE) $@
-node_g: config.gypi
+$(NODE_G_EXE): config.gypi
$(NINJA) -C out/Debug/
- ln -fs out/Debug/node $@
+ ln -fs out/Debug/$(NODE_EXE) $@
else
-node: config.gypi out/Makefile
+$(NODE_EXE): config.gypi out/Makefile
$(MAKE) -C out BUILDTYPE=Release V=$(V)
- ln -fs out/Release/node node
+ ln -fs out/Release/$(NODE_EXE) $@
-node_g: config.gypi out/Makefile
+$(NODE_G_EXE): config.gypi out/Makefile
$(MAKE) -C out BUILDTYPE=Debug V=$(V)
- ln -fs out/Debug/node $@
+ ln -fs out/Debug/$(NODE_EXE) $@
endif
out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp deps/v8/build/toolchain.gypi deps/v8/build/features.gypi deps/v8/tools/gyp/v8.gyp node.gyp config.gypi
@@ -72,7 +78,7 @@ uninstall:
$(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'
clean:
- -rm -rf out/Makefile node node_g out/$(BUILDTYPE)/node blog.html email.md
+ -rm -rf out/Makefile $(NODE_EXE) $(NODE_G_EXE) out/$(BUILDTYPE)/$(NODE_EXE) blog.html email.md
-find out/ -name '*.o' -o -name '*.a' | xargs rm -rf
-rm -rf node_modules
@@ -80,7 +86,7 @@ distclean:
-rm -rf out
-rm -f config.gypi
-rm -f config.mk
- -rm -rf node node_g blog.html email.md
+ -rm -rf $(NODE_EXE) $(NODE_G_EXE) blog.html email.md
-rm -rf node_modules
test: all
@@ -95,8 +101,8 @@ test-valgrind: all
$(PYTHON) tools/test.py --mode=release --valgrind simple message
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 \
+ @if [ ! -f $(NODE_EXE) ]; then make all; fi
+ ./$(NODE_EXE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
--directory="$(shell pwd)/test/gc/node_modules/weak" \
--nodedir="$(shell pwd)"
@@ -146,11 +152,11 @@ test-internet: all
test-debugger: all
$(PYTHON) tools/test.py debugger
-test-npm: node
- ./node deps/npm/test/run.js
+test-npm: $(NODE_EXE)
+ ./$(NODE_EXE) deps/npm/test/run.js
-test-npm-publish: node
- npm_package_config_publishtest=true ./node deps/npm/test/run.js
+test-npm-publish: $(NODE_EXE)
+ npm_package_config_publishtest=true ./$(NODE_EXE) deps/npm/test/run.js
test-addons: test-build
$(PYTHON) tools/test.py --mode=release addons
@@ -174,7 +180,7 @@ website_files = \
out/doc/sh_main.js \
out/doc/sh_javascript.min.js
-doc: $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/ out/doc/changelog.html node
+doc: $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/ out/doc/changelog.html $(NODE_EXE)
$(apidoc_dirs):
mkdir -p $@
@@ -182,24 +188,24 @@ $(apidoc_dirs):
out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/
cp $< $@
-out/doc/changelog.html: ChangeLog doc/changelog-head.html doc/changelog-foot.html tools/build-changelog.sh node
+out/doc/changelog.html: ChangeLog doc/changelog-head.html doc/changelog-foot.html tools/build-changelog.sh $(NODE_EXE)
bash tools/build-changelog.sh
out/doc/%: doc/%
cp -r $< $@
-out/doc/api/%.json: doc/api/%.markdown node
- out/Release/node tools/doc/generate.js --format=json $< > $@
+out/doc/api/%.json: doc/api/%.markdown $(NODE_EXE)
+ out/Release/$(NODE_EXE) 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 $< > $@
+out/doc/api/%.html: doc/api/%.markdown $(NODE_EXE)
+ out/Release/$(NODE_EXE) 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' > $@
cat tools/email-footer.md | sed -e 's|__VERSION__|'$(VERSION)'|g' >> $@
blog.html: email.md
- cat $< | ./node tools/doc/node_modules/.bin/marked > $@
+ cat $< | ./$(NODE_EXE) tools/doc/node_modules/.bin/marked > $@
website-upload: doc
rsync -r out/doc/ node@nodejs.org:~/web/nodejs.org/
@@ -300,7 +306,7 @@ $(PKG): release-only
--out $(PKG)
SIGN="$(INT_SIGN)" PKG="$(PKG)" bash tools/osx-productsign.sh
-$(TARBALL): release-only node doc
+$(TARBALL): release-only $(NODE_EXE) doc
git archive --format=tar --prefix=$(TARNAME)/ HEAD | tar xf -
mkdir -p $(TARNAME)/doc/api
cp doc/node.1 $(TARNAME)/doc/node.1
@@ -387,9 +393,9 @@ bench-http-simple:
benchmark/http_simple_bench.sh
bench-idle:
- ./node benchmark/idle_server.js &
+ ./$(NODE_EXE) benchmark/idle_server.js &
sleep 1
- ./node benchmark/idle_clients.js &
+ ./$(NODE_EXE) benchmark/idle_clients.js &
jslintfix:
PYTHONPATH=tools/closure_linter/ $(PYTHON) tools/closure_linter/closure_linter/fixjsstyle.py --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js
@@ -406,7 +412,7 @@ CPPLINT_EXCLUDE += src/queue.h
CPPLINT_EXCLUDE += src/tree.h
CPPLINT_EXCLUDE += src/v8abbr.h
-CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard src/*.cc src/*.h src/*.c))
+CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard src/*.cc src/*.h src/*.c tools/icu/*.h tools/icu/*.cc deps/debugger-agent/include/* deps/debugger-agent/src/*))
cpplint:
@$(PYTHON) tools/cpplint.py $(CPPLINT_FILES)
diff --git a/Makefile.build b/Makefile.build
new file mode 100644
index 0000000000000000000000000000000000000000..1aa5f56515d630f75811ca745db33cd9924ebee5
--- /dev/null
+++ b/Makefile.build
@@ -0,0 +1,500 @@
+# Copyright 2012 the V8 project authors. All rights reserved.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+# Variable default definitions. Override them by exporting them in your shell.
+CXX ?= g++
+LINK ?= g++
+OUTDIR ?= out
+TESTJOBS ?=
+# TODO(bnoordhuis) Make i18n support configurable.
+GYPFLAGS ?= -Dv8_enable_i18n_support=0
+TESTFLAGS ?=
+ANDROID_NDK_ROOT ?=
+ANDROID_NDK_HOST_ARCH ?=
+ANDROID_TOOLCHAIN ?=
+ANDROID_V8 ?= /data/local/tmp/v8
+NACL_SDK_ROOT ?=
+
+# Special build flags. Use them like this: "make library=shared"
+
+# library=shared || component=shared_library
+ifeq ($(library), shared)
+ GYPFLAGS += -Dcomponent=shared_library
+endif
+ifdef component
+ GYPFLAGS += -Dcomponent=$(component)
+endif
+# console=readline
+ifdef console
+ GYPFLAGS += -Dconsole=$(console)
+endif
+# disassembler=on
+ifeq ($(disassembler), on)
+ GYPFLAGS += -Dv8_enable_disassembler=1
+endif
+# objectprint=on
+ifeq ($(objectprint), on)
+ GYPFLAGS += -Dv8_object_print=1
+endif
+# verifyheap=on
+ifeq ($(verifyheap), on)
+ GYPFLAGS += -Dv8_enable_verify_heap=1
+endif
+# backtrace=off
+ifeq ($(backtrace), off)
+ GYPFLAGS += -Dv8_enable_backtrace=0
+else
+ GYPFLAGS += -Dv8_enable_backtrace=1
+endif
+# verifypredictable=on
+ifeq ($(verifypredictable), on)
+ GYPFLAGS += -Dv8_enable_verify_predictable=1
+endif
+# snapshot=off
+ifeq ($(snapshot), off)
+ GYPFLAGS += -Dv8_use_snapshot='false'
+endif
+# extrachecks=on/off
+ifeq ($(extrachecks), on)
+ GYPFLAGS += -Dv8_enable_extra_checks=1 -Dv8_enable_handle_zapping=1
+endif
+ifeq ($(extrachecks), off)
+ GYPFLAGS += -Dv8_enable_extra_checks=0 -Dv8_enable_handle_zapping=0
+endif
+# gdbjit=on/off
+ifeq ($(gdbjit), on)
+ GYPFLAGS += -Dv8_enable_gdbjit=1
+endif
+ifeq ($(gdbjit), off)
+ GYPFLAGS += -Dv8_enable_gdbjit=0
+endif
+# vtunejit=on
+ifeq ($(vtunejit), on)
+ GYPFLAGS += -Dv8_enable_vtunejit=1
+endif
+# optdebug=on
+ifeq ($(optdebug), on)
+ GYPFLAGS += -Dv8_optimized_debug=2
+endif
+# unalignedaccess=on
+ifeq ($(unalignedaccess), on)
+ GYPFLAGS += -Dv8_can_use_unaligned_accesses=true
+endif
+# randomseed=12345, disable random seed via randomseed=0
+ifdef randomseed
+ GYPFLAGS += -Dv8_random_seed=$(randomseed)
+endif
+# soname_version=1.2.3
+ifdef soname_version
+ GYPFLAGS += -Dsoname_version=$(soname_version)
+endif
+# werror=no
+ifeq ($(werror), no)
+ GYPFLAGS += -Dwerror=''
+endif
+# presubmit=no
+ifeq ($(presubmit), no)
+ TESTFLAGS += --no-presubmit
+endif
+# strictaliasing=off (workaround for GCC-4.5)
+ifeq ($(strictaliasing), off)
+ GYPFLAGS += -Dv8_no_strict_aliasing=1
+endif
+# regexp=interpreted
+ifeq ($(regexp), interpreted)
+ GYPFLAGS += -Dv8_interpreted_regexp=1
+endif
+# i18nsupport=off
+ifeq ($(i18nsupport), off)
+ GYPFLAGS += -Dv8_enable_i18n_support=0
+ TESTFLAGS += --noi18n
+endif
+# deprecation_warnings=on
+ifeq ($(deprecationwarnings), on)
+ GYPFLAGS += -Dv8_deprecation_warnings=1
+endif
+# asan=/path/to/clang++
+ifneq ($(strip $(asan)),)
+ GYPFLAGS += -Dasan=1
+ export CXX=$(asan)
+ export CXX_host=$(asan)
+ export LINK=$(asan)
+ export ASAN_SYMBOLIZER_PATH="$(dir $(asan))llvm-symbolizer"
+endif
+
+# arm specific flags.
+# arm_version=
+ifneq ($(strip $(arm_version)),)
+ GYPFLAGS += -Darm_version=$(arm_version)
+else
+# Deprecated (use arm_version instead): armv7=false/true
+ifeq ($(armv7), false)
+ GYPFLAGS += -Darm_version=6
+else
+ifeq ($(armv7), true)
+ GYPFLAGS += -Darm_version=7
+endif
+endif
+endif
+# hardfp=on/off. Deprecated, use armfloatabi
+ifeq ($(hardfp),on)
+ GYPFLAGS += -Darm_float_abi=hard
+else
+ifeq ($(hardfp),off)
+ GYPFLAGS += -Darm_float_abi=softfp
+endif
+endif
+# fpu: armfpu=xxx
+# xxx: vfp, vfpv3-d16, vfpv3, neon.
+ifeq ($(armfpu),)
+ GYPFLAGS += -Darm_fpu=default
+else
+ GYPFLAGS += -Darm_fpu=$(armfpu)
+endif
+# float abi: armfloatabi=softfp/hard
+ifeq ($(armfloatabi),)
+ifeq ($(hardfp),)
+ GYPFLAGS += -Darm_float_abi=default
+endif
+else
+ GYPFLAGS += -Darm_float_abi=$(armfloatabi)
+endif
+# armthumb=on/off
+ifeq ($(armthumb), off)
+ GYPFLAGS += -Darm_thumb=0
+else
+ifeq ($(armthumb), on)
+ GYPFLAGS += -Darm_thumb=1
+endif
+endif
+# arm_test_noprobe=on
+# With this flag set, by default v8 will only use features implied
+# by the compiler (no probe). This is done by modifying the default
+# values of enable_armv7, enable_vfp3, enable_32dregs and enable_neon.
+# Modifying these flags when launching v8 will enable the probing for
+# the specified values.
+ifeq ($(arm_test_noprobe), on)
+ GYPFLAGS += -Darm_test_noprobe=on
+endif
+
+# ----------------- available targets: --------------------
+# - "builddeps": pulls in external dependencies for building
+# - "dependencies": pulls in all external dependencies
+# - "grokdump": rebuilds heap constants lists used by grokdump
+# - any arch listed in ARCHES (see below)
+# - any mode listed in MODES
+# - every combination ., e.g. "ia32.release"
+# - "native": current host's architecture, release mode
+# - any of the above with .check appended, e.g. "ia32.release.check"
+# - "android": cross-compile for Android/ARM
+# - "nacl" : cross-compile for Native Client (ia32 and x64)
+# - default (no target specified): build all DEFAULT_ARCHES and MODES
+# - "check": build all targets and run all tests
+# - ".clean" for any in ARCHES
+# - "clean": clean all ARCHES
+
+# ----------------- internal stuff ------------------------
+
+# Architectures and modes to be compiled. Consider these to be internal
+# variables, don't override them (use the targets instead).
+ARCHES = ia32 x64 x32 arm arm64 mips mipsel mips64el x87
+DEFAULT_ARCHES = ia32 x64 arm
+MODES = release debug optdebug
+DEFAULT_MODES = release debug
+ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel android_x87
+NACL_ARCHES = nacl_ia32 nacl_x64
+
+# List of files that trigger Makefile regeneration:
+GYPFILES = \
+ common.gypi \
+ deps/cares/cares.gyp \
+ deps/debugger-agent/debugger-agent.gyp \
+ deps/http_parser/http_parser.gyp \
+ deps/openssl/openssl.gyp \
+ deps/uv/uv.gyp \
+ deps/v8/tools/gyp/v8.gyp \
+ deps/zlib/zlib.gyp \
+ node.gyp \
+
+# If vtunejit=on, the v8vtune.gyp will be appended.
+ifeq ($(vtunejit), on)
+ GYPFILES += src/third_party/vtune/v8vtune.gyp
+endif
+# Generates all combinations of ARCHES and MODES, e.g. "ia32.release".
+BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES)))
+ANDROID_BUILDS = $(foreach mode,$(MODES), \
+ $(addsuffix .$(mode),$(ANDROID_ARCHES)))
+NACL_BUILDS = $(foreach mode,$(MODES), \
+ $(addsuffix .$(mode),$(NACL_ARCHES)))
+# Generates corresponding test targets, e.g. "ia32.release.check".
+CHECKS = $(addsuffix .check,$(BUILDS))
+QUICKCHECKS = $(addsuffix .quickcheck,$(BUILDS))
+ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS))
+NACL_CHECKS = $(addsuffix .check,$(NACL_BUILDS))
+# File where previously used GYPFLAGS are stored.
+ENVFILE = $(OUTDIR)/environment
+
+.PHONY: all check clean builddeps dependencies $(ENVFILE).new native \
+ qc quickcheck $(QUICKCHECKS) \
+ $(addsuffix .quickcheck,$(MODES)) $(addsuffix .quickcheck,$(ARCHES)) \
+ $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \
+ $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \
+ $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \
+ must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN \
+ $(NACL_ARCHES) $(NACL_BUILDS) $(NACL_CHECKS) \
+ must-set-NACL_SDK_ROOT
+
+# Target definitions. "all" is the default.
+all: $(DEFAULT_MODES)
+
+# Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile
+# having been created before.
+buildbot:
+ $(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \
+ builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)"
+
+# Compile targets. MODES and ARCHES are convenience targets.
+.SECONDEXPANSION:
+$(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES))
+
+$(ARCHES): $(addprefix $$@.,$(DEFAULT_MODES))
+
+# Defines how to build a particular target (e.g. ia32.release).
+$(BUILDS): $(OUTDIR)/Makefile.$$@
+ @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \
+ CXX="$(CXX)" LINK="$(LINK)" \
+ BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
+ python -c "print \
+ raw_input().replace('opt', '').capitalize()") \
+ builddir="$(shell pwd)/$(OUTDIR)/$@"
+
+native: $(OUTDIR)/Makefile.native
+ @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \
+ CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \
+ builddir="$(shell pwd)/$(OUTDIR)/$@"
+
+$(ANDROID_ARCHES): $(addprefix $$@.,$(MODES))
+
+$(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \
+ must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN Makefile.android
+ @$(MAKE) -f Makefile.android $@ \
+ ARCH="$(basename $@)" \
+ MODE="$(subst .,,$(suffix $@))" \
+ OUTDIR="$(OUTDIR)" \
+ GYPFLAGS="$(GYPFLAGS)"
+
+$(NACL_ARCHES): $(addprefix $$@.,$(MODES))
+
+$(NACL_BUILDS): $(GYPFILES) $(ENVFILE) \
+ Makefile.nacl must-set-NACL_SDK_ROOT
+ @$(MAKE) -f Makefile.nacl $@ \
+ ARCH="$(basename $@)" \
+ MODE="$(subst .,,$(suffix $@))" \
+ OUTDIR="$(OUTDIR)" \
+ GYPFLAGS="$(GYPFLAGS)"
+
+# Test targets.
+check: all
+ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
+ --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \
+ $(TESTFLAGS)
+
+$(addsuffix .check,$(MODES)): $$(basename $$@)
+ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
+ --mode=$(basename $@) $(TESTFLAGS)
+
+$(addsuffix .check,$(ARCHES)): $$(basename $$@)
+ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
+ --arch=$(basename $@) $(TESTFLAGS)
+
+$(CHECKS): $$(basename $$@)
+ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
+ --arch-and-mode=$(basename $@) $(TESTFLAGS)
+
+$(addsuffix .quickcheck,$(MODES)): $$(basename $$@)
+ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
+ --mode=$(basename $@) $(TESTFLAGS) --quickcheck
+
+$(addsuffix .quickcheck,$(ARCHES)): $$(basename $$@)
+ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
+ --arch=$(basename $@) $(TESTFLAGS) --quickcheck
+
+$(QUICKCHECKS): $$(basename $$@)
+ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
+ --arch-and-mode=$(basename $@) $(TESTFLAGS) --quickcheck
+
+$(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@)
+ @tools/android-sync.sh $(basename $@) $(OUTDIR) \
+ $(shell pwd) $(ANDROID_V8)
+
+$(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync
+ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
+ --arch-and-mode=$(basename $@) \
+ --timeout=600 \
+ --command-prefix="tools/android-run.py" $(TESTFLAGS)
+
+$(addsuffix .check, $(ANDROID_ARCHES)): \
+ $(addprefix $$(basename $$@).,$(MODES)).check
+
+$(addsuffix .check, $(NACL_BUILDS)): $$(basename $$@)
+ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
+ --arch-and-mode=$(basename $@) \
+ --timeout=600 --nopresubmit --noi18n \
+ --command-prefix="tools/nacl-run.py"
+
+$(addsuffix .check, $(NACL_ARCHES)): \
+ $(addprefix $$(basename $$@).,$(MODES)).check
+
+native.check: native
+ @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \
+ --arch-and-mode=. $(TESTFLAGS)
+
+SUPERFASTTESTMODES = ia32.release
+FASTTESTMODES = $(SUPERFASTTESTMODES),x64.release,ia32.optdebug,x64.optdebug,arm.optdebug,arm64.release
+FASTCOMPILEMODES = $(FASTTESTMODES),arm64.optdebug
+
+COMMA = ,
+EMPTY =
+SPACE = $(EMPTY) $(EMPTY)
+quickcheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES))
+ tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
+ --arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) --quickcheck \
+ --download-data mozilla webkit
+ tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
+ --arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) --quickcheck
+qc: quickcheck
+
+# Clean targets. You can clean each architecture individually, or everything.
+$(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)):
+ rm -f $(OUTDIR)/Makefile.$(basename $@)*
+ rm -rf $(OUTDIR)/$(basename $@).release
+ rm -rf $(OUTDIR)/$(basename $@).debug
+ rm -rf $(OUTDIR)/$(basename $@).optdebug
+ find $(OUTDIR) -regex '.*\(host\|target\)\.$(basename $@).*\.mk' -delete
+
+native.clean:
+ rm -f $(OUTDIR)/Makefile.native
+ rm -rf $(OUTDIR)/native
+ find $(OUTDIR) -regex '.*\(host\|target\)\.native\.mk' -delete
+
+clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)) native.clean gtags.clean
+
+# GYP file generation targets.
+OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(BUILDS))
+$(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
+ $(eval CXX_TARGET_ARCH:=$(shell $(CXX) -v 2>&1 | grep ^Target: | \
+ cut -f 2 -d " " | cut -f 1 -d "-" ))
+ $(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH)))
+ $(eval V8_TARGET_ARCH:=$(subst .,,$(suffix $(basename $@))))
+ GYP_GENERATORS=make \
+ tools/gyp/gyp --generator-output="$(OUTDIR)" node.gyp \
+ -Icommon.gypi --depth=. \
+ -Dtarget_arch=$(V8_TARGET_ARCH) \
+ -Dv8_target_arch=$(V8_TARGET_ARCH) \
+ $(if $(findstring $(CXX_TARGET_ARCH),$(V8_TARGET_ARCH)), \
+ -Dtarget_arch=$(V8_TARGET_ARCH),) \
+ $(if $(findstring optdebug,$@),-Dv8_optimized_debug=2,) \
+ -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS)
+
+$(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE)
+ GYP_GENERATORS=make \
+ tools/gyp/gyp --generator-output="$(OUTDIR)" node.gyp \
+ -Icommon.gypi --depth=. -S.native $(GYPFLAGS)
+
+must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN:
+ifndef ANDROID_NDK_ROOT
+ifndef ANDROID_TOOLCHAIN
+ $(error ANDROID_NDK_ROOT or ANDROID_TOOLCHAIN must be set))
+endif
+endif
+
+# Note that NACL_SDK_ROOT must be set to point to an appropriate
+# Native Client SDK before using this makefile. You can download
+# an SDK here:
+# https://developers.google.com/native-client/sdk/download
+# The path indicated by NACL_SDK_ROOT will typically end with
+# a folder for a pepper version such as "pepper_25" that should
+# have "tools" and "toolchain" subdirectories.
+must-set-NACL_SDK_ROOT:
+ifndef NACL_SDK_ROOT
+ $(error NACL_SDK_ROOT must be set)
+endif
+
+# Replaces the old with the new environment file if they're different, which
+# will trigger GYP to regenerate Makefiles.
+$(ENVFILE): $(ENVFILE).new
+ @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) > /dev/null; \
+ then rm $(ENVFILE).new; \
+ else mv $(ENVFILE).new $(ENVFILE); fi
+
+# Stores current GYPFLAGS in a file.
+$(ENVFILE).new:
+ @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \
+ echo "CXX=$(CXX)" >> $(ENVFILE).new
+
+# Heap constants for grokdump.
+DUMP_FILE = tools/v8heapconst.py
+grokdump: ia32.release
+ @cat $(DUMP_FILE).tmpl > $(DUMP_FILE)
+ @$(OUTDIR)/ia32.release/d8 --dump-heap-constants >> $(DUMP_FILE)
+
+# Support for the GNU GLOBAL Source Code Tag System.
+gtags.files: $(GYPFILES) $(ENVFILE)
+ @find include src test -name '*.h' -o -name '*.cc' -o -name '*.c' > $@
+
+# We need to manually set the stack limit here, to work around bugs in
+# gmake-3.81 and global-5.7.1 on recent 64-bit Linux systems.
+GPATH GRTAGS GSYMS GTAGS: gtags.files $(shell cat gtags.files 2> /dev/null)
+ @bash -c 'ulimit -s 10240 && GTAGSFORCECPP=yes gtags -i -q -f $<'
+
+gtags.clean:
+ rm -f gtags.files GPATH GRTAGS GSYMS GTAGS
+
+# Dependencies. "builddeps" are dependencies required solely for building,
+# "dependencies" includes also dependencies required for development.
+# Remember to keep these in sync with the DEPS file.
+builddeps:
+ svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \
+ --revision 1831
+ if svn info third_party/icu 2>&1 | grep -q icu46 ; then \
+ svn switch --force \
+ https://src.chromium.org/chrome/trunk/deps/third_party/icu52 \
+ third_party/icu --revision 277999 ; \
+ else \
+ svn checkout --force \
+ https://src.chromium.org/chrome/trunk/deps/third_party/icu52 \
+ third_party/icu --revision 277999 ; \
+ fi
+ svn checkout --force http://googletest.googlecode.com/svn/trunk \
+ testing/gtest --revision 692
+ svn checkout --force http://googlemock.googlecode.com/svn/trunk \
+ testing/gmock --revision 485
+
+dependencies: builddeps
+ # The spec is a copy of the hooks in v8's DEPS file.
+ gclient sync -r fb782d4369d5ae04f17a2fceef7de5a63e50f07b --spec="solutions = [{u'managed': False, u'name': u'buildtools', u'url': u'https://chromium.googlesource.com/chromium/buildtools.git', u'custom_deps': {}, u'custom_hooks': [{u'name': u'clang_format_win',u'pattern': u'.',u'action': [u'download_from_google_storage',u'--no_resume',u'--platform=win32',u'--no_auth',u'--bucket',u'chromium-clang-format',u'-s',u'buildtools/win/clang-format.exe.sha1']},{u'name': u'clang_format_mac',u'pattern': u'.',u'action': [u'download_from_google_storage',u'--no_resume',u'--platform=darwin',u'--no_auth',u'--bucket',u'chromium-clang-format',u'-s',u'buildtools/mac/clang-format.sha1']},{u'name': u'clang_format_linux',u'pattern': u'.',u'action': [u'download_from_google_storage',u'--no_resume',u'--platform=linux*',u'--no_auth',u'--bucket',u'chromium-clang-format',u'-s',u'buildtools/linux64/clang-format.sha1']}],u'deps_file': u'.DEPS.git', u'safesync_url': u''}]"
diff --git a/README.md b/README.md
index 086590a6bb483e40461149ae817ca37e7da48623..b157ddd3f2acc993d4eda01321764da778eeaab2 100644
--- a/README.md
+++ b/README.md
@@ -5,8 +5,8 @@ Evented I/O for V8 javascript.
Prerequisites (Unix only):
- * GCC 4.2 or newer
- * G++ 4.2 or newer
+ * `gcc` and `g++` 4.8 or newer, or
+ * `clang` and `clang++` 3.3 or newer
* Python 2.6 or 2.7
* GNU Make 3.81 or newer
* libexecinfo (FreeBSD and OpenBSD only)
@@ -19,17 +19,6 @@ make
make install
```
-With libicu i18n support:
-
-```sh
-svn checkout --force --revision 214189 \
- http://src.chromium.org/svn/trunk/deps/third_party/icu46 \
- deps/v8/third_party/icu46
-./configure --with-icu-path=deps/v8/third_party/icu46/icu.gyp
-make
-make install
-```
-
If your python binary is in a non-standard location or has a
non-standard name, run the following instead:
@@ -43,15 +32,18 @@ make install
Prerequisites (Windows only):
* Python 2.6 or 2.7
- * Visual Studio 2010 or 2012
+ * Visual Studio 2013 for Windows Desktop, or
+ * Visual Studio Express 2013 for Windows Desktop
Windows:
- vcbuild nosign
+```sh
+vcbuild nosign
+```
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.
+and OS X installers will prompt you for the location in which to install.
The tarballs are self-contained; you can extract them to a local directory
with:
@@ -92,6 +84,35 @@ make doc
man doc/node.1
```
+### To build `Intl` (ECMA-402) support:
+
+*Note:* more docs, including how to reduce disk footprint, are on
+[the wiki](https://github.com/joyent/node/wiki/Intl).
+
+#### Use existing installed ICU (Unix/Macintosh only):
+
+```sh
+pkg-config --modversion icu-i18n && ./configure --with-intl=system-icu
+```
+
+#### Build ICU from source:
+
+First: Unpack latest ICU
+ [icu4c-**##.#**-src.tgz](http://icu-project.org/download) (or `.zip`)
+ as `deps/icu` (You'll have: `deps/icu/source/...`)
+
+Unix/Macintosh:
+
+```sh
+./configure --with-intl=full-icu
+```
+
+Windows:
+
+```sh
+vcbuild full-icu
+```
+
Resources for Newcomers
---
- [The Wiki](https://github.com/joyent/node/wiki)
diff --git a/benchmark/misc/module-loader.js b/benchmark/misc/module-loader.js
new file mode 100644
index 0000000000000000000000000000000000000000..96f8e7df1ead60eabdf60e7a60c472978acd12b9
--- /dev/null
+++ b/benchmark/misc/module-loader.js
@@ -0,0 +1,72 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+var fs = require('fs');
+var path = require('path');
+var common = require('../common.js');
+var packageJson = '{"main": "index.js"}';
+
+var tmpDirectory = path.join(__dirname, '..', 'tmp');
+var benchmarkDirectory = path.join(tmpDirectory, 'nodejs-benchmark-module');
+
+var bench = common.createBenchmark(main, {
+ thousands: [50]
+});
+
+function main(conf) {
+ rmrf(tmpDirectory);
+ try { fs.mkdirSync(tmpDirectory); } catch (e) {}
+ try { fs.mkdirSync(benchmarkDirectory); } catch (e) {}
+
+ var n = +conf.thousands * 1e3;
+ for (var i = 0; i <= n; i++) {
+ fs.mkdirSync(benchmarkDirectory + i);
+ fs.writeFileSync(benchmarkDirectory + i + '/package.json', '{"main": "index.js"}');
+ fs.writeFileSync(benchmarkDirectory + i + '/index.js', 'module.exports = "";');
+ }
+
+ measure(n);
+}
+
+function measure(n) {
+ bench.start();
+ for (var i = 0; i <= n; i++) {
+ require(benchmarkDirectory + i);
+ }
+ bench.end(n / 1e3);
+}
+
+function rmrf(location) {
+ if (fs.existsSync(location)) {
+ var things = fs.readdirSync(location);
+ things.forEach(function(thing) {
+ var cur = path.join(location, thing),
+ isDirectory = fs.statSync(cur).isDirectory();
+ if (isDirectory) {
+ rmrf(cur);
+ return;
+ }
+ fs.unlinkSync(cur);
+ });
+ fs.rmdirSync(location);
+ }
+}
diff --git a/common.gypi b/common.gypi
index 6aa485bada28a45899bf677988b93a4132e7e3db..fabb3751730a3e4a007ca0e689a2b3eea5209ec4 100644
--- a/common.gypi
+++ b/common.gypi
@@ -1,5 +1,6 @@
{
'variables': {
+ 'asan%': 0,
'werror': '', # Turn off -Werror in V8 build.
'visibility%': 'hidden', # V8's visibility setting
'target_arch%': 'ia32', # set v8's target architecture
@@ -12,6 +13,12 @@
'clang%': 0,
'python%': 'python',
+ 'node_tag%': '',
+ 'uv_library%': 'static_library',
+
+ # Default to -O0 for debug builds.
+ 'v8_optimized_debug%': 0,
+
# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,
@@ -26,10 +33,10 @@
}],
['GENERATOR == "ninja" or OS== "mac"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
- 'V8_BASE': '<(PRODUCT_DIR)/libv8_base.<(target_arch).a',
+ '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.<(target_arch).a',
+ 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a',
}],
],
},
@@ -77,12 +84,6 @@
# pull in V8's postmortem metadata
'ldflags': [ '-Wl,-z,allextract' ]
}],
- ['clang == 0 and gcc_version >= 40', {
- 'cflags': [ '-fno-tree-vrp' ], # Work around compiler bug.
- }],
- ['clang == 0 and gcc_version <= 44', {
- 'cflags': [ '-fno-tree-sink' ], # Work around compiler bug.
- }],
['OS!="mac" and OS!="win"', {
'cflags': [ '-fno-omit-frame-pointer' ],
}],
@@ -153,6 +154,16 @@
},
'msvs_disabled_warnings': [4351, 4355, 4800],
'conditions': [
+ ['asan != 0', {
+ 'cflags+': [
+ '-fno-omit-frame-pointer',
+ '-fsanitize=address',
+ '-w', # http://crbug.com/162783
+ ],
+ 'cflags_cc+': [ '-gline-tables-only' ],
+ 'cflags!': [ '-fomit-frame-pointer' ],
+ 'ldflags': [ '-fsanitize=address' ],
+ }],
['OS == "win"', {
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
'defines': [
@@ -173,7 +184,7 @@
}],
[ 'OS in "linux freebsd openbsd solaris android"', {
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
- 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
+ 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
'ldflags': [ '-rdynamic' ],
'target_conditions': [
['_type=="static_library"', {
@@ -185,6 +196,10 @@
'cflags': [ '-m32' ],
'ldflags': [ '-m32' ],
}],
+ [ 'target_arch=="x32"', {
+ 'cflags': [ '-mx32' ],
+ 'ldflags': [ '-mx32' ],
+ }],
[ 'target_arch=="x64"', {
'cflags': [ '-m64' ],
'ldflags': [ '-m64' ],
@@ -237,6 +252,12 @@
['target_arch=="x64"', {
'xcode_settings': {'ARCHS': ['x86_64']},
}],
+ ['clang==1', {
+ 'xcode_settings': {
+ 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
+ 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
+ },
+ }],
],
}],
['OS=="freebsd" and node_use_dtrace=="true"', {
diff --git a/configure b/configure
index 2e08583254607e923ece36104086179f714a2a15..b9e5473816cadca34f9ef159be0d2d9ffe0ed64e 100755
--- a/configure
+++ b/configure
@@ -31,7 +31,7 @@ parser.add_option('--debug',
parser.add_option('--dest-cpu',
action='store',
dest='dest_cpu',
- help='CPU architecture to build for. Valid values are: arm, ia32, x64')
+ help='CPU architecture to build for. Valid values are: arm, ia32, x32, x64')
parser.add_option('--dest-os',
action='store',
@@ -241,6 +241,11 @@ parser.add_option('--with-icu-path',
dest='with_icu_path',
help='Path to icu.gyp (ICU i18n, Chromium version only.)')
+parser.add_option('--with-intl',
+ action='store',
+ dest='with_intl',
+ help='Intl mode: none, full-icu, small-icu (default is none)')
+
parser.add_option('--with-perfctr',
action='store_true',
dest='with_perfctr',
@@ -686,13 +691,159 @@ def configure_winsdk(o):
print('ctrpp not found in WinSDK path--using pre-gen files '
'from tools/msvs/genfiles.')
+def write(filename, data):
+ filename = os.path.join(root_dir, filename)
+ print 'creating ', filename
+ f = open(filename, 'w+')
+ f.write(data)
+
+do_not_edit = '# Do not edit. Generated by the configure script.\n'
+
+def glob_to_var(dir_base, dir_sub):
+ list = []
+ dir_all = os.path.join(dir_base, dir_sub)
+ files = os.walk(dir_all)
+ for ent in files:
+ (path, dirs, files) = ent
+ for file in files:
+ if file.endswith('.cpp') or file.endswith('.c') or file.endswith('.h'):
+ list.append('%s/%s' % (dir_sub, file))
+ break
+ return list
+
+def configure_intl(o):
+ icu_config = {
+ 'variables': {}
+ }
+ icu_config_name = 'icu_config.gypi'
+ def write_config(data, name):
+ return
+
+ # write an empty file to start with
+ write(icu_config_name, do_not_edit +
+ pprint.pformat(icu_config, indent=2) + '\n')
+
+ # small ICU is off by default.
+ # always set icu_small, node.gyp depends on it being defined.
+ o['variables']['icu_small'] = b(False)
-def configure_icu(o):
+ with_intl = options.with_intl
have_icu_path = bool(options.with_icu_path)
- o['variables']['v8_enable_i18n_support'] = int(have_icu_path)
- if have_icu_path:
+ if have_icu_path and with_intl:
+ print 'Error: Cannot specify both --with-icu-path and --with-intl'
+ sys.exit(1)
+ elif have_icu_path:
+ # Chromium .gyp mode: --with-icu-path
+ o['variables']['v8_enable_i18n_support'] = 1
+ # use the .gyp given
o['variables']['icu_gyp_path'] = options.with_icu_path
-
+ return
+ # --with-intl=
+ if with_intl == 'none' or with_intl is None:
+ o['variables']['v8_enable_i18n_support'] = 0
+ return # no Intl
+ elif with_intl == 'small-icu':
+ # small ICU (English only)
+ o['variables']['v8_enable_i18n_support'] = 1
+ o['variables']['icu_small'] = b(True)
+ elif with_intl == 'full-icu':
+ # full ICU
+ o['variables']['v8_enable_i18n_support'] = 1
+ elif with_intl == 'system-icu':
+ # ICU from pkg-config.
+ o['variables']['v8_enable_i18n_support'] = 1
+ pkgicu = pkg_config('icu-i18n')
+ if not pkgicu:
+ print 'Error: could not load pkg-config data for "icu-i18n".'
+ print 'See above errors or the README.md.'
+ sys.exit(1)
+ (libs, cflags) = pkgicu
+ o['libraries'] += libs.split()
+ o['cflags'] += cflags.split()
+ # use the "system" .gyp
+ o['variables']['icu_gyp_path'] = 'tools/icu/icu-system.gyp'
+ return
+ else:
+ print 'Error: unknown value --with-intl=%s' % with_intl
+ sys.exit(1)
+ # Note: non-ICU implementations could use other 'with_intl'
+ # values.
+
+ # ICU mode. (icu-generic.gyp)
+ byteorder = sys.byteorder
+ o['variables']['icu_gyp_path'] = 'tools/icu/icu-generic.gyp'
+ # ICU source dir relative to root
+ icu_full_path = os.path.join(root_dir, 'deps/icu')
+ o['variables']['icu_path'] = icu_full_path
+ if not os.path.isdir(icu_full_path):
+ print 'Error: ICU path is not a directory: %s' % (icu_full_path)
+ sys.exit(1)
+ # Now, what version of ICU is it? We just need the "major", such as 54.
+ # uvernum.h contains it as a #define.
+ uvernum_h = os.path.join(icu_full_path, 'source/common/unicode/uvernum.h')
+ if not os.path.isfile(uvernum_h):
+ print 'Error: could not load %s - is ICU installed?' % uvernum_h
+ sys.exit(1)
+ icu_ver_major = None
+ matchVerExp = r'^\s*#define\s+U_ICU_VERSION_SHORT\s+"([^"]*)".*'
+ match_version = re.compile(matchVerExp)
+ for line in open(uvernum_h).readlines():
+ m = match_version.match(line)
+ if m:
+ icu_ver_major = m.group(1)
+ if not icu_ver_major:
+ print 'Could not read U_ICU_VERSION_SHORT version from %s' % uvernum_h
+ sys.exit(1)
+ icu_endianness = sys.byteorder[0]; # TODO(srl295): EBCDIC should be 'e'
+ o['variables']['icu_ver_major'] = icu_ver_major
+ o['variables']['icu_endianness'] = icu_endianness
+ icu_data_file_l = 'icudt%s%s.dat' % (icu_ver_major, 'l')
+ icu_data_file = 'icudt%s%s.dat' % (icu_ver_major, icu_endianness)
+ # relative to configure
+ icu_data_path = os.path.join(icu_full_path,
+ 'source/data/in',
+ icu_data_file_l)
+ # relative to dep..
+ icu_data_in = os.path.join('../../deps/icu/source/data/in', icu_data_file_l)
+ if not os.path.isfile(icu_data_path) and icu_endianness != 'l':
+ # use host endianness
+ icu_data_path = os.path.join(icu_full_path,
+ 'source/data/in',
+ icu_data_file)
+ # relative to dep..
+ icu_data_in = os.path.join('icu/source/data/in',
+ icu_data_file)
+ # this is the input '.dat' file to use .. icudt*.dat
+ # may be little-endian if from a icu-project.org tarball
+ o['variables']['icu_data_in'] = icu_data_in
+ # this is the icudt*.dat file which node will be using (platform endianness)
+ o['variables']['icu_data_file'] = icu_data_file
+ if not os.path.isfile(icu_data_path):
+ print 'Error: ICU prebuilt data file %s does not exist.' % icu_data_path
+ print 'See the README.md.'
+ # .. and we're not about to build it from .gyp!
+ sys.exit(1)
+ # map from variable name to subdirs
+ icu_src = {
+ 'stubdata': 'stubdata',
+ 'common': 'common',
+ 'i18n': 'i18n',
+ 'io': 'io',
+ 'tools': 'tools/toolutil',
+ 'genccode': 'tools/genccode',
+ 'genrb': 'tools/genrb',
+ 'icupkg': 'tools/icupkg',
+ }
+ # this creates a variable icu_src_XXX for each of the subdirs
+ # with a list of the src files to use
+ for i in icu_src:
+ var = 'icu_src_%s' % i
+ path = '../../deps/icu/source/%s' % icu_src[i]
+ icu_config['variables'][var] = glob_to_var('tools/icu', path)
+ # write updated icu_config.gypi with a bunch of paths
+ write(icu_config_name, do_not_edit +
+ pprint.pformat(icu_config, indent=2) + '\n')
+ return # end of configure_intl
# determine the "flavor" (operating system) we're building for,
# leveraging gyp's GetFlavor function
@@ -717,7 +868,7 @@ configure_libuv(output)
configure_v8(output)
configure_openssl(output)
configure_winsdk(output)
-configure_icu(output)
+configure_intl(output)
configure_fullystatic(output)
# variables should be a root level element,
@@ -730,13 +881,7 @@ output = {
}
pprint.pprint(output, indent=2)
-def write(filename, data):
- filename = os.path.join(root_dir, filename)
- print 'creating ', filename
- f = open(filename, 'w+')
- f.write(data)
-
-write('config.gypi', '# Do not edit. Generated by the configure script.\n' +
+write('config.gypi', do_not_edit +
pprint.pformat(output, indent=2) + '\n')
config = {
@@ -760,7 +905,7 @@ if options.use_ninja:
gyp_args += ['-f', 'ninja-' + flavor]
elif options.use_xcode:
gyp_args += ['-f', 'xcode']
-elif flavor == 'win':
+elif flavor == 'win' and sys.platform != 'msys':
gyp_args += ['-f', 'msvs', '-G', 'msvs_version=auto']
else:
gyp_args += ['-f', 'make-' + flavor]
diff --git a/deps/debugger-agent/debugger-agent.gyp b/deps/debugger-agent/debugger-agent.gyp
new file mode 100644
index 0000000000000000000000000000000000000000..e98206849ab1aa0181c159b71d09892a8d1d8792
--- /dev/null
+++ b/deps/debugger-agent/debugger-agent.gyp
@@ -0,0 +1,24 @@
+{
+ "targets": [{
+ "target_name": "debugger-agent",
+ "type": "<(library)",
+ "include_dirs": [
+ "src",
+ "include",
+ "../v8/include",
+ "../uv/include",
+
+ # Private node.js folder and stuff needed to include from it
+ "../../src",
+ "../cares/include",
+ ],
+ "direct_dependent_settings": {
+ "include_dirs": [
+ "include",
+ ],
+ },
+ "sources": [
+ "src/agent.cc",
+ ],
+ }],
+}
diff --git a/deps/debugger-agent/include/debugger-agent.h b/deps/debugger-agent/include/debugger-agent.h
new file mode 100644
index 0000000000000000000000000000000000000000..762a687a0a071cd27781ecdff06f2822bae30323
--- /dev/null
+++ b/deps/debugger-agent/include/debugger-agent.h
@@ -0,0 +1,109 @@
+// Copyright Fedor Indutny and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#ifndef DEPS_DEBUGGER_AGENT_INCLUDE_DEBUGGER_AGENT_H_
+#define DEPS_DEBUGGER_AGENT_INCLUDE_DEBUGGER_AGENT_H_
+
+#include "uv.h"
+#include "v8.h"
+#include "v8-debug.h"
+
+namespace node {
+
+// Forward declaration
+class Environment;
+
+namespace debugger {
+
+// Forward declaration
+class AgentMessage;
+
+class Agent {
+ public:
+ explicit Agent(node::Environment* env);
+ ~Agent();
+
+ typedef void (*DispatchHandler)(node::Environment* env);
+
+ // Start the debugger agent thread
+ bool Start(int port, bool wait);
+ // Listen for debug events
+ void Enable();
+ // Stop the debugger agent
+ void Stop();
+
+ inline void set_dispatch_handler(DispatchHandler handler) {
+ dispatch_handler_ = handler;
+ }
+
+ inline node::Environment* parent_env() const { return parent_env_; }
+ inline node::Environment* child_env() const { return child_env_; }
+
+ protected:
+ void InitAdaptor(Environment* env);
+
+ // Worker body
+ void WorkerRun();
+
+ static void ThreadCb(Agent* agent);
+ static void ParentSignalCb(uv_async_t* signal);
+ static void ChildSignalCb(uv_async_t* signal);
+ static void MessageHandler(const v8::Debug::Message& message);
+
+ // V8 API
+ static Agent* Unwrap(const v8::FunctionCallbackInfo& args);
+ static void NotifyListen(const v8::FunctionCallbackInfo& args);
+ static void NotifyWait(const v8::FunctionCallbackInfo& args);
+ static void SendCommand(const v8::FunctionCallbackInfo& args);
+
+ void EnqueueMessage(AgentMessage* message);
+
+ enum State {
+ kNone,
+ kRunning
+ };
+
+ // TODO(indutny): Verify that there are no races
+ State state_;
+
+ int port_;
+ bool wait_;
+
+ uv_sem_t start_sem_;
+ uv_mutex_t message_mutex_;
+ uv_async_t child_signal_;
+
+ uv_thread_t thread_;
+ node::Environment* parent_env_;
+ node::Environment* child_env_;
+ uv_loop_t child_loop_;
+ v8::Persistent api_;
+
+ // QUEUE
+ void* messages_[2];
+
+ DispatchHandler dispatch_handler_;
+};
+
+} // namespace debugger
+} // namespace node
+
+#endif // DEPS_DEBUGGER_AGENT_INCLUDE_DEBUGGER_AGENT_H_
diff --git a/deps/debugger-agent/lib/_debugger_agent.js b/deps/debugger-agent/lib/_debugger_agent.js
new file mode 100644
index 0000000000000000000000000000000000000000..680c5e95c4982f41cba7fe38d5f69471a11d9734
--- /dev/null
+++ b/deps/debugger-agent/lib/_debugger_agent.js
@@ -0,0 +1,191 @@
+var assert = require('assert');
+var net = require('net');
+var util = require('util');
+var Buffer = require('buffer').Buffer;
+
+var Transform = require('stream').Transform;
+
+exports.start = function start() {
+ var agent = new Agent();
+
+ // Do not let `agent.listen()` request listening from cluster master
+ var cluster = require('cluster');
+ cluster.isWorker = false;
+ cluster.isMaster = true;
+
+ agent.on('error', function(err) {
+ process._rawDebug(err.stack || err);
+ });
+
+ agent.listen(process._debugAPI.port, function() {
+ var addr = this.address();
+ process._rawDebug('Debugger listening on port %d', addr.port);
+ process._debugAPI.notifyListen();
+ });
+
+ // Just to spin-off events
+ // TODO(indutny): Figure out why node.cc isn't doing this
+ setImmediate(function() {
+ });
+
+ process._debugAPI.onclose = function() {
+ // We don't care about it, but it prevents loop from cleaning up gently
+ // NOTE: removeAllListeners won't work, as it doesn't call `removeListener`
+ process.listeners('SIGWINCH').forEach(function(fn) {
+ process.removeListener('SIGWINCH', fn);
+ });
+
+ agent.close();
+ };
+
+ // Not used now, but anyway
+ return agent;
+};
+
+function Agent() {
+ net.Server.call(this, this.onConnection);
+
+ this.first = true;
+ this.binding = process._debugAPI;
+
+ var self = this;
+ this.binding.onmessage = function(msg) {
+ self.clients.forEach(function(client) {
+ client.send({}, msg);
+ });
+ };
+
+ this.clients = [];
+ assert(this.binding, 'Debugger agent running without bindings!');
+}
+util.inherits(Agent, net.Server);
+
+Agent.prototype.onConnection = function onConnection(socket) {
+ var c = new Client(this, socket);
+
+ c.start();
+ this.clients.push(c);
+
+ var self = this;
+ c.once('close', function() {
+ var index = self.clients.indexOf(c);
+ assert(index !== -1);
+ self.clients.splice(index, 1);
+ });
+};
+
+Agent.prototype.notifyWait = function notifyWait() {
+ if (this.first)
+ this.binding.notifyWait();
+ this.first = false;
+};
+
+function Client(agent, socket) {
+ Transform.call(this);
+ this._readableState.objectMode = true;
+
+ this.agent = agent;
+ this.binding = this.agent.binding;
+ this.socket = socket;
+
+ // Parse incoming data
+ this.state = 'headers';
+ this.headers = {};
+ this.buffer = '';
+ socket.pipe(this);
+
+ this.on('data', this.onCommand);
+
+ var self = this;
+ this.socket.on('close', function() {
+ self.destroy();
+ });
+}
+util.inherits(Client, Transform);
+
+Client.prototype.destroy = function destroy(msg) {
+ this.socket.destroy();
+
+ this.emit('close');
+};
+
+Client.prototype._transform = function _transform(data, enc, cb) {
+ cb();
+
+ this.buffer += data;
+
+ while (true) {
+ if (this.state === 'headers') {
+ // Not enough data
+ if (!/\r\n/.test(this.buffer))
+ break;
+
+ if (/^\r\n/.test(this.buffer)) {
+ this.buffer = this.buffer.slice(2);
+ this.state = 'body';
+ continue;
+ }
+
+ // Match:
+ // Header-name: header-value\r\n
+ var match = this.buffer.match(/^([^:\s\r\n]+)\s*:\s*([^\s\r\n]+)\r\n/);
+ if (!match)
+ return this.destroy('Expected header, but failed to parse it');
+
+ this.headers[match[1].toLowerCase()] = match[2];
+
+ this.buffer = this.buffer.slice(match[0].length);
+ } else {
+ var len = this.headers['content-length'];
+ if (len === undefined)
+ return this.destroy('Expected content-length');
+
+ len = len | 0;
+ if (Buffer.byteLength(this.buffer) < len)
+ break;
+
+ this.push(new Command(this.headers, this.buffer.slice(0, len)));
+ this.state = 'headers';
+ this.buffer = this.buffer.slice(len);
+ this.headers = {};
+ }
+ }
+};
+
+Client.prototype.send = function send(headers, data) {
+ if (!data)
+ data = '';
+
+ var out = [];
+ Object.keys(headers).forEach(function(key) {
+ out.push(key + ': ' + headers[key]);
+ });
+ out.push('Content-Length: ' + Buffer.byteLength(data), '');
+
+ this.socket.cork();
+ this.socket.write(out.join('\r\n') + '\r\n');
+
+ if (data.length > 0)
+ this.socket.write(data);
+ this.socket.uncork();
+};
+
+Client.prototype.start = function start() {
+ this.send({
+ Type: 'connect',
+ 'V8-Version': process.versions.v8,
+ 'Protocol-Version': 1,
+ 'Embedding-Host': 'node ' + process.version
+ });
+};
+
+Client.prototype.onCommand = function onCommand(cmd) {
+ this.binding.sendCommand(cmd.body);
+
+ this.agent.notifyWait();
+};
+
+function Command(headers, body) {
+ this.headers = headers;
+ this.body = body;
+}
diff --git a/deps/debugger-agent/src/agent.cc b/deps/debugger-agent/src/agent.cc
new file mode 100644
index 0000000000000000000000000000000000000000..335737ffe9e33f37b6fdebfe5db5def621c271e3
--- /dev/null
+++ b/deps/debugger-agent/src/agent.cc
@@ -0,0 +1,347 @@
+// Copyright Fedor Indutny and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#include "agent.h"
+#include "debugger-agent.h"
+
+#include "node.h"
+#include "node_internals.h" // ARRAY_SIZE
+#include "env.h"
+#include "env-inl.h"
+#include "v8.h"
+#include "v8-debug.h"
+#include "util.h"
+#include "util-inl.h"
+#include "queue.h"
+
+#include
+
+namespace node {
+namespace debugger {
+
+using v8::Context;
+using v8::Function;
+using v8::FunctionCallbackInfo;
+using v8::FunctionTemplate;
+using v8::Handle;
+using v8::HandleScope;
+using v8::Integer;
+using v8::Isolate;
+using v8::Local;
+using v8::Locker;
+using v8::Object;
+using v8::String;
+using v8::Value;
+
+
+Agent::Agent(Environment* env) : state_(kNone),
+ port_(5858),
+ wait_(false),
+ parent_env_(env),
+ child_env_(NULL),
+ dispatch_handler_(NULL) {
+ int err;
+
+ err = uv_sem_init(&start_sem_, 0);
+ CHECK_EQ(err, 0);
+
+ err = uv_mutex_init(&message_mutex_);
+ CHECK_EQ(err, 0);
+
+ QUEUE_INIT(&messages_);
+}
+
+
+Agent::~Agent() {
+ Stop();
+
+ uv_sem_destroy(&start_sem_);
+ uv_mutex_destroy(&message_mutex_);
+
+ // Clean-up messages
+ while (!QUEUE_EMPTY(&messages_)) {
+ QUEUE* q = QUEUE_HEAD(&messages_);
+ QUEUE_REMOVE(q);
+ AgentMessage* msg = ContainerOf(&AgentMessage::member, q);
+ delete msg;
+ }
+}
+
+
+bool Agent::Start(int port, bool wait) {
+ int err;
+
+ if (state_ == kRunning)
+ return false;
+
+ err = uv_loop_init(&child_loop_);
+ if (err != 0)
+ goto loop_init_failed;
+
+ // Interruption signal handler
+ err = uv_async_init(&child_loop_, &child_signal_, ChildSignalCb);
+ if (err != 0)
+ goto async_init_failed;
+ uv_unref(reinterpret_cast(&child_signal_));
+
+ port_ = port;
+ wait_ = wait;
+
+ err = uv_thread_create(&thread_,
+ reinterpret_cast(ThreadCb),
+ this);
+ if (err != 0)
+ goto thread_create_failed;
+
+ uv_sem_wait(&start_sem_);
+
+ state_ = kRunning;
+
+ return true;
+
+ thread_create_failed:
+ uv_close(reinterpret_cast(&child_signal_), NULL);
+
+ async_init_failed:
+ err = uv_loop_close(&child_loop_);
+ CHECK_EQ(err, 0);
+
+ loop_init_failed:
+ return false;
+}
+
+
+void Agent::Enable() {
+ v8::Debug::SetMessageHandler(MessageHandler);
+
+ // Assign environment to the debugger's context
+ // NOTE: The debugger context is created after `SetMessageHandler()` call
+ parent_env()->AssignToContext(v8::Debug::GetDebugContext());
+}
+
+
+void Agent::Stop() {
+ int err;
+
+ if (state_ != kRunning) {
+ return;
+ }
+
+ v8::Debug::SetMessageHandler(NULL);
+
+ // Send empty message to terminate things
+ EnqueueMessage(new AgentMessage(NULL, 0));
+
+ // Signal worker thread to make it stop
+ err = uv_async_send(&child_signal_);
+ CHECK_EQ(err, 0);
+
+ err = uv_thread_join(&thread_);
+ CHECK_EQ(err, 0);
+
+ uv_close(reinterpret_cast(&child_signal_), NULL);
+ uv_run(&child_loop_, UV_RUN_NOWAIT);
+
+ err = uv_loop_close(&child_loop_);
+ CHECK_EQ(err, 0);
+
+ state_ = kNone;
+}
+
+
+void Agent::WorkerRun() {
+ static const char* argv[] = { "node", "--debug-agent" };
+ Isolate* isolate = Isolate::New();
+ {
+ Locker locker(isolate);
+ Isolate::Scope isolate_scope(isolate);
+
+ HandleScope handle_scope(isolate);
+ Local context = Context::New(isolate);
+
+ Context::Scope context_scope(context);
+ Environment* env = CreateEnvironment(
+ isolate,
+ &child_loop_,
+ context,
+ ARRAY_SIZE(argv),
+ argv,
+ ARRAY_SIZE(argv),
+ argv);
+
+ child_env_ = env;
+
+ // Expose API
+ InitAdaptor(env);
+ LoadEnvironment(env);
+
+ CHECK_EQ(&child_loop_, env->event_loop());
+ uv_run(&child_loop_, UV_RUN_DEFAULT);
+
+ // Clean-up peristent
+ api_.Reset();
+
+ // Clean-up all running handles
+ env->CleanupHandles();
+
+ env->Dispose();
+ env = NULL;
+ }
+ isolate->Dispose();
+}
+
+
+void Agent::InitAdaptor(Environment* env) {
+ Isolate* isolate = env->isolate();
+ HandleScope scope(isolate);
+
+ // Create API adaptor
+ Local t = FunctionTemplate::New(isolate);
+ t->InstanceTemplate()->SetInternalFieldCount(1);
+ t->SetClassName(String::NewFromUtf8(isolate, "DebugAPI"));
+
+ NODE_SET_PROTOTYPE_METHOD(t, "notifyListen", NotifyListen);
+ NODE_SET_PROTOTYPE_METHOD(t, "notifyWait", NotifyWait);
+ NODE_SET_PROTOTYPE_METHOD(t, "sendCommand", SendCommand);
+
+ Local
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.
@@ -161,7 +161,7 @@ ban your account in extreme cases. So don't do that.
diff --git a/deps/npm/html/doc/api/npm-deprecate.html b/deps/npm/html/doc/api/npm-deprecate.html
index 557d2efe3c46a059c88d6497eb377b39439176d6..dda88578a827559d99b540ebde84bb6ae7ae6e46 100644
--- a/deps/npm/html/doc/api/npm-deprecate.html
+++ b/deps/npm/html/doc/api/npm-deprecate.html
@@ -47,5 +47,5 @@ a deprecation warning to all who attempt to install it.
-
npm-deprecate — npm@1.4.28
+
npm-deprecate — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-docs.html b/deps/npm/html/doc/api/npm-docs.html
index d42b27b037ffec99f38b874f2b981b8f029b3454..076e9b4f820db8bf5736301f00362442c8647a83 100644
--- a/deps/npm/html/doc/api/npm-docs.html
+++ b/deps/npm/html/doc/api/npm-docs.html
@@ -33,5 +33,5 @@ friendly for programmatic use.
-
npm-docs — npm@1.4.28
+
npm-docs — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-edit.html b/deps/npm/html/doc/api/npm-edit.html
index f6f4617e1281a64dd6d906376b4ef37cc93a66f4..c9702a0b46378de56c4a67060f10ed079fef11b6 100644
--- a/deps/npm/html/doc/api/npm-edit.html
+++ b/deps/npm/html/doc/api/npm-edit.html
@@ -36,5 +36,5 @@ and how this is used.
-
npm-edit — npm@1.4.28
+
npm-edit — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-explore.html b/deps/npm/html/doc/api/npm-explore.html
index 0136e705a2aa2c4afd8536ff194f893bdea2ae7e..be8556656ff4d962370176664af21ff88437c4f4 100644
--- a/deps/npm/html/doc/api/npm-explore.html
+++ b/deps/npm/html/doc/api/npm-explore.html
@@ -31,5 +31,5 @@ sure to use npm rebuild <pkg> if you make any changes.
-
npm-explore — npm@1.4.28
+
npm-explore — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-help-search.html b/deps/npm/html/doc/api/npm-help-search.html
index e2bb08abbd009122e3459511f97480d2810208ab..852f0bc46e00100577ab7d6036fc0d86d9c1264c 100644
--- a/deps/npm/html/doc/api/npm-help-search.html
+++ b/deps/npm/html/doc/api/npm-help-search.html
@@ -44,5 +44,5 @@ Name of the file that matched
-
npm-help-search — npm@1.4.28
+
npm-help-search — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-init.html b/deps/npm/html/doc/api/npm-init.html
index ca23df8f483049e6b1c2aa403820d0540d58c14a..dac576d345e744688469fe283d64c1815a958453 100644
--- a/deps/npm/html/doc/api/npm-init.html
+++ b/deps/npm/html/doc/api/npm-init.html
@@ -39,5 +39,5 @@ then go ahead and use this programmatically.
-
npm-init — npm@1.4.28
+
npm-init — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-install.html b/deps/npm/html/doc/api/npm-install.html
index c0e0eb78bff4350665b249e4ec6c43ad668fecae..204f1dfb893a7ee8dce37cabcb996c43fc25a3c4 100644
--- a/deps/npm/html/doc/api/npm-install.html
+++ b/deps/npm/html/doc/api/npm-install.html
@@ -32,5 +32,5 @@ installed or when an error has been encountered.
-
npm-install — npm@1.4.28
+
npm-install — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-link.html b/deps/npm/html/doc/api/npm-link.html
index aff1250a4ccccb40ef32f6e4166c3468afdcd5cf..4eef789e6b76e03103ed052bbfde8f5a966cba94 100644
--- a/deps/npm/html/doc/api/npm-link.html
+++ b/deps/npm/html/doc/api/npm-link.html
@@ -42,5 +42,5 @@ the package in the current working directory
diff --git a/deps/npm/html/doc/api/npm-ls.html b/deps/npm/html/doc/api/npm-ls.html
index f1c2504918d03ee5ac3138e16608dbc7bf68d651..a3807d8fd319fb23c242747f2f4535d99cf19292 100644
--- a/deps/npm/html/doc/api/npm-ls.html
+++ b/deps/npm/html/doc/api/npm-ls.html
@@ -63,5 +63,5 @@ dependency will only be output once.
-
npm-ls — npm@1.4.28
+
npm-ls — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-outdated.html b/deps/npm/html/doc/api/npm-outdated.html
index a7e88b882c2a4e940727fbb4b1dfb3bf8d4f8c71..c566630a4022173aa5438c52fc3d5fd44439d650 100644
--- a/deps/npm/html/doc/api/npm-outdated.html
+++ b/deps/npm/html/doc/api/npm-outdated.html
@@ -28,5 +28,5 @@ currently outdated.
-
npm-outdated — npm@1.4.28
+
npm-outdated — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-owner.html b/deps/npm/html/doc/api/npm-owner.html
index eb8f9abafa1ca08a74a3736398c91a73d80672ca..d2b336bd95a4ea4929ebddf502635a3073e5153f 100644
--- a/deps/npm/html/doc/api/npm-owner.html
+++ b/deps/npm/html/doc/api/npm-owner.html
@@ -47,5 +47,5 @@ that is not implemented at this time.
-
npm-owner — npm@1.4.28
+
npm-owner — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-pack.html b/deps/npm/html/doc/api/npm-pack.html
index c2476f20e00956ac18e0cc8aa0c1abdb7b5590d8..1adb04959b9811e79610674ea46733e84d2fbe69 100644
--- a/deps/npm/html/doc/api/npm-pack.html
+++ b/deps/npm/html/doc/api/npm-pack.html
@@ -33,5 +33,5 @@ overwritten the second time.
diff --git a/deps/npm/html/doc/api/npm-publish.html b/deps/npm/html/doc/api/npm-publish.html
index 9d338cebbd7aaf5d57571e895e1fefc19e840f5b..ae352eb5651f100563667c7fb1f66a58f42c20e3 100644
--- a/deps/npm/html/doc/api/npm-publish.html
+++ b/deps/npm/html/doc/api/npm-publish.html
@@ -46,5 +46,5 @@ the registry. Overwrites when the "force" environment variable is set
-
npm-publish — npm@1.4.28
+
npm-publish — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-rebuild.html b/deps/npm/html/doc/api/npm-rebuild.html
index 821becbf54377f680e9dd066ad85b941f045640c..1cb5fffc23f623deb345b7d44cbb1facf21e0f5b 100644
--- a/deps/npm/html/doc/api/npm-rebuild.html
+++ b/deps/npm/html/doc/api/npm-rebuild.html
@@ -30,5 +30,5 @@ the new binary. If no 'packages' parameter is specify, every package wil
-
npm-rebuild — npm@1.4.28
+
npm-rebuild — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-repo.html b/deps/npm/html/doc/api/npm-repo.html
index d624659c15595069d4f7add6681a91bd5b4f8ea9..2c40c8ed1faf76bc05c6fa3a9a0ad69033bab942 100644
--- a/deps/npm/html/doc/api/npm-repo.html
+++ b/deps/npm/html/doc/api/npm-repo.html
@@ -33,5 +33,5 @@ friendly for programmatic use.
-
npm-repo — npm@1.4.28
+
npm-repo — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-restart.html b/deps/npm/html/doc/api/npm-restart.html
index 67729df285db3fd28fc2fec2d4446c79bf7e830f..382d44ac97f2ad473ee98c7aabf64ca799c16f72 100644
--- a/deps/npm/html/doc/api/npm-restart.html
+++ b/deps/npm/html/doc/api/npm-restart.html
@@ -36,5 +36,5 @@ in the packages parameter.
diff --git a/deps/npm/html/doc/api/npm-run-script.html b/deps/npm/html/doc/api/npm-run-script.html
index c7ca6138338efe9c6459323e7552327e34614886..b5ef6879973bcae295a29791a80c7f518d211dc4 100644
--- a/deps/npm/html/doc/api/npm-run-script.html
+++ b/deps/npm/html/doc/api/npm-run-script.html
@@ -41,5 +41,5 @@ assumed to be the command to run. All other elements are ignored.
diff --git a/deps/npm/html/doc/api/npm-shrinkwrap.html b/deps/npm/html/doc/api/npm-shrinkwrap.html
index 172646a9ee59a74c64f890d8cf93cbda4351560f..e5bf33ae4cd194b5a61fb4ea9924d1a451306392 100644
--- a/deps/npm/html/doc/api/npm-shrinkwrap.html
+++ b/deps/npm/html/doc/api/npm-shrinkwrap.html
@@ -33,5 +33,5 @@ been saved.
-
npm-shrinkwrap — npm@1.4.28
+
npm-shrinkwrap — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-start.html b/deps/npm/html/doc/api/npm-start.html
index 813b28ce2aac542e74f4fe1576d1a9f552f5165e..fa8a3db835e9c8425a5c964446eeb9a92ebe59d4 100644
--- a/deps/npm/html/doc/api/npm-start.html
+++ b/deps/npm/html/doc/api/npm-start.html
@@ -28,5 +28,5 @@ in the packages parameter.
-
npm-start — npm@1.4.28
+
npm-start — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-stop.html b/deps/npm/html/doc/api/npm-stop.html
index 65f5c9f26e6180ab562052ed196a6df1a1600c97..bdcf72bde8e88c2673026039269bdec8e417ca93 100644
--- a/deps/npm/html/doc/api/npm-stop.html
+++ b/deps/npm/html/doc/api/npm-stop.html
@@ -28,5 +28,5 @@ in the packages parameter.
-
npm-stop — npm@1.4.28
+
npm-stop — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-submodule.html b/deps/npm/html/doc/api/npm-submodule.html
index 35364403c35ce422de046f22d3f0c92ba81e5a17..f7dfcca43434851beb42bd7c3359c93c4037cc48 100644
--- a/deps/npm/html/doc/api/npm-submodule.html
+++ b/deps/npm/html/doc/api/npm-submodule.html
@@ -42,5 +42,5 @@ dependencies into the submodule folder.
-
npm-submodule — npm@1.4.28
+
npm-submodule — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-tag.html b/deps/npm/html/doc/api/npm-tag.html
index cf9c71c3c502c740b57bb3b1fe23b7650747b9ae..2f94ed7f23a8fb0a7501a9b39fb1bf4f7ca600e4 100644
--- a/deps/npm/html/doc/api/npm-tag.html
+++ b/deps/npm/html/doc/api/npm-tag.html
@@ -36,5 +36,5 @@ used. For more information about how to set this config, check
-
npm-tag — npm@1.4.28
+
npm-tag — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-test.html b/deps/npm/html/doc/api/npm-test.html
index f2d37483ac38b6f88d6bb541896f004f8f9164ed..3247238ef981a1ef225bcd4b332f1eeace35ac94 100644
--- a/deps/npm/html/doc/api/npm-test.html
+++ b/deps/npm/html/doc/api/npm-test.html
@@ -30,5 +30,5 @@ in the packages parameter.
-
npm-test — npm@1.4.28
+
npm-test — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-uninstall.html b/deps/npm/html/doc/api/npm-uninstall.html
index 2abfd08996462284be2cf19273688634be81e1d8..ffd317e48447cfe738cc09fad243a34c852630f5 100644
--- a/deps/npm/html/doc/api/npm-uninstall.html
+++ b/deps/npm/html/doc/api/npm-uninstall.html
@@ -30,5 +30,5 @@ uninstalled or when an error has been encountered.
-
npm-uninstall — npm@1.4.28
+
npm-uninstall — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-unpublish.html b/deps/npm/html/doc/api/npm-unpublish.html
index f6412cf7d189478a20754c06e887dd273b23146c..e35acac1d1d28f630c4d1201b96136d07ebad1d8 100644
--- a/deps/npm/html/doc/api/npm-unpublish.html
+++ b/deps/npm/html/doc/api/npm-unpublish.html
@@ -33,5 +33,5 @@ the root package entry is removed from the registry entirely.
diff --git a/deps/npm/html/doc/api/npm-version.html b/deps/npm/html/doc/api/npm-version.html
index 898582216478da7d62db47d68158e1799f7dfba6..376d8b9807a09b007414900b61830944b86813af 100644
--- a/deps/npm/html/doc/api/npm-version.html
+++ b/deps/npm/html/doc/api/npm-version.html
@@ -32,5 +32,5 @@ not have exactly one element. The only element should be a version number.
-
npm-version — npm@1.4.28
+
npm-version — npm@2.0.0
diff --git a/deps/npm/html/doc/api/npm-view.html b/deps/npm/html/doc/api/npm-view.html
index 59f68ee64ac0451fce9de7b490239b1ba8fab866..482d912677c892f1362f9820940d8a53d1d58170 100644
--- a/deps/npm/html/doc/api/npm-view.html
+++ b/deps/npm/html/doc/api/npm-view.html
@@ -81,5 +81,5 @@ the field name.
This is the API documentation for npm.
To find documentation of the command line
@@ -110,5 +110,5 @@ method names. Use the npm.deref method to find the real name.
Create or verify a user named <username> in the npm registry, and
-save the credentials to the .npmrc file.
+
Create or verify a user named <username> in the specified registry, and
+save the credentials to the .npmrc file. If no registry is specified,
+the default registry will be used (see npm-config(7)).
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.
The base URL of the npm package registry. If scope is also specified,
+this registry will only be used for packages with that scope. See npm-scope(7).
+
scope
+
Default: none
+
If specified, the user and login credentials given will be associated
+with the specified scope. See npm-scope(7). You can use both at the same time,
+e.g.
diff --git a/deps/npm/html/doc/cli/npm-bugs.html b/deps/npm/html/doc/cli/npm-bugs.html
index 8693485aa3bcc9812c049efd2714256eebbe1b65..e7ce93bc9d67d19c9d19fae3b137ef2cb148d65f 100644
--- a/deps/npm/html/doc/cli/npm-bugs.html
+++ b/deps/npm/html/doc/cli/npm-bugs.html
@@ -54,5 +54,5 @@ a package.json in the current folder and use the name
-
npm-bugs — npm@1.4.28
+
npm-bugs — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html
index 58dfd36fde0a69e943e74a8adbf675ce6d1770c7..e2f60bb118197c8db008709b1c945447f137239d 100644
--- a/deps/npm/html/doc/cli/npm-build.html
+++ b/deps/npm/html/doc/cli/npm-build.html
@@ -38,5 +38,5 @@ A folder containing a package.json file in its root.
-
npm-build — npm@1.4.28
+
npm-build — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-bundle.html b/deps/npm/html/doc/cli/npm-bundle.html
index 47355abbf215cb32b4559aa427d221e5ffc3dd90..0bdbb1ef979a11ad6a3359bf6f48d873ec235a84 100644
--- a/deps/npm/html/doc/cli/npm-bundle.html
+++ b/deps/npm/html/doc/cli/npm-bundle.html
@@ -31,5 +31,5 @@ install packages into the local space.
-
npm-bundle — npm@1.4.28
+
npm-bundle — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-cache.html b/deps/npm/html/doc/cli/npm-cache.html
index 3b84f979dccdf1a939c3e32ec4ddede6e88beb8d..a384b71b2fb99ebadbf65a1927b041af0211fc1e 100644
--- a/deps/npm/html/doc/cli/npm-cache.html
+++ b/deps/npm/html/doc/cli/npm-cache.html
@@ -81,5 +81,5 @@ they do not make an HTTP request to the registry.
-
npm-cache — npm@1.4.28
+
npm-cache — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-completion.html b/deps/npm/html/doc/cli/npm-completion.html
index cc56d45623d45bd7310f3d148c612730ac1c7b37..2d0dae8c8d95257087add724b29513896c6c7d97 100644
--- a/deps/npm/html/doc/cli/npm-completion.html
+++ b/deps/npm/html/doc/cli/npm-completion.html
@@ -42,5 +42,5 @@ completions based on the arguments.
-
npm-completion — npm@1.4.28
+
npm-completion — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html
index 52efed825b98ac435ca5438f3c0a395e9bdfbbf5..cf19f65265a05729da8cb8e6ea454954b16f58f1 100644
--- a/deps/npm/html/doc/cli/npm-config.html
+++ b/deps/npm/html/doc/cli/npm-config.html
@@ -66,5 +66,5 @@ global config.
diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html
index 01640248b575146dc77b871db9fcd745492d0764..f4c568cc6d87dc597e8ab4291d5397f16a905a4f 100644
--- a/deps/npm/html/doc/cli/npm-deprecate.html
+++ b/deps/npm/html/doc/cli/npm-deprecate.html
@@ -38,5 +38,5 @@ something like this:
-
npm-deprecate — npm@1.4.28
+
npm-deprecate — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html
index 05b445cdaed2b701d56e7a96bfd6c215ccf95f6c..14f447987c7fbb44dc2569ae70fb4975dcaa105e 100644
--- a/deps/npm/html/doc/cli/npm-docs.html
+++ b/deps/npm/html/doc/cli/npm-docs.html
@@ -56,5 +56,5 @@ the current folder and use the name property.
-
npm-docs — npm@1.4.28
+
npm-docs — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-edit.html b/deps/npm/html/doc/cli/npm-edit.html
index 50d21486a0eca813413a1a57edfd5a7f8c586486..542404cd913e6ac8628de60a5487dbe054b40614 100644
--- a/deps/npm/html/doc/cli/npm-edit.html
+++ b/deps/npm/html/doc/cli/npm-edit.html
@@ -49,5 +49,5 @@ or "notepad" on Windows.
-
npm-edit — npm@1.4.28
+
npm-edit — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-explore.html b/deps/npm/html/doc/cli/npm-explore.html
index c3c3127de6c2e07a85639716b946e2b63564f416..15d7761ce08c7cd0cb2499380f5b35d0dd4d92a0 100644
--- a/deps/npm/html/doc/cli/npm-explore.html
+++ b/deps/npm/html/doc/cli/npm-explore.html
@@ -50,5 +50,5 @@ Windows
-
npm-explore — npm@1.4.28
+
npm-explore — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-help-search.html b/deps/npm/html/doc/cli/npm-help-search.html
index d09aecf8c1bcddfc91a8fcec761fa401c1a4fa5d..22ddb9dd5194c18691db99ff8829913de2f9385c 100644
--- a/deps/npm/html/doc/cli/npm-help-search.html
+++ b/deps/npm/html/doc/cli/npm-help-search.html
@@ -46,5 +46,5 @@ where the terms were found in the documentation.
-
npm-help-search — npm@1.4.28
+
npm-help-search — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html
index bb5a2e16677ca999e2476b5115f056e96754345b..52096aa57e71360a96994daaf31af8a0583e2855 100644
--- a/deps/npm/html/doc/cli/npm-help.html
+++ b/deps/npm/html/doc/cli/npm-help.html
@@ -52,5 +52,5 @@ matches are equivalent to specifying a topic name.
-
npm-help — npm@1.4.28
+
npm-help — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html
index ec53ca256799a1609bebdd9d70c5485740cadbd9..6b4bfe10cb955b8cb5ad7456ede91fbaaefb98bd 100644
--- a/deps/npm/html/doc/cli/npm-init.html
+++ b/deps/npm/html/doc/cli/npm-init.html
@@ -38,5 +38,5 @@ without a really good reason to do so.
Do a <name>@<tag> install, where <tag> is the "tag" config. (See
npm-config(7).)
In most cases, this will install the latest version
@@ -85,8 +85,16 @@ package.json, there is an additional, optional flag:
--save-exact: Saved dependencies will be configured with an
exact version rather than using npm's default semver range
operator.
+
<scope> is optional. The package will be downloaded from the registry
+associated with the specified scope. If no registry is associated with
+the given scope the default registry is assumed. See npm-scope(7).
+
Note: if you do not include the @-symbol on your scope name, npm will
+interpret this as a GitHub repository instead, see below. Scopes names
+must also be followed by a slash.
Examples:
npm install sax --save
+npm install githubname/reponame
+npm install @myorg/privatepackage
npm install node-tap --save-dev
npm install dtrace-provider --save-optional
npm install readable-stream --save --save-exact
@@ -98,27 +106,38 @@ npm install readable-stream --save --save-exact
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>:
+
npm install [@<scope>/]<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.
Install a version of the package matching the specified version range. This
will follow the same rules for resolving dependencies described in package.json(5).
Note that most version ranges must be put in quotes so that your shell will
treat it as a single argument.
npm link (in package folder)
-npm link <pkgname>
+npm link [@<scope>/]<pkgname>
npm ln (with any of the previous argument usage)
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.
+symbolic link from prefix/package-name to the current folder (see
+npm-config(7) for the value of prefix).
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.
+
The package name can be optionally prefixed with a scope. See npm-scope(7).
+The scope must by preceded by an @-symbol and followed by a slash.
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.
+
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
@@ -43,7 +45,10 @@ npm link ../node-redis # link the dir of your dependency
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
+
If your linked package is scoped (see npm-scope(7)) your link command must
+include that scope, e.g.
npm list [<pkg> ...]
-npm ls [<pkg> ...]
-npm la [<pkg> ...]
-npm ll [<pkg> ...]
+
npm list [[@<scope>/]<pkg> ...]
+npm ls [[@<scope>/]<pkg> ...]
+npm la [[@<scope>/]<pkg> ...]
+npm ll [[@<scope>/]<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.
@@ -22,7 +22,7 @@ installed, as well as their dependencies, in a tree-structure.
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:
-
diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html
index 4dd7b386d639084b1f7bf559c12afaeba09a47ce..b2f8f84e5796c6d6b5e1e36ba243e0fe08ddbcb5 100644
--- a/deps/npm/html/doc/cli/npm-owner.html
+++ b/deps/npm/html/doc/cli/npm-owner.html
@@ -49,5 +49,5 @@ that is not implemented at this time.
-
npm-owner — npm@1.4.28
+
npm-owner — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html
index b5a68f27b7c1be40dc6f93c88bfbdba1a90adb1e..5518eb188d9d67b0202c25676304538cc9a2f1db 100644
--- a/deps/npm/html/doc/cli/npm-pack.html
+++ b/deps/npm/html/doc/cli/npm-pack.html
@@ -41,5 +41,5 @@ overwritten the second time.
Publishes a package to the registry so that it can be installed by name.
+
By default npm will publish to the public registry. This can be overridden by
+specifying a different default registry or using a npm-scope(7) in the name
+(see package.json(5)).
<folder>:
A folder containing a package.json file
@@ -30,7 +33,7 @@ and npm install installs the latest tag.
Fails if the package name and version combination already exists in
-the registry.
+the specified registry.
Once a package is published with a given name and version, that
specific name and version combination can never be used again, even if
it is removed with npm-unpublish(1).
diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html
index 3334c695f8df706c802ea864f2dbedafb2bb359a..01d0f33eaf74297f9dc2efb15e7a5c5322432db4 100644
--- a/deps/npm/html/doc/cli/npm-rebuild.html
+++ b/deps/npm/html/doc/cli/npm-rebuild.html
@@ -38,5 +38,5 @@ the new binary.
-
npm-rebuild — npm@1.4.28
+
npm-rebuild — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html
index 3ad91979de18a7ae4006eb8b9f0dfbabbce031f0..350f2fd9c087dc081c4017ea9605ae36b062f7be 100644
--- a/deps/npm/html/doc/cli/npm-repo.html
+++ b/deps/npm/html/doc/cli/npm-repo.html
@@ -42,5 +42,5 @@ a package.json in the current folder and use the name
This runs a package's "restart" script, if one was provided.
Otherwise it runs package's "stop" script, if one was provided, and then
@@ -37,5 +37,5 @@ the "start" script.
-
npm-restart — npm@1.4.28
+
npm-restart — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-rm.html b/deps/npm/html/doc/cli/npm-rm.html
index 8622174552d4b96deabc506ae25eab66ffdd20da..188cb517c88b1864fe75af5ef46b278e3848de3f 100644
--- a/deps/npm/html/doc/cli/npm-rm.html
+++ b/deps/npm/html/doc/cli/npm-rm.html
@@ -39,5 +39,5 @@ on its behalf.
npm run-script [<pkg>] [command]
-npm run [<pkg>] [command]
+
npm run-script [command] [-- <args>]
+npm run [command] [-- <args>]
DESCRIPTION
This runs an arbitrary command from a package's "scripts" object.
If no package name is provided, it will search for a package.json
@@ -40,5 +40,5 @@ called directly, as well.
-
npm-run-script — npm@1.4.28
+
npm-run-script — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html
index cbed4886460a21df880c91aeeb28000d4bbe1501..fac2fac7d71466d3a5bc773fc9e5934591476064 100644
--- a/deps/npm/html/doc/cli/npm-search.html
+++ b/deps/npm/html/doc/cli/npm-search.html
@@ -49,5 +49,5 @@ fall on multiple lines.
-
npm-search — npm@1.4.28
+
npm-search — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html
index 37c8c9c05c84c27388cd77854db4e26c971c0b8a..ec54bc8eb7ddc6e479026e825d9772acea317f18 100644
--- a/deps/npm/html/doc/cli/npm-shrinkwrap.html
+++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html
@@ -164,5 +164,5 @@ contents rather than versions.
-
npm-shrinkwrap — npm@1.4.28
+
npm-shrinkwrap — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html
index 5e98d0f272ddffaf2b115b9b2f69f5be1b787c52..9b7035784b0fb21953433a71fccd0f22992fc2d4 100644
--- a/deps/npm/html/doc/cli/npm-star.html
+++ b/deps/npm/html/doc/cli/npm-star.html
@@ -36,5 +36,5 @@ a vaguely positive way to show that you care.
-
npm-star — npm@1.4.28
+
npm-star — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html
index c13ede22b8f528ffba790d88652c2267879af947..9c3b24da52da02a9f8adf1b90482560a7704c992 100644
--- a/deps/npm/html/doc/cli/npm-stars.html
+++ b/deps/npm/html/doc/cli/npm-stars.html
@@ -37,5 +37,5 @@ you will most certainly enjoy this command.
This runs a package's "stop" script, if one was provided.
SEE ALSO
@@ -34,5 +34,5 @@
-
npm-stop — npm@1.4.28
+
npm-stop — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-submodule.html b/deps/npm/html/doc/cli/npm-submodule.html
index 6716c4a11cce2465c4af2d6f6743f42a188c3546..899005f061b7f2d7c040be5f40a6758affdfec87 100644
--- a/deps/npm/html/doc/cli/npm-submodule.html
+++ b/deps/npm/html/doc/cli/npm-submodule.html
@@ -42,5 +42,5 @@ dependencies into the submodule folder.
-
npm-submodule — npm@1.4.28
+
npm-submodule — npm@2.0.0
diff --git a/deps/npm/html/doc/cli/npm-tag.html b/deps/npm/html/doc/cli/npm-tag.html
index 40a2ffe89fa7bc1a2b94048404f431a0bc441b99..7dfbd1849f60d2c0418f1811713f9376b7779f15 100644
--- a/deps/npm/html/doc/cli/npm-tag.html
+++ b/deps/npm/html/doc/cli/npm-tag.html
@@ -44,5 +44,5 @@ of using a specific version number:
It is generally considered bad behavior to remove versions of a library
that others are depending on!
@@ -26,6 +26,7 @@ the root package entry is removed from the registry entirely.
Even if a package version is unpublished, that specific name and
version combination can never be reused. In order to publish the
package again, a new version number must be used.
+
The scope is optional and follows the usual rules for npm-scope(7).
This command will update all the packages listed to the latest version
(specified by the tag config).
It will also install missing packages.
-
If the -g flag is specified, this command will update globally installed packages.
-If no package name is specified, all packages in the specified location (global or local) will be updated.
+
If the -g flag is specified, this command will update globally installed
+packages.
+
If no package name is specified, all packages in the specified location (global
+or local) will be updated.
npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
@@ -110,7 +110,7 @@ easily by doing npm view npm contributors.
@@ -154,5 +154,5 @@ will no doubt tell you to put the output in a gist or email.
-
npm — npm@1.4.28
+
npm — npm@2.0.0
diff --git a/deps/npm/html/doc/files/npm-folders.html b/deps/npm/html/doc/files/npm-folders.html
index 637b45c382122b7cb32dc7a2bc15a7cd5fa4a44c..cb2b56c29e3f51ce531a1aecb649fea7ef873b6d 100644
--- a/deps/npm/html/doc/files/npm-folders.html
+++ b/deps/npm/html/doc/files/npm-folders.html
@@ -41,6 +41,11 @@ When installing locally, this means that you can
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.)
+
Scoped packages are installed the same way, except they are grouped together
+in a sub-folder of the relevant node_modules folder with the name of that
+scope prefix by the @ symbol, e.g. npm install @myorg/package would place
+the package in {prefix}/node_modules/@myorg/package. See scopes(7) for
+more details.
If you wish to require() a package, then install it locally.
Executables
When in global mode, executables are linked into {prefix}/bin on Unix,
@@ -179,5 +184,5 @@ cannot be found elsewhere. See packa
A name can be optionally prefixed by a scope, e.g. @myorg/mypackage. See
+npm-scope(7) for more detail.
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
@@ -234,6 +236,8 @@ a tarball or git URL.
range1 || range2 Passes if either range1 or range2 are satisfied.
git... See 'Git URLs as Dependencies' below
user/repo See 'GitHub URLs' below
+
tag A specific version tagged and published as tag See npm-tag(1)
@@ -271,7 +277,18 @@ an argument to git checkout. The default is master.
"express": "visionmedia/express"
}
}
-
devDependencies
+
Local Paths
+
As of version 2.0.0 you can provide a path to a local directory that
+contains a package. Local paths can be in the form:
+
../foo/bar
+~/foo/bar
+./foo/bar
+/foo/bar
+
This feature is helpful for local offline development and creating
+tests that require npm installing where you don't want to hit an
+external server, but should not be used when publishing packages
+to the public registry.
+
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.
diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html
index 129661d526f364bb5a9f04f1ef520ce659b25bdc..b00032dba985d636621247a07245405ba51632de 100644
--- a/deps/npm/html/doc/files/package.json.html
+++ b/deps/npm/html/doc/files/package.json.html
@@ -34,6 +34,8 @@ 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/
+
A name can be optionally prefixed by a scope, e.g. @myorg/mypackage. See
+npm-scope(7) for more detail.
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
@@ -234,6 +236,8 @@ a tarball or git URL.
range1 || range2 Passes if either range1 or range2 are satisfied.
git... See 'Git URLs as Dependencies' below
user/repo See 'GitHub URLs' below
+
tag A specific version tagged and published as tag See npm-tag(1)
@@ -271,7 +277,18 @@ an argument to git checkout. The default is master.
"express": "visionmedia/express"
}
}
-
devDependencies
+
Local Paths
+
As of version 2.0.0 you can provide a path to a local directory that
+contains a package. Local paths can be in the form:
+
../foo/bar
+~/foo/bar
+./foo/bar
+/foo/bar
+
This feature is helpful for local offline development and creating
+tests that require npm installing where you don't want to hit an
+external server, but should not be used when publishing packages
+to the public registry.
+
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.
What level of logs to report. On failure, all logs are written to
npm-debug.log in the current working directory.
@@ -568,11 +573,22 @@ devDependencies hash.
Default: '^'
Type: String
-
Configure how versions of packages installed to a package.json file via
+
Configure how versions of packages installed to a package.json file via
--save or --save-dev get prefixed.
For example if a package has version 1.2.3, by default it's version is
-set to ^1.2.3 which allows minor upgrades for that package, but after npm config set save-prefix='~' it would be set to ~1.2.3 which only allows
+set to ^1.2.3 which allows minor upgrades for that package, but after
+npm config set save-prefix='~' it would be set to ~1.2.3 which only allows
patch upgrades.
+
scope
+
+
Default: ""
+
Type: String
+
+
Associate an operation with a scope for a scoped registry. Useful when logging
+in to a private registry for the first time:
+npm login --scope=@organization --registry=registry.organization.com, which
+will cause @organization to be mapped to the registry for future installation
+of packages specified according to the pattern @organization/package.
searchopts
Default: ""
@@ -678,12 +694,6 @@ instead of complete help when doing npm-hel
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.
@@ -51,12 +51,12 @@ Joe's appropriate course of action in each case is the same.
owner (Bob).
Joe emails Bob, explaining the situation as respectfully as
possible, and what he would like to do with the module name. He
-adds the npm support staff support@npmjs.com to the CC list of
+adds the npm support staff support@npmjs.com 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.
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 support
-support@npmjs.com and we'll sort it out. ("Reasonable" is
+support@npmjs.com and we'll sort it out. ("Reasonable" is
usually at least 4 weeks, but extra time is allowed around common
holidays.)
@@ -112,5 +112,5 @@ things into it.
-
npm-disputes — npm@1.4.28
+
npm-disputes — npm@2.0.0
diff --git a/deps/npm/html/doc/misc/npm-faq.html b/deps/npm/html/doc/misc/npm-faq.html
index cdde512eee0c3d6d8c88d5c2a5f63f42685451d1..85536d6f124a1d0cd2bd533ad829a2e300af491c 100644
--- a/deps/npm/html/doc/misc/npm-faq.html
+++ b/deps/npm/html/doc/misc/npm-faq.html
@@ -59,17 +59,16 @@ program that uses it.
in a shell script if you really wanted to.
npm will not help you do something that is known to be a bad idea.
If you are paranoid about depending on the npm ecosystem,
+you should run a private npm mirror or a private cache.
+
If you want 100% confidence in being able to reproduce the specific bytes
+included in a deployment, you should use an additional mechanism that can
+verify contents rather than versions. For example,
+Amazon machine images, DigitalOcean snapshots, Heroku slugs, or simple tarballs.
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.)
@@ -237,7 +236,7 @@ that has a package.json in its root, or a git url.
To check if the registry is down, open up
https://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 us know by emailing support@npmjs.com
+
If the registry IS down, let us know by emailing support@npmjs.com
or posting an issue at https://github.com/npm/npm/issues. If it's
down for the world (and not just on your local network) then we're
probably already being pinged about it.
The registry URL is supplied by the registry config parameter. See
-npm-config(1), npmrc(5), and npm-config(7) for more on managing
-npm's configuration.
The registry URL used is determined by the scope of the package (see
+npm-scope(7)). If no scope is specified, the default registry is used, which is
+supplied by the registry config parameter. See npm-config(1),
+npmrc(5), and npm-config(7) for more on managing npm's configuration.
Can I run my own private registry?
Yes!
The easiest way is to replicate the couch database, and use the same (or
@@ -71,5 +70,5 @@ effectively implement the entire CouchDB API anyway.
-
npm-registry — npm@1.4.28
+
npm-registry — npm@2.0.0
diff --git a/deps/npm/html/doc/misc/npm-scope.html b/deps/npm/html/doc/misc/npm-scope.html
index ae8dfa60376db5e5dc7aa416b0d8c669b7a1f73a..91ac0ae8e1c8856b157a59186013c7a07f1c99c6 100644
--- a/deps/npm/html/doc/misc/npm-scope.html
+++ b/deps/npm/html/doc/misc/npm-scope.html
@@ -78,5 +78,5 @@ that registry instead.
-
npm-scope — npm@2.0.0-beta.3
+
npm-scope — npm@2.0.0
diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html
index 0c2c697a50a930cf83ef9db603a37ac13ae93171..8b65e871cd1c7a8e82657e996184163107763df7 100644
--- a/deps/npm/html/doc/misc/npm-scripts.html
+++ b/deps/npm/html/doc/misc/npm-scripts.html
@@ -41,8 +41,9 @@ Run by the npm start command.
Run by the npm restart command. Note: npm restart will run the
stop and start scripts if no restart script is provided.
-
Additionally, arbitrary scripts can be run by doing
-npm run-script <pkg> <stage>.
+
Additionally, arbitrary scripts can be executed by running `npm run-script
+
. *Pre* and *post* commands with matching names will be run for
+those as well (e.g.premyscript,myscript,postmyscript`).
NOTE: INSTALL SCRIPTS ARE AN ANTIPATTERN
tl;dr Don't use install. Use a .gyp file for compilation, and
prepublish for anything else.
@@ -218,5 +219,5 @@ the user will sudo the npm command in question.
-
npm-scripts — npm@1.4.28
+
npm-scripts — npm@2.0.0
diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html
index afd747c9560d2ca225f40222be4195b99f8c7915..576c73434772310faf3466d23a54ee287135f2d0 100644
--- a/deps/npm/html/doc/misc/removing-npm.html
+++ b/deps/npm/html/doc/misc/removing-npm.html
@@ -57,5 +57,5 @@ modules. To track those down, you can do the following:
-
removing-npm — npm@1.4.28
+
removing-npm — npm@2.0.0
diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html
index 5ab35fa819df4afb2781d185ea6072a90d991076..2a360ea08f3064fadb2204189ac9e10338c7f19a 100644
--- a/deps/npm/html/doc/misc/semver.html
+++ b/deps/npm/html/doc/misc/semver.html
@@ -42,52 +42,150 @@ multiple versions to the utility will just sort them.
http://semver.org/.
A leading "=" or "v" character is stripped off and ignored.
Ranges
-
The following range styles are supported:
+
A version range is a set of comparators which specify versions
+that satisfy the range.
+
A comparator is composed of an operator and a version. The set
+of primitive operators is:
+
+
< Less than
+
<= Less than or equal to
+
> Greater than
+
>= Greater than or equal to
+
= Equal. If no operator is specified, then equality is assumed,
+so this operator is optional, but MAY be included.
+
+
For example, the comparator >=1.2.7 would match the versions
+1.2.7, 1.2.8, 2.5.3, and 1.3.9, but not the versions 1.2.6
+or 1.1.0.
+
Comparators can be joined by whitespace to form a comparator set,
+which is satisfied by the intersection of all of the comparators
+it includes.
+
A range is composed of one or more comparator sets, joined by ||. A
+version matches a range if and only if every comparator in at least
+one of the ||-separated comparator sets is satisfied by the version.
+
For example, the range >=1.2.7 <1.3.0 would match the versions
+1.2.7, 1.2.8, and 1.2.99, but not the versions 1.2.6, 1.3.0,
+or 1.1.0.
+
The range 1.2.7 || >=1.2.9 <2.0.0 would match the versions 1.2.7,
+1.2.9, and 1.4.6, but not the versions 1.2.8 or 2.0.0.
+
Prerelease Tags
+
If a version has a prerelease tag (for example, 1.2.3-alpha.3) then
+it will only be allowed to satisfy comparator sets if at least one
+comparator with the same [major, minor, patch] tuple also has a
+prerelease tag.
+
For example, the range >1.2.3-alpha.3 would be allowed to match the
+version 1.2.3-alpha.7, but it would not be satisfied by
+3.4.5-alpha.9, even though 3.4.5-alpha.9 is technically "greater
+than" 1.2.3-alpha.3 according to the SemVer sort rules. The version
+range only accepts prerelease tags on the 1.2.3 version. The
+version 3.4.5would satisfy the range, because it does not have a
+prerelease flag, and 3.4.5 is greater than 1.2.3-alpha.7.
+
The purpose for this behavior is twofold. First, prerelease versions
+frequently are updated very quickly, and contain many breaking changes
+that are (by the author's design) not yet fit for public consumption.
+Therefore, by default, they are excluded from range matching
+semantics.
+
Second, a user who has opted into using a prerelease version has
+clearly indicated the intent to use that specific set of
+alpha/beta/rc versions. By including a prerelease tag in the range,
+the user is indicating that they are aware of the risk. However, it
+is still not appropriate to assume that they have opted into taking a
+similar risk on the next set of prerelease versions.
+
Advanced Range Syntax
+
Advanced range syntax desugars to primitive comparators in
+deterministic ways.
+
Advanced ranges may be combined in the same way as primitive
+comparators using white space or ||.
+
Hyphen Ranges X.Y.Z - A.B.C
+
Specifies an inclusive set.
-
1.2.3 A specific version. When nothing else will do. Must be a full
-version number, with major, minor, and patch versions specified.
-Note that build metadata is still ignored, so 1.2.3+build2012 will
-satisfy this range.
-
>1.2.3 Greater than a specific version.
-
<1.2.3 Less than a specific version. If there is no prerelease
-tag on the version range, then no prerelease version will be allowed
-either, even though these are technically "less than".
-
>=1.2.3 Greater than or equal to. Note that prerelease versions
-are NOT equal to their "normal" equivalents, so 1.2.3-beta will
-not satisfy this range, but 2.3.0-beta will.
-
<=1.2.3 Less than or equal to. In this case, prerelease versions
-ARE allowed, so 1.2.3-beta would satisfy.
1.2.3 - 2.3.4 := >=1.2.3 <=2.3.4
-
~1.2.3 := >=1.2.3-0 <1.3.0-0 "Reasonably close to 1.2.3". When
-using tilde operators, prerelease versions are supported as well,
-but a prerelease of the next significant digit will NOT be
-satisfactory, so 1.3.0-beta will not satisfy ~1.2.3.
-
^1.2.3 := >=1.2.3-0 <2.0.0-0 "Compatible with 1.2.3". When
-using caret operators, anything from the specified version (including
-prerelease) will be supported up to, but not including, the next
-major version (or its prereleases). 1.5.1 will satisfy ^1.2.3,
-while 1.2.2 and 2.0.0-beta will not.
-
^0.1.3 := >=0.1.3-0 <0.2.0-0 "Compatible with 0.1.3". 0.x.x versions are
-special: the first non-zero component indicates potentially breaking changes,
-meaning the caret operator matches any version with the same first non-zero
-component starting at the specified version.
-
^0.0.2 := =0.0.2 "Only the version 0.0.2 is considered compatible"
-
~1.2 := >=1.2.0-0 <1.3.0-0 "Any version starting with 1.2"
-
^1.2 := >=1.2.0-0 <2.0.0-0 "Any version compatible with 1.2"
-
1.2.x := >=1.2.0-0 <1.3.0-0 "Any version starting with 1.2"
-
1.2.* Same as 1.2.x.
-
1.2 Same as 1.2.x.
-
~1 := >=1.0.0-0 <2.0.0-0 "Any version starting with 1"
-
^1 := >=1.0.0-0 <2.0.0-0 "Any version compatible with 1"
-
1.x := >=1.0.0-0 <2.0.0-0 "Any version starting with 1"
-
1.* Same as 1.x.
-
1 Same as 1.x.
-
* Any version whatsoever.
-
x Same as *.
-
"" (just an empty string) Same as *.
-
Ranges can be joined with either a space (which implies "and") or a
-|| (which implies "or").
+
If a partial version is provided as the first version in the inclusive
+range, then the missing pieces are replaced with zeroes.
+
+
1.2 - 2.3.4 := >=1.2.0 <=2.3.4
+
+
If a partial version is provided as the second version in the
+inclusive range, then all versions that start with the supplied parts
+of the tuple are accepted, but nothing that would be greater than the
+provided tuple parts.
+
+
1.2.3 - 2.3 := >=1.2.3 <2.4.0
+
1.2.3 - 2 := >=1.2.3 <3.0.0
+
+
X-Ranges 1.2.x1.X1.2.**
+
Any of X, x, or * may be used to "stand in" for one of the
+numeric values in the [major, minor, patch] tuple.
+
+
* := >=0.0.0 (Any version satisfies)
+
1.x := >=1.0.0 <2.0.0 (Matching major version)
+
1.2.x := >=1.2.0 <1.3.0 (Matching major and minor versions)
+
+
A partial version range is treated as an X-Range, so the special
+character is in fact optional.
+
+
` (empty string) :=*:=>=0.0.0`
+
1 := 1.x.x := >=1.0.0 <2.0.0
+
1.2 := 1.2.x := >=1.2.0 <1.3.0
+
+
Tilde Ranges ~1.2.3~1.2~1
+
Allows patch-level changes if a minor version is specified on the
+comparator. Allows minor-level changes if not.
+
+
~1.2.3 := >=1.2.3 <1.(2+1).0 := >=1.2.3 <1.3.0
+
~1.2 := >=1.2.0 <1.(2+1).0 := >=1.2.0 <1.3.0 (Same as 1.2.x)
+
~1 := >=1.0.0 <(1+1).0.0 := >=1.0.0 <2.0.0 (Same as 1.x)
+
~0.2.3 := >=0.2.3 <0.(2+1).0 := >=0.2.3 <0.3.0
+
~0.2 := >=0.2.0 <0.(2+1).0 := >=0.2.0 <0.3.0 (Same as 0.2.x)
+
~0 := >=0.0.0 <(0+1).0.0 := >=0.0.0 <1.0.0 (Same as 0.x)
+
~1.2.3-beta.2 := >=1.2.3-beta.2 <1.3.0 Note that prereleases in
+the 1.2.3 version will be allowed, if they are greater than or
+equal to beta.2. So, 1.2.3-beta.4 would be allowed, but
+1.2.4-beta.2 would not, because it is a prerelease of a
+different [major, minor, patch] tuple.
+
+
Note: this is the same as the ~> operator in rubygems.
+
Caret Ranges ^1.2.3^0.2.5^0.0.4
+
Allows changes that do not modify the left-most non-zero digit in the
+[major, minor, patch] tuple. In other words, this allows patch and
+minor updates for versions 1.0.0 and above, patch updates for
+versions 0.X >=0.1.0, and no updates for versions 0.0.X.
+
Many authors treat a 0.x version as if the x were the major
+"breaking-change" indicator.
+
Caret ranges are ideal when an author may make breaking changes
+between 0.2.4 and 0.3.0 releases, which is a common practice.
+However, it presumes that there will not be breaking changes between
+0.2.4 and 0.2.5. It allows for changes that are presumed to be
+additive (but non-breaking), according to commonly observed practices.
+
+
^1.2.3 := >=1.2.3 <2.0.0
+
^0.2.3 := >=0.2.3 <0.3.0
+
^0.0.3 := >=0.0.3 <0.0.4
+
^1.2.3-beta.2 := >=1.2.3-beta.2 <2.0.0 Note that prereleases in
+the 1.2.3 version will be allowed, if they are greater than or
+equal to beta.2. So, 1.2.3-beta.4 would be allowed, but
+1.2.4-beta.2 would not, because it is a prerelease of a
+different [major, minor, patch] tuple.
+
^0.0.3-beta := >=0.0.3-beta <0.0.4 Note that prereleases in the
+0.0.3 version only will be allowed, if they are greater than or
+equal to beta. So, 0.0.3-pr.2 would be allowed.
+
+
When parsing caret ranges, a missing patch value desugars to the
+number 0, but will allow flexibility within that value, even if the
+major and minor versions are both 0.
+
+
^1.2.x := >=1.2.0 <2.0.0
+
^0.0.x := >=0.0.0 <0.1.0
+
^0.0 := >=0.0.0 <0.1.0
+
+
A missing minor and patch values will desugar to zero, but also
+allow flexibility within those values, even if the major version is
+zero.
+
+
^1.x := >=1.0.0 <2.0.0
+
^0.x := >=0.0.0 <1.0.0
+
Functions
All methods and classes take a final loose boolean argument that, if
true, will be more forgiving about not-quite-valid semver strings.
@@ -165,5 +263,5 @@ range, use the satisfies(version, range) function.
-
semver — npm@1.4.28
+
semver — npm@2.0.0
diff --git a/deps/npm/lib/adduser.js b/deps/npm/lib/adduser.js
index 579ecb0a9f8050d57d7fa22352146a80acf75c6e..7e933ea7dfd47f1e58aa51c414ef42b97dc6e674 100644
--- a/deps/npm/lib/adduser.js
+++ b/deps/npm/lib/adduser.js
@@ -19,9 +19,10 @@ function adduser (args, cb) {
if (!crypto) return cb(new Error(
"You must compile node with ssl support to use the adduser feature"))
- var c = { u : npm.config.get("username") || ""
- , p : npm.config.get("_password") || ""
- , e : npm.config.get("email") || ""
+ var creds = npm.config.getCredentialsByURI(npm.config.get("registry"))
+ var c = { u : creds.username || ""
+ , p : creds.password || ""
+ , e : creds.email || ""
}
, u = {}
, fns = [readUsername, readPassword, readEmail, save]
@@ -94,7 +95,7 @@ function readPassword (c, u, cb) {
return readPassword(c, u, cb)
}
- c.changed = c.changed || c.p != pw
+ c.changed = c.changed || c.p !== pw
u.p = pw
cb(er)
})
@@ -132,17 +133,45 @@ function save (c, u, cb) {
registry.password = u.p
}
npm.spinner.start()
+
// save existing configs, but yank off for this PUT
- registry.adduser(npm.config.get("registry"), u.u, u.p, u.e, function (er) {
+ var uri = npm.config.get("registry")
+ var scope = npm.config.get("scope")
+
+ // there may be a saved scope and no --registry (for login)
+ if (scope) {
+ if (scope.charAt(0) !== "@") scope = "@" + scope
+
+ var scopedRegistry = npm.config.get(scope + ":registry")
+ if (scopedRegistry) uri = scopedRegistry
+ }
+
+ registry.adduser(uri, u.u, u.p, u.e, function (er, doc) {
npm.spinner.stop()
if (er) return cb(er)
+
registry.username = u.u
registry.password = u.p
registry.email = u.e
- npm.config.set("username", u.u, "user")
- npm.config.set("_password", u.p, "user")
- npm.config.set("email", u.e, "user")
+
+ // don't want this polluting the configuration
npm.config.del("_token", "user")
+
+ if (scope) npm.config.set(scope + ":registry", uri, "user")
+
+ if (doc && doc.token) {
+ npm.config.setCredentialsByURI(uri, {
+ token : doc.token
+ })
+ }
+ else {
+ npm.config.setCredentialsByURI(uri, {
+ username : u.u,
+ password : u.p,
+ email : u.e
+ })
+ }
+
log.info("adduser", "Authorized user %s", u.u)
npm.config.save("user", cb)
})
diff --git a/deps/npm/lib/bugs.js b/deps/npm/lib/bugs.js
index b3022bf2a2044a6eee4ab67bbd018a44c7377b4d..16744cd5c84e3131c7d10ec3349716a6bb09bc28 100644
--- a/deps/npm/lib/bugs.js
+++ b/deps/npm/lib/bugs.js
@@ -9,19 +9,23 @@ var npm = require("./npm.js")
, opener = require("opener")
, path = require("path")
, readJson = require("read-package-json")
+ , npa = require("npm-package-arg")
, fs = require("fs")
- , url = require("url")
+ , mapToRegistry = require("./utils/map-to-registry.js")
bugs.completion = function (opts, cb) {
if (opts.conf.argv.remain.length > 2) return cb()
- var uri = url.resolve(npm.config.get("registry"), "-/short")
- registry.get(uri, { timeout : 60000 }, function (er, list) {
- return cb(null, list || [])
+ mapToRegistry("-/short", npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.get(uri, { timeout : 60000 }, function (er, list) {
+ return cb(null, list || [])
+ })
})
}
function bugs (args, cb) {
- var n = args.length && args[0].split("@").shift() || '.'
+ var n = args.length && npa(args[0]).name || '.'
fs.stat(n, function (er, s) {
if (er && er.code === "ENOENT") return callRegistry(n, cb)
else if (er) return cb (er)
@@ -56,9 +60,13 @@ function getUrlAndOpen (d, cb) {
}
function callRegistry (n, cb) {
- var uri = url.resolve(npm.config.get("registry"), n + "/latest")
- registry.get(uri, { timeout : 3600 }, function (er, d) {
+ mapToRegistry(n, npm.config, function (er, uri) {
if (er) return cb(er)
- getUrlAndOpen (d, cb)
+
+ registry.get(uri + "/latest", { timeout : 3600 }, function (er, d) {
+ if (er) return cb(er)
+
+ getUrlAndOpen (d, cb)
+ })
})
}
diff --git a/deps/npm/lib/build.js b/deps/npm/lib/build.js
index 350774a453fbd18a4fa03d8c1be12ce484479f63..f1c61bdb8ce355d26862a66e5898c4667b2ea159 100644
--- a/deps/npm/lib/build.js
+++ b/deps/npm/lib/build.js
@@ -75,7 +75,7 @@ function linkStuff (pkg, folder, global, didRB, cb) {
// if it's global, and folder is in {prefix}/node_modules,
// then bins are in {prefix}/bin
// otherwise, then bins are in folder/../.bin
- var parent = path.dirname(folder)
+ var parent = pkg.name[0] === "@" ? path.dirname(path.dirname(folder)) : path.dirname(folder)
, gnm = global && npm.globalDir
, gtop = parent === gnm
@@ -95,7 +95,7 @@ function linkStuff (pkg, folder, global, didRB, cb) {
function shouldWarn(pkg, folder, global, cb) {
var parent = path.dirname(folder)
, top = parent === npm.dir
- , cwd = process.cwd()
+ , cwd = npm.localPrefix
readJson(path.resolve(cwd, "package.json"), function(er, topPkg) {
if (er) return cb(er)
diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js
index 37bba5a06533c101b364380d7d19c32c040896e1..281d6100a9beca9e8df9b199418e3e612c63d1ac 100644
--- a/deps/npm/lib/cache.js
+++ b/deps/npm/lib/cache.js
@@ -47,9 +47,15 @@ adding a name@range:
adding a local tarball:
1. untar to tmp/random/{blah}
2. goto folder(2)
+
+adding a namespaced package:
+1. lookup registry for @namespace
+2. namespace_registry.get('name')
+3. add url(namespace/latest.tarball)
*/
exports = module.exports = cache
+
cache.unpack = unpack
cache.clean = clean
cache.read = read
@@ -61,17 +67,18 @@ var npm = require("./npm.js")
, readJson = require("read-package-json")
, log = require("npmlog")
, path = require("path")
- , url = require("url")
, asyncMap = require("slide").asyncMap
, tar = require("./utils/tar.js")
, fileCompletion = require("./utils/completion/file-completion.js")
- , isGitUrl = require("./utils/is-git-url.js")
, deprCheck = require("./utils/depr-check.js")
, addNamed = require("./cache/add-named.js")
, addLocal = require("./cache/add-local.js")
, addRemoteTarball = require("./cache/add-remote-tarball.js")
, addRemoteGit = require("./cache/add-remote-git.js")
+ , maybeGithub = require("./cache/maybe-github.js")
, inflight = require("inflight")
+ , npa = require("npm-package-arg")
+ , getStat = require("./cache/get-stat.js")
cache.usage = "npm cache add "
+ "\nnpm cache add "
@@ -108,9 +115,8 @@ function cache (args, cb) {
switch (cmd) {
case "rm": case "clear": case "clean": return clean(args, cb)
case "list": case "sl": case "ls": return ls(args, cb)
- case "add": return add(args, cb)
- default: return cb(new Error(
- "Invalid cache action: "+cmd))
+ case "add": return add(args, npm.prefix, cb)
+ default: return cb("Usage: "+cache.usage)
}
}
@@ -147,15 +153,30 @@ function read (name, ver, forceBypass, cb) {
})
}
+function normalize (args) {
+ var normalized = ""
+ if (args.length > 0) {
+ var a = npa(args[0])
+ if (a.name) normalized = a.name
+ if (a.rawSpec) normalized = [normalized, a.rawSpec].join("/")
+ if (args.length > 1) normalized = [normalized].concat(args.slice(1)).join("/")
+ }
+
+ if (normalized.substr(-1) === "/") {
+ normalized = normalized.substr(0, normalized.length - 1)
+ }
+ log.silly("ls", "normalized", normalized)
+
+ return normalized
+}
+
// npm cache ls []
function ls (args, cb) {
- args = args.join("/").split("@").join("/")
- if (args.substr(-1) === "/") args = args.substr(0, args.length - 1)
var prefix = npm.config.get("cache")
- if (0 === prefix.indexOf(process.env.HOME)) {
+ if (prefix.indexOf(process.env.HOME) === 0) {
prefix = "~" + prefix.substr(process.env.HOME.length)
}
- ls_(args, npm.config.get("depth"), function (er, files) {
+ ls_(normalize(args), npm.config.get("depth"), function (er, files) {
console.log(files.map(function (f) {
return path.join(prefix, f)
}).join("\n").trim())
@@ -174,9 +195,7 @@ function clean (args, cb) {
if (!args) args = []
- args = args.join("/").split("@").join("/")
- if (args.substr(-1) === "/") args = args.substr(0, args.length - 1)
- var f = path.join(npm.cache, path.normalize(args))
+ var f = path.join(npm.cache, path.normalize(normalize(args)))
if (f === npm.cache) {
fs.readdir(npm.cache, function (er, files) {
if (er) return cb()
@@ -187,30 +206,30 @@ function clean (args, cb) {
})
, rm, cb )
})
- } else rm(path.join(npm.cache, path.normalize(args)), cb)
+ } else rm(path.join(npm.cache, path.normalize(normalize(args))), cb)
}
// npm cache add
// npm cache add
// npm cache add
// npm cache add
-cache.add = function (pkg, ver, scrub, cb) {
+cache.add = function (pkg, ver, where, scrub, cb) {
assert(typeof pkg === "string", "must include name of package to install")
assert(typeof cb === "function", "must include callback")
if (scrub) {
return clean([], function (er) {
if (er) return cb(er)
- add([pkg, ver], cb)
+ add([pkg, ver], where, cb)
})
}
log.verbose("cache add", [pkg, ver])
- return add([pkg, ver], cb)
+ return add([pkg, ver], where, cb)
}
var adding = 0
-function add (args, cb) {
+function add (args, where, cb) {
// this is hot code. almost everything passes through here.
// the args can be any of:
// ["url"]
@@ -226,60 +245,69 @@ function add (args, cb) {
+ " npm cache add @\n"
+ " npm cache add \n"
+ " npm cache add \n"
- , name
, spec
+ , p
if (args[1] === undefined) args[1] = null
// at this point the args length must ==2
if (args[1] !== null) {
- name = args[0]
- spec = args[1]
+ spec = args[0]+"@"+args[1]
} else if (args.length === 2) {
spec = args[0]
}
- log.verbose("cache add", "name=%j spec=%j args=%j", name, spec, args)
+ log.verbose("cache add", "spec=%j args=%j", spec, args)
- if (!name && !spec) return cb(usage)
+ if (!spec) return cb(usage)
if (adding <= 0) {
npm.spinner.start()
}
adding ++
- cb = afterAdd([name, spec], cb)
-
- // see if the spec is a url
- // otherwise, treat as name@version
- var p = url.parse(spec) || {}
- log.verbose("parsed url", p)
-
- // If there's a /, and it's a path, then install the path.
- // If not, and there's a @, it could be that we got name@http://blah
- // in that case, we will not have a protocol now, but if we
- // split and check, we will.
- if (!name && !p.protocol) {
- return maybeFile(spec, cb)
- }
- else {
- switch (p.protocol) {
- case "http:":
- case "https:":
- return addRemoteTarball(spec, { name: name }, null, cb)
+ cb = afterAdd(cb)
+
+ // package.json can have local URI ("file:") dependencies which require
+ // normalization
+ p = npa(spec)
+ if (p.type === "local" && where) spec = path.resolve(where, p.spec)
+ log.verbose("parsed spec", p)
+
+ // short-circuit local installs
+ fs.stat(spec, function (er, s) {
+ if (er) return addNonLocal(spec, cb)
+ if (!s.isDirectory()) return addAndLogLocal(spec, cb)
+ fs.stat(path.join(spec, "package.json"), function (er) {
+ if (er) return addNonLocal(spec, cb)
+ addAndLogLocal(spec, cb)
+ })
+ })
+}
+
+function addAndLogLocal (spec, cb) {
+ log.verbose("cache add", "local package", path.resolve(spec))
+ return addLocal(spec, null, cb)
+}
+function addNonLocal (spec, cb) {
+ var p = npa(spec)
+ log.verbose("parsed spec", p)
+
+ switch (p.type) {
+ case "remote":
+ addRemoteTarball(p.spec, {name : p.name}, null, cb)
+ break
+ case "git":
+ addRemoteGit(p.spec, false, cb)
+ break
+ case "github":
+ maybeGithub(p.spec, cb)
+ break
default:
- if (isGitUrl(p)) return addRemoteGit(spec, p, false, cb)
+ if (p.name) return addNamed(p.name, p.spec, null, cb)
- // if we have a name and a spec, then try name@spec
- if (name) {
- addNamed(name, spec, null, cb)
- }
- // if not, then try just spec (which may try name@"" if not found)
- else {
- addLocal(spec, {}, cb)
- }
+ cb(new Error("couldn't figure out how to install " + spec))
}
- }
}
function unpack (pkg, ver, unpackTarget, dMode, fMode, uid, gid, cb) {
@@ -304,7 +332,7 @@ function unpack (pkg, ver, unpackTarget, dMode, fMode, uid, gid, cb) {
})
}
-function afterAdd (arg, cb) { return function (er, data) {
+function afterAdd (cb) { return function (er, data) {
adding --
if (adding <= 0) {
npm.spinner.stop()
@@ -322,49 +350,32 @@ function afterAdd (arg, cb) { return function (er, data) {
var done = inflight(pj, cb)
- if (!done) return
+ if (!done) return undefined
fs.writeFile(tmp, JSON.stringify(data), "utf8", function (er) {
if (er) return done(er)
- fs.rename(tmp, pj, function (er) {
- done(er, data)
+ getStat(function (er, cs) {
+ if (er) return done(er)
+ fs.rename(tmp, pj, function (er) {
+ if (cs.uid && cs.gid) {
+ fs.chown(pj, cs.uid, cs.gid, function (er) {
+ return done(er, data)
+ })
+ } else {
+ done(er, data)
+ }
+ })
})
})
}}
-function maybeFile (spec, cb) {
- // split name@2.3.4 only if name is a valid package name,
- // don't split in case of "./test@example.com/" (local path)
- fs.stat(spec, function (er) {
- if (!er) {
- // definitely a local thing
- return addLocal(spec, {}, cb)
- }
-
- maybeAt(spec, cb)
- })
-}
-
-function maybeAt (spec, cb) {
- if (spec.indexOf("@") !== -1) {
- var tmp = spec.split("@")
-
- var name = tmp.shift()
- spec = tmp.join("@")
- add([name, spec], cb)
- } else {
- // already know it's not a url, so must be local
- addLocal(spec, {}, cb)
- }
-}
-
-function needName(er, data) {
+function needName (er, data) {
return er ? er
: (data && !data.name) ? new Error("No name provided")
: null
}
-function needVersion(er, data) {
+function needVersion (er, data) {
return er ? er
: (data && !data.version) ? new Error("No version provided")
: null
diff --git a/deps/npm/lib/cache/add-local-tarball.js b/deps/npm/lib/cache/add-local-tarball.js
index bcb938fa97203e19ff59e71136b93bfc7933b7a3..f7cd76103731c85821fc5eb5c5eab8f4e5274bb5 100644
--- a/deps/npm/lib/cache/add-local-tarball.js
+++ b/deps/npm/lib/cache/add-local-tarball.js
@@ -191,7 +191,15 @@ function addTmpTarball_ (tgz, data, shasum, cb) {
var target = path.resolve(root, "package.tgz")
getCacheStat(function (er, cs) {
if (er) return cb(er)
- mkdir(pkg, function (er) {
+ mkdir(pkg, function (er, created) {
+
+ // chown starting from the first dir created by mkdirp,
+ // or the root dir, if none had to be created, so that
+ // we know that we get all the children.
+ function chown (er) {
+ chownr(created || root, cs.uid, cs.gid, done)
+ }
+
if (er) return cb(er)
var read = fs.createReadStream(tgz)
var write = fs.createWriteStream(target)
@@ -199,9 +207,6 @@ function addTmpTarball_ (tgz, data, shasum, cb) {
read.on("error", cb).pipe(write).on("error", cb).on("close", fin)
})
- function chown () {
- chownr(root, cs.uid, cs.gid, done)
- }
})
function done() {
diff --git a/deps/npm/lib/cache/add-local.js b/deps/npm/lib/cache/add-local.js
index 2a6d8cf884f19fa1376af1ad04dff00d0ab2f999..bedf34bac125cb28f8996c6354afe14d7abca7ac 100644
--- a/deps/npm/lib/cache/add-local.js
+++ b/deps/npm/lib/cache/add-local.js
@@ -13,9 +13,7 @@ var fs = require("graceful-fs")
, lock = locker.lock
, unlock = locker.unlock
, getCacheStat = require("./get-stat.js")
- , addNamed = require("./add-named.js")
, addLocalTarball = require("./add-local-tarball.js")
- , maybeGithub = require("./maybe-github.js")
, sha = require("sha")
module.exports = addLocal
@@ -29,16 +27,12 @@ function addLocal (p, pkgData, cb_) {
function cb (er, data) {
unlock(p, function () {
if (er) {
- // if it doesn't have a / in it, it might be a
- // remote thing.
- if (p.indexOf("/") === -1 && p.charAt(0) !== "."
- && (process.platform !== "win32" || p.indexOf("\\") === -1)) {
- return addNamed(p, "", null, cb_)
- }
log.error("addLocal", "Could not install %s", p)
return cb_(er)
}
- if (data && !data._fromGithub) data._from = p
+ if (data && !data._fromGithub) {
+ data._from = path.relative(npm.prefix, p) || "."
+ }
return cb_(er, data)
})
}
@@ -47,14 +41,8 @@ function addLocal (p, pkgData, cb_) {
if (er) return cb(er)
// figure out if this is a folder or file.
fs.stat(p, function (er, s) {
- if (er) {
- // might be username/project
- // in that case, try it as a github url.
- if (p.split("/").length === 2) {
- return maybeGithub(p, er, cb)
- }
- return cb(er)
- }
+ if (er) return cb(er)
+
if (s.isDirectory()) addLocalDirectory(p, pkgData, null, cb)
else addLocalTarball(p, pkgData, null, cb)
})
diff --git a/deps/npm/lib/cache/add-named.js b/deps/npm/lib/cache/add-named.js
index 7137cc9b569c8ae09407f8ea043fb98cceee92e6..091d43c016fee24ef2bd5b6e02761dcabf195fda 100644
--- a/deps/npm/lib/cache/add-named.js
+++ b/deps/npm/lib/cache/add-named.js
@@ -13,8 +13,8 @@ var path = require("path")
, locker = require("../utils/locker.js")
, lock = locker.lock
, unlock = locker.unlock
- , maybeGithub = require("./maybe-github.js")
, addRemoteTarball = require("./add-remote-tarball.js")
+ , mapToRegistry = require("../utils/map-to-registry.js")
module.exports = addNamed
@@ -48,7 +48,7 @@ function addNamed (name, version, data, cb_) {
})
}
-function addNameTag (name, tag, data, cb_) {
+function addNameTag (name, tag, data, cb) {
log.info("addNameTag", [name, tag])
var explicit = true
if (!tag) {
@@ -56,17 +56,13 @@ function addNameTag (name, tag, data, cb_) {
tag = npm.config.get("tag")
}
- function cb(er, data) {
- // might be username/project
- // in that case, try it as a github url.
- if (er && tag.split("/").length === 2) {
- return maybeGithub(tag, er, cb_)
- }
- return cb_(er, data)
- }
+ mapToRegistry(name, npm.config, function (er, uri) {
+ if (er) return cb(er)
- var uri = url.resolve(npm.config.get("registry"), name)
- registry.get(uri, null, function (er, data, json, resp) {
+ registry.get(uri, null, next)
+ })
+
+ function next (er, data, json, resp) {
if (!er) {
er = errorResponse(name, resp)
}
@@ -83,7 +79,7 @@ function addNameTag (name, tag, data, cb_) {
er = installTargetsError(tag, data)
return cb(er)
- })
+ }
}
function engineFilter (data) {
@@ -114,22 +110,28 @@ function addNameVersion (name, v, data, cb) {
response = null
return next()
}
- var uri = url.resolve(npm.config.get("registry"), name)
- registry.get(uri, null, function (er, d, json, resp) {
+
+ mapToRegistry(name, npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.get(uri, null, setData)
+ })
+
+ function setData (er, d, json, resp) {
if (!er) {
er = errorResponse(name, resp)
}
if (er) return cb(er)
data = d && d.versions[ver]
if (!data) {
- er = new Error('version not found: ' + name + '@' + ver)
+ er = new Error("version not found: "+name+"@"+ver)
er.package = name
er.statusCode = 404
return cb(er)
}
response = resp
next()
- })
+ }
function next () {
deprCheck(data)
@@ -166,10 +168,9 @@ function addNameVersion (name, v, data, cb) {
return cb(new Error("Cannot fetch: "+dist.tarball))
}
- // use the same protocol as the registry.
- // https registry --> https tarballs, but
- // only if they're the same hostname, or else
- // detached tarballs may not work.
+ // Use the same protocol as the registry. https registry --> https
+ // tarballs, but only if they're the same hostname, or else detached
+ // tarballs may not work.
var tb = url.parse(dist.tarball)
var rp = url.parse(npm.config.get("registry"))
if (tb.hostname === rp.hostname
@@ -179,8 +180,8 @@ function addNameVersion (name, v, data, cb) {
}
tb = url.format(tb)
- // only add non-shasum'ed packages if --forced.
- // only ancient things would lack this for good reasons nowadays.
+ // Only add non-shasum'ed packages if --forced. Only ancient things
+ // would lack this for good reasons nowadays.
if (!dist.shasum && !npm.config.get("force")) {
return cb(new Error("package lacks shasum: " + data._id))
}
@@ -197,15 +198,21 @@ function addNameRange (name, range, data, cb) {
log.silly("addNameRange", {name:name, range:range, hasData:!!data})
if (data) return next()
- var uri = url.resolve(npm.config.get("registry"), name)
- registry.get(uri, null, function (er, d, json, resp) {
+
+ mapToRegistry(name, npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.get(uri, null, setData)
+ })
+
+ function setData (er, d, json, resp) {
if (!er) {
er = errorResponse(name, resp)
}
if (er) return cb(er)
data = d
next()
- })
+ }
function next () {
log.silly( "addNameRange", "number 2"
diff --git a/deps/npm/lib/cache/add-remote-git.js b/deps/npm/lib/cache/add-remote-git.js
index 7743aa4a450ad89954f44d2ee28b10b0dfc71c2c..304d2f3f0e967a538ed8acf6126c6ef7b906db00 100644
--- a/deps/npm/lib/cache/add-remote-git.js
+++ b/deps/npm/lib/cache/add-remote-git.js
@@ -8,9 +8,7 @@ var mkdir = require("mkdirp")
, url = require("url")
, chownr = require("chownr")
, zlib = require("zlib")
- , which = require("which")
, crypto = require("crypto")
- , chmodr = require("chmodr")
, npm = require("../npm.js")
, rm = require("../utils/gently-rm.js")
, inflight = require("inflight")
@@ -28,9 +26,8 @@ var mkdir = require("mkdirp")
// 5. git archive /tmp/random.tgz
// 6. addLocalTarball(/tmp/random.tgz) --format=tar --prefix=package/
// silent flag is used if this should error quietly
-module.exports = function addRemoteGit (u, parsed, silent, cb_) {
+module.exports = function addRemoteGit (u, silent, cb_) {
assert(typeof u === "string", "must have git URL")
- assert(typeof parsed === "object", "must have parsed query")
assert(typeof cb_ === "function", "must have callback")
function cb (er, data) {
@@ -41,6 +38,10 @@ module.exports = function addRemoteGit (u, parsed, silent, cb_) {
if (!cb_) return
+ log.verbose("addRemoteGit", "u=%j silent=%j", u, silent)
+ var parsed = url.parse(u, true)
+ log.silly("addRemoteGit", "parsed", parsed)
+
// git is so tricky!
// if the path is like ssh://foo:22/some/path then it works, but
// it needs the ssh://
@@ -62,16 +63,16 @@ module.exports = function addRemoteGit (u, parsed, silent, cb_) {
var co = parsed.hash && parsed.hash.substr(1) || "master"
var v = crypto.createHash("sha1").update(u).digest("hex").slice(0, 8)
- v = u.replace(/[^a-zA-Z0-9]+/g, '-') + '-' + v
+ v = u.replace(/[^a-zA-Z0-9]+/g, "-")+"-"+v
log.verbose("addRemoteGit", [u, co])
var p = path.join(npm.config.get("cache"), "_git-remotes", v)
checkGitDir(p, u, co, origUrl, silent, function(er, data) {
- chmodr(p, npm.modes.file, function(erChmod) {
+ addModeRecursive(p, npm.modes.file, function(erAddMode) {
if (er) return cb(er, data)
- return cb(erChmod, data)
+ return cb(erAddMode, data)
})
})
})
@@ -181,16 +182,20 @@ function archiveGitRemote (p, u, co, origUrl, cb) {
parsed.hash = stdout
resolved = url.format(parsed)
+ if (parsed.protocol !== "git:") {
+ resolved = "git+" + resolved
+ }
+
// https://github.com/npm/npm/issues/3224
// node incorrectly sticks a / at the start of the path
// We know that the host won't change, so split and detect this
var spo = origUrl.split(parsed.host)
var spr = resolved.split(parsed.host)
- if (spo[1].charAt(0) === ':' && spr[1].charAt(0) === '/')
+ if (spo[1].charAt(0) === ":" && spr[1].charAt(0) === "/")
spr[1] = spr[1].slice(1)
resolved = spr.join(parsed.host)
- log.verbose('resolved git url', resolved)
+ log.verbose("resolved git url", resolved)
next()
})
}
@@ -226,8 +231,48 @@ function gitEnv () {
if (gitEnv_) return gitEnv_
gitEnv_ = {}
for (var k in process.env) {
- if (!~['GIT_PROXY_COMMAND','GIT_SSH','GIT_SSL_NO_VERIFY'].indexOf(k) && k.match(/^GIT/)) continue
+ if (!~["GIT_PROXY_COMMAND","GIT_SSH","GIT_SSL_NO_VERIFY"].indexOf(k) && k.match(/^GIT/)) continue
gitEnv_[k] = process.env[k]
}
return gitEnv_
}
+
+// similar to chmodr except it add permissions rather than overwriting them
+// adapted from https://github.com/isaacs/chmodr/blob/master/chmodr.js
+function addModeRecursive(p, mode, cb) {
+ fs.readdir(p, function (er, children) {
+ // Any error other than ENOTDIR means it's not readable, or doesn't exist.
+ // Give up.
+ if (er && er.code !== "ENOTDIR") return cb(er)
+ if (er || !children.length) return addMode(p, mode, cb)
+
+ var len = children.length
+ var errState = null
+ children.forEach(function (child) {
+ addModeRecursive(path.resolve(p, child), mode, then)
+ })
+
+ function then (er) {
+ if (errState) return undefined
+ if (er) return cb(errState = er)
+ if (--len === 0) return addMode(p, dirMode(mode), cb)
+ }
+ })
+}
+
+function addMode(p, mode, cb) {
+ fs.stat(p, function (er, stats) {
+ if (er) return cb(er)
+ mode = stats.mode | mode
+ fs.chmod(p, mode, cb)
+ })
+}
+
+// taken from https://github.com/isaacs/chmodr/blob/master/chmodr.js
+function dirMode(mode) {
+ if (mode & parseInt("0400", 8)) mode |= parseInt("0100", 8)
+ if (mode & parseInt( "040", 8)) mode |= parseInt( "010", 8)
+ if (mode & parseInt( "04", 8)) mode |= parseInt( "01", 8)
+ return mode
+}
+
diff --git a/deps/npm/lib/cache/add-remote-tarball.js b/deps/npm/lib/cache/add-remote-tarball.js
index db9a05d82540c06ed44a17fe787eb874644fbdc7..2c7d013039d172608703a6e3e469da70d558575d 100644
--- a/deps/npm/lib/cache/add-remote-tarball.js
+++ b/deps/npm/lib/cache/add-remote-tarball.js
@@ -4,8 +4,9 @@ var mkdir = require("mkdirp")
, path = require("path")
, sha = require("sha")
, retry = require("retry")
+ , createWriteStream = require("graceful-fs").createWriteStream
, npm = require("../npm.js")
- , fetch = require("../utils/fetch.js")
+ , registry = npm.registry
, inflight = require("inflight")
, locker = require("../utils/locker.js")
, lock = locker.lock
@@ -80,27 +81,39 @@ function addRemoteTarball_(u, tmp, shasum, cb) {
}
function fetchAndShaCheck (u, tmp, shasum, cb) {
- fetch(u, tmp, function (er, response) {
+ registry.fetch(u, null, function (er, response) {
if (er) {
log.error("fetch failed", u)
return cb(er, response)
}
- if (!shasum) {
- // Well, we weren't given a shasum, so at least sha what we have
- // in case we want to compare it to something else later
- return sha.get(tmp, function (er, shasum) {
- cb(er, response, shasum)
- })
- }
+ var tarball = createWriteStream(tmp, { mode : npm.modes.file })
+ tarball.on("error", function (er) {
+ cb(er)
+ tarball.destroy()
+ })
- // validate that the url we just downloaded matches the expected shasum.
- sha.check(tmp, shasum, function (er) {
- if (er && er.message) {
- // add original filename for better debuggability
- er.message = er.message + '\n' + 'From: ' + u
+ tarball.on("finish", function () {
+ if (!shasum) {
+ // Well, we weren't given a shasum, so at least sha what we have
+ // in case we want to compare it to something else later
+ return sha.get(tmp, function (er, shasum) {
+ log.silly("fetchAndShaCheck", "shasum", shasum)
+ cb(er, response, shasum)
+ })
}
- return cb(er, response, shasum)
+
+ // validate that the url we just downloaded matches the expected shasum.
+ log.silly("fetchAndShaCheck", "shasum", shasum)
+ sha.check(tmp, shasum, function (er) {
+ if (er && er.message) {
+ // add original filename for better debuggability
+ er.message = er.message + "\n" + "From: " + u
+ }
+ return cb(er, response, shasum)
+ })
})
+
+ response.pipe(tarball)
})
}
diff --git a/deps/npm/lib/cache/get-stat.js b/deps/npm/lib/cache/get-stat.js
index 913f5af851fc60af2a806b5daec262dee09dd5a7..372a86d61fc4fbf0a65d995ce72f47ed4881852e 100644
--- a/deps/npm/lib/cache/get-stat.js
+++ b/deps/npm/lib/cache/get-stat.js
@@ -24,7 +24,9 @@ module.exports = function getCacheStat (cb) {
}
function makeCacheDir (cb) {
- if (!process.getuid) return mkdir(npm.cache, cb)
+ if (!process.getuid) return mkdir(npm.cache, function (er) {
+ return cb(er, {})
+ })
var uid = +process.getuid()
, gid = +process.getgid()
diff --git a/deps/npm/lib/cache/maybe-github.js b/deps/npm/lib/cache/maybe-github.js
index fee64c5dfdf3f2712467d33cb88439223d935bc1..5ecdb691552c5814b4ce62e53ce4f4af79259352 100644
--- a/deps/npm/lib/cache/maybe-github.js
+++ b/deps/npm/lib/cache/maybe-github.js
@@ -1,29 +1,26 @@
-var url = require("url")
- , assert = require("assert")
+var assert = require("assert")
, log = require("npmlog")
, addRemoteGit = require("./add-remote-git.js")
-module.exports = function maybeGithub (p, er, cb) {
+module.exports = function maybeGithub (p, cb) {
assert(typeof p === "string", "must pass package name")
- assert(er instanceof Error, "must include error")
assert(typeof cb === "function", "must pass callback")
var u = "git://github.com/" + p
- , up = url.parse(u)
log.info("maybeGithub", "Attempting %s from %s", p, u)
- return addRemoteGit(u, up, true, function (er2, data) {
- if (er2) {
+ return addRemoteGit(u, true, function (er, data) {
+ if (er) {
var upriv = "git+ssh://git@github.com:" + p
- , uppriv = url.parse(upriv)
-
log.info("maybeGithub", "Attempting %s from %s", p, upriv)
- return addRemoteGit(upriv, uppriv, false, function (er3, data) {
- if (er3) return cb(er)
+ return addRemoteGit(upriv, false, function (er, data) {
+ if (er) return cb(er)
+
success(upriv, data)
})
}
+
success(u, data)
})
diff --git a/deps/npm/lib/dedupe.js b/deps/npm/lib/dedupe.js
index e6762e15bc512e617a6e68ce2d74991640d303d5..74397d0cb957922695f3704b430020e4b6de9f98 100644
--- a/deps/npm/lib/dedupe.js
+++ b/deps/npm/lib/dedupe.js
@@ -7,7 +7,6 @@
// much better "put pkg X at folder Y" abstraction. Oh well,
// whatever. Perfect enemy of the good, and all that.
-var url = require("url")
var fs = require("fs")
var asyncMap = require("slide").asyncMap
var path = require("path")
@@ -16,6 +15,7 @@ var semver = require("semver")
var rm = require("./utils/gently-rm.js")
var log = require("npmlog")
var npm = require("./npm.js")
+var mapToRegistry = require("./utils/map-to-registry.js")
module.exports = dedupe
@@ -61,7 +61,7 @@ function dedupe_ (dir, filter, unavoidable, dryrun, silent, cb) {
Object.keys(obj.children).forEach(function (k) {
U(obj.children[k])
})
- })
+ })(data)
// then collect them up and figure out who needs them
;(function C (obj) {
@@ -240,13 +240,19 @@ function findVersions (npm, summary, cb) {
var versions = data.versions
var ranges = data.ranges
- var uri = url.resolve(npm.config.get("registry"), name)
- npm.registry.get(uri, null, function (er, data) {
+ mapToRegistry(name, npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ npm.registry.get(uri, null, next)
+ })
+
+ function next (er, data) {
var regVersions = er ? [] : Object.keys(data.versions)
var locMatch = bestMatch(versions, ranges)
- var regMatch;
var tag = npm.config.get("tag")
var distTag = data["dist-tags"] && data["dist-tags"][tag]
+
+ var regMatch
if (distTag && data.versions[distTag] && matches(distTag, ranges)) {
regMatch = distTag
} else {
@@ -254,7 +260,7 @@ function findVersions (npm, summary, cb) {
}
cb(null, [[name, has, loc, locMatch, regMatch, locs]])
- })
+ }
}, cb)
}
diff --git a/deps/npm/lib/deprecate.js b/deps/npm/lib/deprecate.js
index 175b69ceb13d68bcacba7f96ff319c120572a862..17dd4eab0c132634c4d3e0db7c20f568a1cc615e 100644
--- a/deps/npm/lib/deprecate.js
+++ b/deps/npm/lib/deprecate.js
@@ -1,5 +1,6 @@
-var url = require("url")
- , npm = require("./npm.js")
+var npm = require("./npm.js")
+ , mapToRegistry = require("./utils/map-to-registry.js")
+ , npa = require("npm-package-arg")
module.exports = deprecate
@@ -8,16 +9,20 @@ deprecate.usage = "npm deprecate [@] "
deprecate.completion = function (opts, cb) {
// first, get a list of remote packages this user owns.
// once we have a user account, then don't complete anything.
- var un = npm.config.get("username")
- if (!npm.config.get("username")) return cb()
if (opts.conf.argv.remain.length > 2) return cb()
// get the list of packages by user
- var path = "/-/by-user/"+encodeURIComponent(un)
- , uri = url.resolve(npm.config.get("registry"), path)
- npm.registry.get(uri, { timeout : 60000 }, function (er, list) {
- if (er) return cb()
- console.error(list)
- return cb(null, list[un])
+ var path = "/-/by-user/"
+ mapToRegistry(path, npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ var c = npm.config.getCredentialsByURI(uri)
+ if (!(c && c.username)) return cb()
+
+ npm.registry.get(uri + c.username, { timeout : 60000 }, function (er, list) {
+ if (er) return cb()
+ console.error(list)
+ return cb(null, list[c.username])
+ })
})
}
@@ -25,11 +30,15 @@ function deprecate (args, cb) {
var pkg = args[0]
, msg = args[1]
if (msg === undefined) return cb("Usage: " + deprecate.usage)
+
// fetch the data and make sure it exists.
- pkg = pkg.split(/@/)
- var name = pkg.shift()
- , ver = pkg.join("@")
- , uri = url.resolve(npm.config.get("registry"), name)
+ var p = npa(pkg)
+
+ mapToRegistry(p.name, npm.config, next)
+
+ function next (er, uri) {
+ if (er) return cb(er)
- npm.registry.deprecate(uri, ver, msg, cb)
+ npm.registry.deprecate(uri, p.spec, msg, cb)
+ }
}
diff --git a/deps/npm/lib/docs.js b/deps/npm/lib/docs.js
index 77073fbb9c131583b00a09c2556e1b809cabb8da..dead3f7551c2fdf862efa03a608ebd0916943cfa 100644
--- a/deps/npm/lib/docs.js
+++ b/deps/npm/lib/docs.js
@@ -5,18 +5,21 @@ docs.usage += "\n"
docs.usage += "npm docs ."
docs.completion = function (opts, cb) {
- var uri = url_.resolve(npm.config.get("registry"), "/-/short")
- registry.get(uri, { timeout : 60000 }, function (er, list) {
- return cb(null, list || [])
+ mapToRegistry("/-/short", npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.get(uri, { timeout : 60000 }, function (er, list) {
+ return cb(null, list || [])
+ })
})
}
-var url_ = require("url")
- , npm = require("./npm.js")
+var npm = require("./npm.js")
, registry = npm.registry
, opener = require("opener")
, path = require("path")
, log = require("npmlog")
+ , mapToRegistry = require("./utils/map-to-registry.js")
function url (json) {
return json.homepage ? json.homepage : "https://npmjs.org/package/" + json.name
@@ -38,7 +41,7 @@ function docs (args, cb) {
function getDoc (project, cb) {
project = project || '.'
- var package = path.resolve(process.cwd(), "package.json")
+ var package = path.resolve(npm.localPrefix, "package.json")
if (project === '.' || project === './') {
var json
@@ -54,8 +57,13 @@ function getDoc (project, cb) {
return opener(url(json), { command: npm.config.get("browser") }, cb)
}
- var uri = url_.resolve(npm.config.get("registry"), project + "/latest")
- registry.get(uri, { timeout : 3600 }, function (er, json) {
+ mapToRegistry(project, npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.get(uri + "/latest", { timeout : 3600 }, next)
+ })
+
+ function next (er, json) {
var github = "https://github.com/" + project + "#readme"
if (er) {
@@ -64,5 +72,5 @@ function getDoc (project, cb) {
}
return opener(url(json), { command: npm.config.get("browser") }, cb)
- })
+ }
}
diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js
index 9d2c2cfa27905d5a4a87e8a82e158314f37e6590..82d872525a70a526ae0285dfaa9b1bd04575571e 100644
--- a/deps/npm/lib/install.js
+++ b/deps/npm/lib/install.js
@@ -34,28 +34,34 @@ install.completion = function (opts, cb) {
// if it starts with https?://, then just give up, because it's a url
// for now, not yet implemented.
var registry = npm.registry
- , uri = url.resolve(npm.config.get("registry"), "-/short")
- registry.get(uri, null, function (er, pkgs) {
- if (er) return cb()
- if (!opts.partialWord) return cb(null, pkgs)
+ mapToRegistry("-/short", npm.config, function (er, uri) {
+ if (er) return cb(er)
- var name = opts.partialWord.split("@").shift()
- pkgs = pkgs.filter(function (p) {
- return p.indexOf(name) === 0
- })
+ registry.get(uri, null, function (er, pkgs) {
+ if (er) return cb()
+ if (!opts.partialWord) return cb(null, pkgs)
- if (pkgs.length !== 1 && opts.partialWord === name) {
- return cb(null, pkgs)
- }
+ var name = npa(opts.partialWord).name
+ pkgs = pkgs.filter(function (p) {
+ return p.indexOf(name) === 0
+ })
- uri = url.resolve(npm.config.get("registry"), pkgs[0])
- registry.get(uri, null, function (er, d) {
- if (er) return cb()
- return cb(null, Object.keys(d["dist-tags"] || {})
- .concat(Object.keys(d.versions || {}))
- .map(function (t) {
- return pkgs[0] + "@" + t
- }))
+ if (pkgs.length !== 1 && opts.partialWord === name) {
+ return cb(null, pkgs)
+ }
+
+ mapToRegistry(pkgs[0], npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.get(uri, null, function (er, d) {
+ if (er) return cb()
+ return cb(null, Object.keys(d["dist-tags"] || {})
+ .concat(Object.keys(d.versions || {}))
+ .map(function (t) {
+ return pkgs[0] + "@" + t
+ }))
+ })
+ })
})
})
}
@@ -74,9 +80,10 @@ var npm = require("./npm.js")
, mkdir = require("mkdirp")
, lifecycle = require("./utils/lifecycle.js")
, archy = require("archy")
- , isGitUrl = require("./utils/is-git-url.js")
, npmInstallChecks = require("npm-install-checks")
, sortedObject = require("sorted-object")
+ , mapToRegistry = require("./utils/map-to-registry.js")
+ , npa = require("npm-package-arg")
function install (args, cb_) {
var hasArguments = !!args.length
@@ -112,7 +119,7 @@ function install (args, cb_) {
where = args
args = [].concat(cb_) // pass in [] to do default dep-install
cb_ = arguments[2]
- log.verbose("install", "where,what", [where, args])
+ log.verbose("install", "where, what", [where, args])
}
if (!npm.config.get("global")) {
@@ -206,7 +213,7 @@ function findPeerInvalid_ (packageMap, fpiList) {
var pkg = packageMap[packageName]
if (pkg.peerInvalid) {
- var peersDepending = {};
+ var peersDepending = {}
for (var peerName in packageMap) {
var peer = packageMap[peerName]
if (peer.peerDependencies && peer.peerDependencies[packageName]) {
@@ -338,21 +345,33 @@ function save (where, installed, tree, pretty, hasArguments, cb) {
return cb(null, installed, tree, pretty)
}
- var saveBundle = npm.config.get('save-bundle')
- var savePrefix = npm.config.get('save-prefix') || "^";
+ var saveBundle = npm.config.get("save-bundle")
+ var savePrefix = npm.config.get("save-prefix") || "^"
// each item in the tree is a top-level thing that should be saved
// to the package.json file.
// The relevant tree shape is { : {what:} }
var saveTarget = path.resolve(where, "package.json")
- , things = Object.keys(tree).map(function (k) {
- // if "what" was a url, then save that instead.
- var t = tree[k]
- , u = url.parse(t.from)
- , w = t.what.split("@")
- if (u && u.protocol) w[1] = t.from
- return w
- }).reduce(function (set, k) {
+
+ asyncMap(Object.keys(tree), function (k, cb) {
+ // if "what" was a url, then save that instead.
+ var t = tree[k]
+ , u = url.parse(t.from)
+ , a = npa(t.what)
+ , w = [a.name, a.spec]
+
+
+ fs.stat(t.from, function (er){
+ if (!er) {
+ w[1] = "file:" + t.from
+ } else if (u && u.protocol) {
+ w[1] = t.from
+ }
+ cb(null, [w])
+ })
+ }
+ , function (er, arr) {
+ var things = arr.reduce(function (set, k) {
var rangeDescriptor = semver.valid(k[1], true) &&
semver.gte(k[1], "0.1.0", true) &&
!npm.config.get("save-exact")
@@ -361,47 +380,49 @@ function save (where, installed, tree, pretty, hasArguments, cb) {
return set
}, {})
- // don't use readJson, because we don't want to do all the other
- // tricky npm-specific stuff that's in there.
- fs.readFile(saveTarget, function (er, data) {
- // ignore errors here, just don't save it.
- try {
- data = JSON.parse(data.toString("utf8"))
- } catch (ex) {
- er = ex
- }
- if (er) {
- return cb(null, installed, tree, pretty)
- }
+ // don't use readJson, because we don't want to do all the other
+ // tricky npm-specific stuff that's in there.
+ fs.readFile(saveTarget, function (er, data) {
+ // ignore errors here, just don't save it.
+ try {
+ data = JSON.parse(data.toString("utf8"))
+ } catch (ex) {
+ er = ex
+ }
- var deps = npm.config.get("save-optional") ? "optionalDependencies"
- : npm.config.get("save-dev") ? "devDependencies"
- : "dependencies"
+ if (er) {
+ return cb(null, installed, tree, pretty)
+ }
- if (saveBundle) {
- var bundle = data.bundleDependencies || data.bundledDependencies
- delete data.bundledDependencies
- if (!Array.isArray(bundle)) bundle = []
- data.bundleDependencies = bundle.sort()
- }
+ var deps = npm.config.get("save-optional") ? "optionalDependencies"
+ : npm.config.get("save-dev") ? "devDependencies"
+ : "dependencies"
- log.verbose('saving', things)
- data[deps] = data[deps] || {}
- Object.keys(things).forEach(function (t) {
- data[deps][t] = things[t]
if (saveBundle) {
- var i = bundle.indexOf(t)
- if (i === -1) bundle.push(t)
+ var bundle = data.bundleDependencies || data.bundledDependencies
+ delete data.bundledDependencies
+ if (!Array.isArray(bundle)) bundle = []
data.bundleDependencies = bundle.sort()
}
- })
- data[deps] = sortedObject(data[deps])
+ log.verbose("saving", things)
+ data[deps] = data[deps] || {}
+ Object.keys(things).forEach(function (t) {
+ data[deps][t] = things[t]
+ if (saveBundle) {
+ var i = bundle.indexOf(t)
+ if (i === -1) bundle.push(t)
+ data.bundleDependencies = bundle.sort()
+ }
+ })
- data = JSON.stringify(data, null, 2) + "\n"
- fs.writeFile(saveTarget, data, function (er) {
- cb(er, installed, tree, pretty)
+ data[deps] = sortedObject(data[deps])
+
+ data = JSON.stringify(data, null, 2) + "\n"
+ fs.writeFile(saveTarget, data, function (er) {
+ cb(er, installed, tree, pretty)
+ })
})
})
}
@@ -412,22 +433,22 @@ function save (where, installed, tree, pretty, hasArguments, cb) {
// that the submodules are not immediately require()able.
// TODO: Show the complete tree, ls-style, but only if --long is provided
function prettify (tree, installed) {
- if (npm.config.get("json")) {
- function red (set, kv) {
- set[kv[0]] = kv[1]
- return set
- }
+ function red (set, kv) {
+ set[kv[0]] = kv[1]
+ return set
+ }
+ if (npm.config.get("json")) {
tree = Object.keys(tree).map(function (p) {
if (!tree[p]) return null
- var what = tree[p].what.split("@")
- , name = what.shift()
- , version = what.join("@")
+ var what = npa(tree[p].what)
+ , name = what.name
+ , version = what.spec
, o = { name: name, version: version, from: tree[p].from }
o.dependencies = tree[p].children.map(function P (dep) {
- var what = dep.what.split("@")
- , name = what.shift()
- , version = what.join("@")
+ var what = npa(dep.what)
+ , name = what.name
+ , version = what.spec
, o = { version: version, from: dep.from }
o.dependencies = dep.children.map(P).reduce(red, {})
return [name, o]
@@ -615,60 +636,70 @@ function installMany (what, where, context, cb) {
}
function targetResolver (where, context, deps) {
- var alreadyInstalledManually = context.explicit ? [] : null
+ var alreadyInstalledManually = []
+ , resolveLeft = 0
, nm = path.resolve(where, "node_modules")
, parent = context.parent
, wrap = context.wrap
- if (!context.explicit) fs.readdir(nm, function (er, inst) {
- if (er) return alreadyInstalledManually = []
+ if (!context.explicit) readdir(nm)
- // don't even mess with non-package looking things
- inst = inst.filter(function (p) {
- return !p.match(/^[\._-]/)
- })
+ function readdir(name) {
+ resolveLeft++
+ fs.readdir(name, function (er, inst) {
+ if (er) return resolveLeft--
- asyncMap(inst, function (pkg, cb) {
- readJson(path.resolve(nm, pkg, "package.json"), log.warn, function (er, d) {
- if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
- // error means it's not a package, most likely.
- if (er) return cb(null, [])
-
- // if it's a bundled dep, then assume that anything there is valid.
- // otherwise, make sure that it's a semver match with what we want.
- var bd = parent.bundleDependencies
- if (bd && bd.indexOf(d.name) !== -1 ||
- semver.satisfies(d.version, deps[d.name] || "*", true) ||
- deps[d.name] === d._resolved) {
- return cb(null, d.name)
- }
+ // don't even mess with non-package looking things
+ inst = inst.filter(function (p) {
+ if (!p.match(/^[@\._-]/)) return true
+ // scope pacakges
+ var scopepath = path.join(name, p)
+ readdir(scopepath)
+ })
- // see if the package had been previously linked
- fs.lstat(path.resolve(nm, pkg), function(err, s) {
- if (err) return cb(null, [])
- if (s.isSymbolicLink()) {
+ asyncMap(inst, function (pkg, cb) {
+ readJson(path.resolve(name, pkg, "package.json"), log.warn, function (er, d) {
+ if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
+ // error means it's not a package, most likely.
+ if (er) return cb(null, [])
+
+ // if it's a bundled dep, then assume that anything there is valid.
+ // otherwise, make sure that it's a semver match with what we want.
+ var bd = parent.bundleDependencies
+ if (bd && bd.indexOf(d.name) !== -1 ||
+ semver.satisfies(d.version, deps[d.name] || "*", true) ||
+ deps[d.name] === d._resolved) {
return cb(null, d.name)
}
- // something is there, but it's not satisfactory. Clobber it.
- return cb(null, [])
+ // see if the package had been previously linked
+ fs.lstat(path.resolve(nm, pkg), function(err, s) {
+ if (err) return cb(null, [])
+ if (s.isSymbolicLink()) {
+ return cb(null, d.name)
+ }
+
+ // something is there, but it's not satisfactory. Clobber it.
+ return cb(null, [])
+ })
})
+ }, function (er, inst) {
+ // this is the list of things that are valid and should be ignored.
+ alreadyInstalledManually = alreadyInstalledManually.concat(inst)
+ resolveLeft--
})
- }, function (er, inst) {
- // this is the list of things that are valid and should be ignored.
- alreadyInstalledManually = inst
})
- })
+ }
var to = 0
return function resolver (what, cb) {
- if (!alreadyInstalledManually) return setTimeout(function () {
+ if (resolveLeft) return setTimeout(function () {
resolver(what, cb)
}, to++)
// now we know what's been installed here manually,
// or tampered with in some way that npm doesn't want to overwrite.
- if (alreadyInstalledManually.indexOf(what.split("@").shift()) !== -1) {
+ if (alreadyInstalledManually.indexOf(npa(what).name) !== -1) {
log.verbose("already installed", "skipping %s %s", what, where)
return cb(null, [])
}
@@ -692,7 +723,7 @@ function targetResolver (where, context, deps) {
}
if (wrap) {
- var name = what.split(/@/).shift()
+ var name = npa(what).name
if (wrap[name]) {
var wrapTarget = readWrap(wrap[name])
what = name + "@" + wrapTarget
@@ -709,19 +740,16 @@ function targetResolver (where, context, deps) {
// already has a matching copy.
// If it's not a git repo, and the parent already has that pkg, then
// we can skip installing it again.
- cache.add(what, null, false, function (er, data) {
+ var pkgroot = path.resolve(npm.prefix, (parent && parent._from) || "")
+ cache.add(what, null, pkgroot, false, function (er, data) {
if (er && parent && parent.optionalDependencies &&
- parent.optionalDependencies.hasOwnProperty(what.split("@")[0])) {
+ parent.optionalDependencies.hasOwnProperty(npa(what).name)) {
log.warn("optional dep failed, continuing", what)
log.verbose("optional dep failed, continuing", [what, er])
return cb(null, [])
}
- var isGit = false
- , maybeGit = what.split("@").slice(1).join()
-
- if (maybeGit)
- isGit = isGitUrl(url.parse(maybeGit))
+ var isGit = npa(what).type === "git"
if (!er &&
data &&
@@ -733,6 +761,7 @@ function targetResolver (where, context, deps) {
return cb(null, [])
}
+
if (data && !data._from) data._from = what
if (er && parent && parent.name) er.parent = parent.name
return cb(er, data || [])
@@ -771,6 +800,13 @@ function localLink (target, where, context, cb) {
, parent = context.parent
readJson(jsonFile, log.warn, function (er, data) {
+ function thenLink () {
+ npm.commands.link([target.name], function (er, d) {
+ log.silly("localLink", "back from link", [er, d])
+ cb(er, [resultList(target, where, parent && parent._id)])
+ })
+ }
+
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
if (er || data._id === target._id) {
if (er) {
@@ -781,14 +817,6 @@ function localLink (target, where, context, cb) {
thenLink()
})
} else thenLink()
-
- function thenLink () {
- npm.commands.link([target.name], function (er, d) {
- log.silly("localLink", "back from link", [er, d])
- cb(er, [resultList(target, where, parent && parent._id)])
- })
- }
-
} else {
log.verbose("localLink", "install locally (no link)", target._id)
installOne_(target, where, context, cb)
diff --git a/deps/npm/lib/link.js b/deps/npm/lib/link.js
index 8022fc78dfe56f6c8e07477e55e6968d45fc160c..8c6a9302905c74a703c0a2a6eb82eec87b8bd361 100644
--- a/deps/npm/lib/link.js
+++ b/deps/npm/lib/link.js
@@ -10,6 +10,7 @@ var npm = require("./npm.js")
, path = require("path")
, rm = require("./utils/gently-rm.js")
, build = require("./build.js")
+ , npa = require("npm-package-arg")
module.exports = link
@@ -49,25 +50,26 @@ function link (args, cb) {
function linkInstall (pkgs, cb) {
asyncMap(pkgs, function (pkg, cb) {
+ var t = path.resolve(npm.globalDir, "..")
+ , pp = path.resolve(npm.globalDir, pkg)
+ , rp = null
+ , target = path.resolve(npm.dir, pkg)
+
function n (er, data) {
if (er) return cb(er, data)
// install returns [ [folder, pkgId], ... ]
// but we definitely installed just one thing.
var d = data.filter(function (d) { return !d[3] })
+ var what = npa(d[0][0])
pp = d[0][1]
- pkg = path.basename(pp)
+ pkg = what.name
target = path.resolve(npm.dir, pkg)
next()
}
- var t = path.resolve(npm.globalDir, "..")
- , pp = path.resolve(npm.globalDir, pkg)
- , rp = null
- , target = path.resolve(npm.dir, pkg)
-
- // if it's a folder or a random not-installed thing, then
- // link or install it first
- if (pkg.indexOf("/") !== -1 || pkg.indexOf("\\") !== -1) {
+ // if it's a folder, a random not-installed thing, or not a scoped package,
+ // then link or install it first
+ if (pkg[0] !== "@" && (pkg.indexOf("/") !== -1 || pkg.indexOf("\\") !== -1)) {
return fs.lstat(path.resolve(pkg), function (er, st) {
if (er || !st.isDirectory()) {
npm.commands.install(t, pkg, n)
diff --git a/deps/npm/lib/ls.js b/deps/npm/lib/ls.js
index 781b6443b990cd0918cd200507c60a568fa50843..ed329d19e1bb9a2f28a16d2820386c3588429da3 100644
--- a/deps/npm/lib/ls.js
+++ b/deps/npm/lib/ls.js
@@ -14,8 +14,8 @@ var npm = require("./npm.js")
, archy = require("archy")
, semver = require("semver")
, url = require("url")
- , isGitUrl = require("./utils/is-git-url.js")
, color = require("ansicolors")
+ , npa = require("npm-package-arg")
ls.usage = "npm ls"
@@ -29,9 +29,9 @@ function ls (args, silent, cb) {
// npm ls 'foo@~1.3' bar 'baz@<2'
if (!args) args = []
else args = args.map(function (a) {
- var nv = a.split("@")
- , name = nv.shift()
- , ver = semver.validRange(nv.join("@")) || ""
+ var p = npa(a)
+ , name = p.name
+ , ver = semver.validRange(p.rawSpec) || ""
return [ name, ver ]
})
@@ -39,6 +39,7 @@ function ls (args, silent, cb) {
var depth = npm.config.get("depth")
var opt = { depth: depth, log: log.warn, dev: true }
readInstalled(dir, opt, function (er, data) {
+ pruneNestedExtraneous(data)
var bfs = bfsify(data, args)
, lite = getLite(bfs)
@@ -75,6 +76,18 @@ function ls (args, silent, cb) {
})
}
+function pruneNestedExtraneous (data, visited) {
+ visited = visited || []
+ visited.push(data)
+ for (var i in data.dependencies) {
+ if (data.dependencies[i].extraneous) {
+ data.dependencies[i].dependencies = {}
+ } else if (visited.indexOf(data.dependencies[i]) === -1) {
+ pruneNestedExtraneous(data.dependencies[i], visited)
+ }
+ }
+}
+
function alphasort (a, b) {
a = a.toLowerCase()
b = b.toLowerCase()
@@ -265,7 +278,7 @@ function makeArchy_ (data, long, dir, depth, parent, d) {
// add giturl to name@version
if (data._resolved) {
- if (isGitUrl(url.parse(data._resolved)))
+ if (npa(data._resolved).type === "git")
out.label += " (" + data._resolved + ")"
}
diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js
index 3139b1d1452273bb3a53c73e91a9539496387dfd..c811be5a96b75efa34f2c627ba0d0dc224530463 100644
--- a/deps/npm/lib/npm.js
+++ b/deps/npm/lib/npm.js
@@ -46,16 +46,6 @@ try {
var j = JSON.parse(fs.readFileSync(
path.join(__dirname, "../package.json"))+"")
npm.version = j.version
- npm.nodeVersionRequired = j.engines.node
- if (!semver.satisfies(pv, j.engines.node)) {
- log.warn("unsupported version", [""
- ,"npm requires node version: "+j.engines.node
- ,"And you have: "+pv
- ,"which is not satisfactory."
- ,""
- ,"Bad things will likely happen. You have been warned."
- ,""].join("\n"))
- }
} catch (ex) {
try {
log.info("error reading version", ex)
@@ -153,6 +143,7 @@ var commandCache = {}
]
, plumbing = [ "build"
, "unbuild"
+ , "isntall"
, "xmas"
, "substack"
, "visnup"
diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js
index a71df7fe76a69a2f158e37dd264da482a1cf3f87..fdfd7624db25fe138eea9156fe3ecd84ab14dea3 100644
--- a/deps/npm/lib/outdated.js
+++ b/deps/npm/lib/outdated.js
@@ -28,12 +28,13 @@ var path = require("path")
, asyncMap = require("slide").asyncMap
, npm = require("./npm.js")
, url = require("url")
- , isGitUrl = require("./utils/is-git-url.js")
, color = require("ansicolors")
, styles = require("ansistyles")
, table = require("text-table")
, semver = require("semver")
, os = require("os")
+ , mapToRegistry = require("./utils/map-to-registry.js")
+ , npa = require("npm-package-arg")
function outdated (args, silent, cb) {
if (typeof cb !== "function") cb = silent, silent = false
@@ -43,7 +44,7 @@ function outdated (args, silent, cb) {
if (npm.config.get("json")) {
console.log(makeJSON(list))
} else if (npm.config.get("parseable")) {
- console.log(makeParseable(list));
+ console.log(makeParseable(list))
} else {
var outList = list.map(makePretty)
var outTable = [[ "Package"
@@ -99,7 +100,7 @@ function makePretty (p) {
function ansiTrim (str) {
var r = new RegExp("\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|" +
- "\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g");
+ "\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g")
return str.replace(r, "")
}
@@ -114,7 +115,7 @@ function makeParseable (list) {
, dir = path.resolve(p[0], "node_modules", dep)
, has = p[2]
, want = p[3]
- , latest = p[4];
+ , latest = p[4]
return [ dir
, dep + "@" + want
@@ -264,20 +265,25 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb) {
return skip()
}
- if (isGitUrl(url.parse(req)))
+ if (npa(req).type === "git")
return doIt("git", "git")
// search for the latest package
- var uri = url.resolve(npm.config.get("registry"), dep)
- npm.registry.get(uri, null, function (er, d) {
+ mapToRegistry(dep, npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ npm.registry.get(uri, null, updateDeps)
+ })
+
+ function updateDeps (er, d) {
if (er) return cb()
- if (!d || !d['dist-tags'] || !d.versions) return cb()
- var l = d.versions[d['dist-tags'].latest]
+ if (!d || !d["dist-tags"] || !d.versions) return cb()
+ var l = d.versions[d["dist-tags"].latest]
if (!l) return cb()
var r = req
- if (d['dist-tags'][req])
- r = d['dist-tags'][req]
+ if (d["dist-tags"][req])
+ r = d["dist-tags"][req]
if (semver.validRange(r, true)) {
// some kind of semver range.
@@ -290,13 +296,13 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb) {
}
// We didn't find the version in the doc. See if cache can find it.
- cache.add(dep, req, false, onCacheAdd)
+ cache.add(dep, req, null, false, onCacheAdd)
function onCacheAdd(er, d) {
// if this fails, then it means we can't update this thing.
// it's probably a thing that isn't published.
if (er) {
- if (er.code && er.code === 'ETARGET') {
+ if (er.code && er.code === "ETARGET") {
// no viable version found
return skip(er)
}
@@ -315,6 +321,5 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb) {
else
skip()
}
-
- })
+ }
}
diff --git a/deps/npm/lib/owner.js b/deps/npm/lib/owner.js
index 34dbbc24722a376fc12527408f0333b9c1419e48..2fdee7adb69ab9d5df99137097753bb9337b8332 100644
--- a/deps/npm/lib/owner.js
+++ b/deps/npm/lib/owner.js
@@ -5,6 +5,12 @@ owner.usage = "npm owner add "
+ "\nnpm owner rm "
+ "\nnpm owner ls "
+var npm = require("./npm.js")
+ , registry = npm.registry
+ , log = require("npmlog")
+ , readJson = require("read-package-json")
+ , mapToRegistry = require("./utils/map-to-registry.js")
+
owner.completion = function (opts, cb) {
var argv = opts.conf.argv.remain
if (argv.length > 4) return cb()
@@ -14,65 +20,78 @@ owner.completion = function (opts, cb) {
else subs.push("ls", "list")
return cb(null, subs)
}
- var un = encodeURIComponent(npm.config.get("username"))
- var theUser, uri
- switch (argv[2]) {
- case "ls":
- if (argv.length > 3) return cb()
- uri = url.resolve(npm.config.get("registry"), "-/short")
- return registry.get(uri, null, cb)
-
- case "rm":
- if (argv.length > 3) {
- theUser = encodeURIComponent(argv[3])
- uri = url.resolve(npm.config.get("registry"), "-/by-user/"+theUser+"|"+un)
- console.error(uri)
- return registry.get(uri, null, function (er, d) {
+
+ npm.commands.whoami([], true, function (er, username) {
+ if (er) return cb()
+
+ var un = encodeURIComponent(username)
+ var byUser, theUser
+ switch (argv[2]) {
+ case "ls":
+ if (argv.length > 3) return cb()
+ return mapToRegistry("-/short", npm.config, function (er, uri) {
if (er) return cb(er)
- // return the intersection
- return cb(null, d[theUser].filter(function (p) {
- // kludge for server adminery.
- return un === "isaacs" || d[un].indexOf(p) === -1
- }))
+
+ registry.get(uri, null, cb)
})
- }
- // else fallthrough
- case "add":
- if (argv.length > 3) {
- theUser = encodeURIComponent(argv[3])
- uri = url.resolve(npm.config.get("registry"), "-/by-user/"+theUser+"|"+un)
- console.error(uri)
- return registry.get(uri, null, function (er, d) {
- console.error(uri, er || d)
- // return mine that they're not already on.
+
+ case "rm":
+ if (argv.length > 3) {
+ theUser = encodeURIComponent(argv[3])
+ byUser = "-/by-user/" + theUser + "|" + un
+ return mapToRegistry(byUser, npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ console.error(uri)
+ registry.get(uri, null, function (er, d) {
+ if (er) return cb(er)
+ // return the intersection
+ return cb(null, d[theUser].filter(function (p) {
+ // kludge for server adminery.
+ return un === "isaacs" || d[un].indexOf(p) === -1
+ }))
+ })
+ })
+ }
+ // else fallthrough
+ case "add":
+ if (argv.length > 3) {
+ theUser = encodeURIComponent(argv[3])
+ byUser = "-/by-user/" + theUser + "|" + un
+ return mapToRegistry(byUser, npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ console.error(uri)
+ registry.get(uri, null, function (er, d) {
+ console.error(uri, er || d)
+ // return mine that they're not already on.
+ if (er) return cb(er)
+ var mine = d[un] || []
+ , theirs = d[theUser] || []
+ return cb(null, mine.filter(function (p) {
+ return theirs.indexOf(p) === -1
+ }))
+ })
+ })
+ }
+ // just list all users who aren't me.
+ return mapToRegistry("-/users", npm.config, function (er, uri) {
if (er) return cb(er)
- var mine = d[un] || []
- , theirs = d[theUser] || []
- return cb(null, mine.filter(function (p) {
- return theirs.indexOf(p) === -1
- }))
+
+ registry.get(uri, null, function (er, list) {
+ if (er) return cb()
+ return cb(null, Object.keys(list).filter(function (n) {
+ return n !== un
+ }))
+ })
})
- }
- // just list all users who aren't me.
- uri = url.resolve(npm.config.get("registry"), "-/users")
- return registry.get(uri, null, function (er, list) {
- if (er) return cb()
- return cb(null, Object.keys(list).filter(function (n) {
- return n !== un
- }))
- })
- default:
- return cb()
- }
+ default:
+ return cb()
+ }
+ })
}
-var npm = require("./npm.js")
- , registry = npm.registry
- , log = require("npmlog")
- , readJson = require("read-package-json")
- , url = require("url")
-
function owner (args, cb) {
var action = args.shift()
switch (action) {
@@ -90,18 +109,23 @@ function ls (pkg, cb) {
ls(pkg, cb)
})
- var uri = url.resolve(npm.config.get("registry"), pkg)
- registry.get(uri, null, function (er, data) {
- var msg = ""
- if (er) {
- log.error("owner ls", "Couldn't get owner data", pkg)
- return cb(er)
- }
- var owners = data.maintainers
- if (!owners || !owners.length) msg = "admin party!"
- else msg = owners.map(function (o) { return o.name +" <"+o.email+">" }).join("\n")
- console.log(msg)
- cb(er, owners)
+ mapToRegistry(pkg, npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.get(uri, null, function (er, data) {
+ var msg = ""
+ if (er) {
+ log.error("owner ls", "Couldn't get owner data", pkg)
+ return cb(er)
+ }
+ var owners = data.maintainers
+ if (!owners || !owners.length) msg = "admin party!"
+ else msg = owners.map(function (o) {
+ return o.name + " <" + o.email + ">"
+ }).join("\n")
+ console.log(msg)
+ cb(er, owners)
+ })
})
}
@@ -120,7 +144,7 @@ function add (user, pkg, cb) {
var o = owners[i]
if (o.name === u.name) {
log.info( "owner add"
- , "Already a package owner: "+o.name+" <"+o.email+">")
+ , "Already a package owner: " + o.name + " <" + o.email + ">")
return false
}
}
@@ -145,7 +169,7 @@ function rm (user, pkg, cb) {
return !match
})
if (!found) {
- log.info("owner rm", "Not a package owner: "+user)
+ log.info("owner rm", "Not a package owner: " + user)
return false
}
if (!m.length) return new Error(
@@ -156,15 +180,19 @@ function rm (user, pkg, cb) {
function mutate (pkg, user, mutation, cb) {
if (user) {
- var uri = url.resolve(npm.config.get("registry"), "-/user/org.couchdb.user:"+user)
- registry.get(uri, null, mutate_)
+ var byUser = "-/user/org.couchdb.user:" + user
+ mapToRegistry(byUser, npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.get(uri, null, mutate_)
+ })
} else {
mutate_(null, null)
}
function mutate_ (er, u) {
if (!er && user && (!u || u.error)) er = new Error(
- "Couldn't get user data for "+user+": "+JSON.stringify(u))
+ "Couldn't get user data for " + user + ": " + JSON.stringify(u))
if (er) {
log.error("owner mutate", "Error getting user data for %s", user)
@@ -172,27 +200,34 @@ function mutate (pkg, user, mutation, cb) {
}
if (u) u = { "name" : u.name, "email" : u.email }
- var uri = url.resolve(npm.config.get("registry"), pkg)
- registry.get(uri, null, function (er, data) {
- if (er) {
- log.error("owner mutate", "Error getting package data for %s", pkg)
- return cb(er)
- }
- var m = mutation(u, data.maintainers)
- if (!m) return cb() // handled
- if (m instanceof Error) return cb(m) // error
- data = { _id : data._id
- , _rev : data._rev
- , maintainers : m
- }
- var uri = url.resolve(npm.config.get("registry"), pkg+"/-rev/"+data._rev)
- registry.request("PUT", uri, { body : data }, function (er, data) {
- if (!er && data.error) er = new Error(
- "Failed to update package metadata: "+JSON.stringify(data))
+ mapToRegistry(pkg, npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.get(uri, null, function (er, data) {
if (er) {
- log.error("owner mutate", "Failed to update package metadata")
+ log.error("owner mutate", "Error getting package data for %s", pkg)
+ return cb(er)
}
- cb(er, data)
+ var m = mutation(u, data.maintainers)
+ if (!m) return cb() // handled
+ if (m instanceof Error) return cb(m) // error
+ data = { _id : data._id
+ , _rev : data._rev
+ , maintainers : m
+ }
+ var dataPath = pkg + "/-rev/" + data._rev
+ mapToRegistry(dataPath, npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.request("PUT", uri, { body : data }, function (er, data) {
+ if (!er && data.error) er = new Error(
+ "Failed to update package metadata: " + JSON.stringify(data))
+ if (er) {
+ log.error("owner mutate", "Failed to update package metadata")
+ }
+ cb(er, data)
+ })
+ })
})
})
}
@@ -207,5 +242,5 @@ function readLocalPkg (cb) {
}
function unknown (action, cb) {
- cb("Usage: \n"+owner.usage)
+ cb("Usage: \n" + owner.usage)
}
diff --git a/deps/npm/lib/pack.js b/deps/npm/lib/pack.js
index ea94dd15422d065b90ee7613df99fd6659ced707..f955cb71a830463250ce23e6301321316a2b069e 100644
--- a/deps/npm/lib/pack.js
+++ b/deps/npm/lib/pack.js
@@ -40,9 +40,14 @@ function printFiles (files, cb) {
// add to cache, then cp to the cwd
function pack_ (pkg, cb) {
- cache.add(pkg, null, false, function (er, data) {
+ cache.add(pkg, null, null, false, function (er, data) {
if (er) return cb(er)
- var fname = path.resolve(data._id.replace(/@/g, "-") + ".tgz")
+
+ var name = data.name
+ // scoped packages get special treatment
+ if (name[0] === "@") name = name.substr(1).replace(/\//g, "-")
+
+ var fname = name + "-" + data.version + ".tgz"
, cached = path.resolve( npm.cache
, data.name
, data.version
diff --git a/deps/npm/lib/publish.js b/deps/npm/lib/publish.js
index ccad3ea8270aa3a7de7a623d582a9613d6c3b34c..701dc2b92ea4b5d6dc97b2268ea7c25aa72c24df 100644
--- a/deps/npm/lib/publish.js
+++ b/deps/npm/lib/publish.js
@@ -1,7 +1,8 @@
module.exports = publish
-var npm = require("./npm.js")
+var url = require("url")
+ , npm = require("./npm.js")
, log = require("npmlog")
, path = require("path")
, readJson = require("read-package-json")
@@ -9,6 +10,7 @@ var npm = require("./npm.js")
, chain = require("slide").chain
, Conf = require("npmconf").Conf
, RegClient = require("npm-registry-client")
+ , mapToRegistry = require("./utils/map-to-registry.js")
publish.usage = "npm publish "
+ "\nnpm publish "
@@ -22,7 +24,10 @@ publish.completion = function (opts, cb) {
}
function publish (args, isRetry, cb) {
- if (typeof cb !== "function") cb = isRetry, isRetry = false
+ if (typeof cb !== "function") {
+ cb = isRetry
+ isRetry = false
+ }
if (args.length === 0) args = ["."]
if (args.length !== 1) return cb(publish.usage)
@@ -47,15 +52,15 @@ function publish (args, isRetry, cb) {
// That means that we can run publish/postpublish in the dir, rather than
// in the cache dir.
function cacheAddPublish (dir, didPre, isRetry, cb) {
- npm.commands.cache.add(dir, null, false, function (er, data) {
+ npm.commands.cache.add(dir, null, null, false, function (er, data) {
if (er) return cb(er)
log.silly("publish", data)
var cachedir = path.resolve( npm.cache
, data.name
, data.version
, "package" )
- chain
- ( [ !didPre && [lifecycle, data, "prepublish", cachedir]
+ chain([ !didPre &&
+ [lifecycle, data, "prepublish", cachedir]
, [publish_, dir, data, isRetry, cachedir]
, [lifecycle, data, "publish", didPre ? dir : cachedir]
, [lifecycle, data, "postpublish", didPre ? dir : cachedir] ]
@@ -66,48 +71,61 @@ function cacheAddPublish (dir, didPre, isRetry, cb) {
function publish_ (arg, data, isRetry, cachedir, cb) {
if (!data) return cb(new Error("no package.json file found"))
- // check for publishConfig hash
var registry = npm.registry
- var registryURI = npm.config.get("registry")
+ var config = npm.config
+
+ // check for publishConfig hash
if (data.publishConfig) {
- var pubConf = new Conf(npm.config)
- pubConf.save = npm.config.save.bind(npm.config)
+ config = new Conf(npm.config)
+ config.save = npm.config.save.bind(npm.config)
// don't modify the actual publishConfig object, in case we have
// to set a login token or some other data.
- pubConf.unshift(Object.keys(data.publishConfig).reduce(function (s, k) {
+ config.unshift(Object.keys(data.publishConfig).reduce(function (s, k) {
s[k] = data.publishConfig[k]
return s
}, {}))
- registry = new RegClient(pubConf)
- registryURI = pubConf.get("registry")
+ registry = new RegClient(config)
}
data._npmVersion = npm.version
- data._npmUser = { name: npm.config.get("username")
- , email: npm.config.get("email") }
delete data.modules
- if (data.private) return cb(new Error
- ("This package has been marked as private\n"
- +"Remove the 'private' field from the package.json to publish it."))
-
- var tarball = cachedir + ".tgz"
- registry.publish(registryURI, data, tarball, function (er) {
- if (er && er.code === "EPUBLISHCONFLICT"
- && npm.config.get("force") && !isRetry) {
- log.warn("publish", "Forced publish over "+data._id)
- return npm.commands.unpublish([data._id], function (er) {
- // ignore errors. Use the force. Reach out with your feelings.
- // but if it fails again, then report the first error.
- publish([arg], er || true, cb)
- })
- }
- // report the unpublish error if this was a retry and unpublish failed
- if (er && isRetry && isRetry !== true) return cb(isRetry)
+ if (data.private) return cb(
+ new Error(
+ "This package has been marked as private\n" +
+ "Remove the 'private' field from the package.json to publish it."
+ )
+ )
+
+ mapToRegistry(data.name, config, function (er, registryURI) {
if (er) return cb(er)
- console.log("+ " + data._id)
- cb()
+
+ var tarball = cachedir + ".tgz"
+
+ // we just want the base registry URL in this case
+ var registryBase = url.resolve(registryURI, ".")
+ log.verbose("publish", "registryBase", registryBase)
+
+ var c = config.getCredentialsByURI(registryBase)
+ data._npmUser = {name: c.username, email: c.email}
+
+ registry.publish(registryBase, data, tarball, function (er) {
+ if (er && er.code === "EPUBLISHCONFLICT"
+ && npm.config.get("force") && !isRetry) {
+ log.warn("publish", "Forced publish over " + data._id)
+ return npm.commands.unpublish([data._id], function (er) {
+ // ignore errors. Use the force. Reach out with your feelings.
+ // but if it fails again, then report the first error.
+ publish([arg], er || true, cb)
+ })
+ }
+ // report the unpublish error if this was a retry and unpublish failed
+ if (er && isRetry && isRetry !== true) return cb(isRetry)
+ if (er) return cb(er)
+ console.log("+ " + data._id)
+ cb()
+ })
})
}
diff --git a/deps/npm/lib/rebuild.js b/deps/npm/lib/rebuild.js
index e296451b705587c3f588acb817159850a3976e64..ab372c6ec07c7e7b252c5e81844813721d8db986 100644
--- a/deps/npm/lib/rebuild.js
+++ b/deps/npm/lib/rebuild.js
@@ -5,6 +5,7 @@ var readInstalled = require("read-installed")
, semver = require("semver")
, log = require("npmlog")
, npm = require("./npm.js")
+ , npa = require("npm-package-arg")
rebuild.usage = "npm rebuild [[@] [name[@] ...]]"
@@ -46,9 +47,9 @@ function filter (data, args, set, seen) {
else if (data.name && data._id) {
for (var i = 0, l = args.length; i < l; i ++) {
var arg = args[i]
- , nv = arg.split("@")
- , n = nv.shift()
- , v = nv.join("@")
+ , nv = npa(arg)
+ , n = nv.name
+ , v = nv.rawSpec
if (n !== data.name) continue
if (!semver.satisfies(data.version, v, true)) continue
pass = true
diff --git a/deps/npm/lib/repo.js b/deps/npm/lib/repo.js
index d209c3ca836bf730c0071cadee92c974e9c8def1..c6db8e37b012a471d72e383d0b78d8acaf28631f 100644
--- a/deps/npm/lib/repo.js
+++ b/deps/npm/lib/repo.js
@@ -5,9 +5,12 @@ repo.usage = "npm repo "
repo.completion = function (opts, cb) {
if (opts.conf.argv.remain.length > 2) return cb()
- var uri = url_.resolve(npm.config.get("registry"), "/-/short")
- registry.get(uri, { timeout : 60000 }, function (er, list) {
- return cb(null, list || [])
+ mapToRegistry("/-/short", npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.get(uri, { timeout : 60000 }, function (er, list) {
+ return cb(null, list || [])
+ })
})
}
@@ -19,10 +22,12 @@ var npm = require("./npm.js")
, path = require("path")
, readJson = require("read-package-json")
, fs = require("fs")
- , url_ = require('url')
+ , url_ = require("url")
+ , mapToRegistry = require("./utils/map-to-registry.js")
+ , npa = require("npm-package-arg")
function repo (args, cb) {
- var n = args.length && args[0].split("@").shift() || '.'
+ var n = args.length && npa(args[0]).name || "."
fs.stat(n, function (er, s) {
if (er && er.code === "ENOENT") return callRegistry(n, cb)
else if (er) return cb(er)
@@ -35,8 +40,8 @@ function repo (args, cb) {
}
function getUrlAndOpen (d, cb) {
- var r = d.repository;
- if (!r) return cb(new Error('no repository'));
+ var r = d.repository
+ if (!r) return cb(new Error('no repository'))
// XXX remove this when npm@v1.3.10 from node 0.10 is deprecated
// from https://github.com/npm/npm-www/issues/418
if (githubUserRepo(r.url))
@@ -52,10 +57,13 @@ function getUrlAndOpen (d, cb) {
}
function callRegistry (n, cb) {
- var uri = url_.resolve(npm.config.get("registry"), n + "/latest")
- registry.get(uri, { timeout : 3600 }, function (er, d) {
+ mapToRegistry(n, npm.config, function (er, uri) {
if (er) return cb(er)
- getUrlAndOpen(d, cb)
+
+ registry.get(uri + "/latest", { timeout : 3600 }, function (er, d) {
+ if (er) return cb(er)
+ getUrlAndOpen(d, cb)
+ })
})
}
diff --git a/deps/npm/lib/run-script.js b/deps/npm/lib/run-script.js
index 25e98f01d657b01ca929ed6a4bf1f1cb2b3d1de6..6cb7bf7fb9765078620c2d6698eaf10b66733f99 100644
--- a/deps/npm/lib/run-script.js
+++ b/deps/npm/lib/run-script.js
@@ -8,7 +8,7 @@ var lifecycle = require("./utils/lifecycle.js")
, log = require("npmlog")
, chain = require("slide").chain
-runScript.usage = "npm run-script [] "
+runScript.usage = "npm run-script [-- ]"
runScript.completion = function (opts, cb) {
@@ -21,7 +21,7 @@ runScript.completion = function (opts, cb) {
if (argv.length === 3) {
// either specified a script locally, in which case, done,
// or a package, in which case, complete against its scripts
- var json = path.join(npm.prefix, "package.json")
+ var json = path.join(npm.localPrefix, "package.json")
return readJson(json, function (er, d) {
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
if (er) d = {}
@@ -30,7 +30,7 @@ runScript.completion = function (opts, cb) {
if (scripts.indexOf(argv[2]) !== -1) return cb()
// ok, try to find out which package it was, then
var pref = npm.config.get("global") ? npm.config.get("prefix")
- : npm.prefix
+ : npm.localPrefix
var pkgDir = path.resolve( pref, "node_modules"
, argv[2], "package.json" )
readJson(pkgDir, function (er, d) {
@@ -54,7 +54,7 @@ runScript.completion = function (opts, cb) {
})
if (npm.config.get("global")) scripts = [], next()
- else readJson(path.join(npm.prefix, "package.json"), function (er, d) {
+ else readJson(path.join(npm.localPrefix, "package.json"), function (er, d) {
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
d = d || {}
scripts = Object.keys(d.scripts || {})
@@ -69,18 +69,18 @@ runScript.completion = function (opts, cb) {
function runScript (args, cb) {
if (!args.length) return list(cb)
- var pkgdir = args.length === 1 ? process.cwd()
- : path.resolve(npm.dir, args[0])
- , cmd = args.pop()
+
+ var pkgdir = npm.localPrefix
+ , cmd = args.shift()
readJson(path.resolve(pkgdir, "package.json"), function (er, d) {
if (er) return cb(er)
- run(d, pkgdir, cmd, cb)
+ run(d, pkgdir, cmd, args, cb)
})
}
function list(cb) {
- var json = path.join(npm.prefix, 'package.json')
+ var json = path.join(npm.localPrefix, 'package.json')
return readJson(json, function(er, d) {
if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er)
if (er) d = {}
@@ -109,7 +109,7 @@ function list(cb) {
})
}
-function run (pkg, wd, cmd, cb) {
+function run (pkg, wd, cmd, args, cb) {
var cmds = []
if (!pkg.scripts) pkg.scripts = {}
if (cmd === "restart") {
@@ -124,7 +124,21 @@ function run (pkg, wd, cmd, cb) {
}
log.verbose("run-script", cmds)
chain(cmds.map(function (c) {
+ // pass cli arguments after -- to script.
+ if (pkg.scripts[c]) pkg.scripts[c] = pkg.scripts[c] + joinArgs(args)
+
// when running scripts explicitly, assume that they're trusted.
return [lifecycle, pkg, c, wd, true]
}), cb)
}
+
+// join arguments after '--' and pass them to script,
+// handle special characters such as ', ", ' '.
+function joinArgs (args) {
+ var joinedArgs = ''
+ args.forEach(function(arg, i) {
+ if (arg.match(/[ '"]/)) arg = '"' + arg.replace(/"/g, '\\"') + '"'
+ joinedArgs += ' ' + arg
+ })
+ return joinedArgs
+}
diff --git a/deps/npm/lib/search.js b/deps/npm/lib/search.js
index e7892350ca6ee8394e104b71e7c0ab353b695550..3be8b0d27db60ea65086550bcc2298ee20c64d0b 100644
--- a/deps/npm/lib/search.js
+++ b/deps/npm/lib/search.js
@@ -1,10 +1,10 @@
module.exports = exports = search
-var url = require("url")
- , npm = require("./npm.js")
+var npm = require("./npm.js")
, registry = npm.registry
, columnify = require('columnify')
+ , mapToRegistry = require("./utils/map-to-registry.js")
search.usage = "npm search [some search terms ...]"
@@ -63,10 +63,13 @@ function getFilteredData (staleness, args, notArgs, cb) {
follow : true,
staleOk : true
}
- var uri = url.resolve(npm.config.get("registry"), "-/all")
- registry.get(uri, opts, function (er, data) {
+ mapToRegistry("-/all", npm.config, function (er, uri) {
if (er) return cb(er)
- return cb(null, filter(data, args, notArgs))
+
+ registry.get(uri, opts, function (er, data) {
+ if (er) return cb(er)
+ return cb(null, filter(data, args, notArgs))
+ })
})
}
diff --git a/deps/npm/lib/star.js b/deps/npm/lib/star.js
index 9c0b4ea9ed92b489d2c4eadec1715b508e7ace9a..123c4ebbb44e35b19cdc9bd003b0c3dc4162bee3 100644
--- a/deps/npm/lib/star.js
+++ b/deps/npm/lib/star.js
@@ -1,19 +1,22 @@
module.exports = star
-var url = require("url")
- , npm = require("./npm.js")
+var npm = require("./npm.js")
, registry = npm.registry
, log = require("npmlog")
, asyncMap = require("slide").asyncMap
+ , mapToRegistry = require("./utils/map-to-registry.js")
star.usage = "npm star [pkg, pkg, ...]\n"
+ "npm unstar [pkg, pkg, ...]"
star.completion = function (opts, cb) {
- var uri = url.resolve(npm.config.get("registry"), "-/short")
- registry.get(uri, { timeout : 60000 }, function (er, list) {
- return cb(null, list || [])
+ mapToRegistry("-/short", npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.get(uri, { timeout : 60000 }, function (er, list) {
+ return cb(null, list || [])
+ })
})
}
@@ -24,13 +27,16 @@ function star (args, cb) {
, using = !(npm.command.match(/^un/))
if (!using) s = u
asyncMap(args, function (pkg, cb) {
- var uri = url.resolve(npm.config.get("registry"), pkg)
- registry.star(uri, using, function (er, data, raw, req) {
- if (!er) {
- console.log(s + " "+pkg)
- log.verbose("star", data)
- }
- cb(er, data, raw, req)
+ mapToRegistry(pkg, npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.star(uri, using, function (er, data, raw, req) {
+ if (!er) {
+ console.log(s + " "+pkg)
+ log.verbose("star", data)
+ }
+ cb(er, data, raw, req)
+ })
})
}, cb)
}
diff --git a/deps/npm/lib/stars.js b/deps/npm/lib/stars.js
index f0d2ef73aebab5150fd0d36fc6f6e8231bac7382..dee5c152afa5ecd7669e5fa6a129c09d8784be49 100644
--- a/deps/npm/lib/stars.js
+++ b/deps/npm/lib/stars.js
@@ -2,23 +2,26 @@ module.exports = stars
stars.usage = "npm stars [username]"
-var url = require("url")
- , npm = require("./npm.js")
+var npm = require("./npm.js")
, registry = npm.registry
, log = require("npmlog")
+ , mapToRegistry = require("./utils/map-to-registry.js")
function stars (args, cb) {
- var name = args.length === 1 ? args[0] : npm.config.get("username")
- , uri = url.resolve(npm.config.get("registry"), name)
- registry.stars(uri, showstars)
+ npm.commands.whoami([], true, function (er, username) {
+ var name = args.length === 1 ? args[0] : username
+ mapToRegistry("", npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.stars(uri, name, showstars)
+ })
+ })
function showstars (er, data) {
- if (er) {
- return cb(er)
- }
+ if (er) return cb(er)
if (data.rows.length === 0) {
- log.warn('stars', 'user has not starred any packages.')
+ log.warn("stars", "user has not starred any packages.")
} else {
data.rows.forEach(function(a) {
console.log(a.value)
diff --git a/deps/npm/lib/submodule.js b/deps/npm/lib/submodule.js
index 2231ced9cfbc9250cc8c2839f9974032816312f7..eab4d21b05cea95a56fdb908f5f48adfd285aecf 100644
--- a/deps/npm/lib/submodule.js
+++ b/deps/npm/lib/submodule.js
@@ -9,7 +9,6 @@ var npm = require("./npm.js")
, git = require("./utils/git.js")
, asyncMap = require("slide").asyncMap
, chain = require("slide").chain
- , which = require("which")
submodule.usage = "npm submodule "
@@ -23,7 +22,7 @@ function submodule (args, cb) {
if (args.length === 0) return cb(submodule.usage)
asyncMap(args, function (arg, cb) {
- cache.add(arg, null, false, cb)
+ cache.add(arg, null, null, false, cb)
}, function (er, pkgs) {
if (er) return cb(er)
chain(pkgs.map(function (pkg) { return function (cb) {
@@ -71,7 +70,7 @@ function addSubmodule (name, url, cb) {
var getSubmodules = function (cb) {
var args = [ "submodule", "status" ]
-
+
git.whichAndExec(args, function _(er, stdout) {
if (er) return cb(er)
var res = stdout.trim().split(/\n/).map(function (line) {
diff --git a/deps/npm/lib/tag.js b/deps/npm/lib/tag.js
index 1d04ad1f7e059204728c9234d629b70a5bf425f3..47e9a8c0ac7a29f9291a6f2091073666c1479937 100644
--- a/deps/npm/lib/tag.js
+++ b/deps/npm/lib/tag.js
@@ -5,16 +5,30 @@ tag.usage = "npm tag @ []"
tag.completion = require("./unpublish.js").completion
-var url = require("url")
- , npm = require("./npm.js")
+var npm = require("./npm.js")
, registry = npm.registry
+ , mapToRegistry = require("./utils/map-to-registry.js")
+ , npa = require("npm-package-arg")
+ , semver = require("semver")
function tag (args, cb) {
- var thing = (args.shift() || "").split("@")
- , project = thing.shift()
- , version = thing.join("@")
+ var thing = npa(args.shift() || "")
+ , project = thing.name
+ , version = thing.rawSpec
, t = args.shift() || npm.config.get("tag")
+
+ t = t.trim()
+
if (!project || !version || !t) return cb("Usage:\n"+tag.usage)
- var uri = url.resolve(npm.config.get("registry"), project)
- registry.tag(uri, version, t, cb)
+
+ if (semver.validRange(t)) {
+ var er = new Error("Tag name must not be a valid SemVer range: " + t)
+ return cb(er)
+ }
+
+ mapToRegistry(project, npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.tag(uri, version, t, cb)
+ })
}
diff --git a/deps/npm/lib/unbuild.js b/deps/npm/lib/unbuild.js
index b594f28a9baa9e2cc19a233616cd85038e1d2a2f..797762436bbff6203008831e9ebeac93ae5abc57 100644
--- a/deps/npm/lib/unbuild.js
+++ b/deps/npm/lib/unbuild.js
@@ -2,7 +2,6 @@ module.exports = unbuild
unbuild.usage = "npm unbuild \n(this is plumbing)"
var readJson = require("read-package-json")
- , rm = require("./utils/gently-rm.js")
, gentlyRm = require("./utils/gently-rm.js")
, npm = require("./npm.js")
, path = require("path")
@@ -15,7 +14,7 @@ var readJson = require("read-package-json")
// args is a list of folders.
// remove any bins/etc, and then delete the folder.
function unbuild (args, silent, cb) {
- if (typeof silent === 'function') cb = silent, silent = false
+ if (typeof silent === "function") cb = silent, silent = false
asyncMap(args, unbuild_(silent), cb)
}
@@ -28,7 +27,7 @@ function unbuild_ (silent) { return function (folder, cb_) {
log.verbose(folder.substr(npm.prefix.length + 1), "unbuild")
readJson(path.resolve(folder, "package.json"), function (er, pkg) {
// if no json, then just trash it, but no scripts or whatever.
- if (er) return rm(folder, cb)
+ if (er) return gentlyRm(folder, false, cb)
readJson.cache.del(folder)
chain
( [ [lifecycle, pkg, "preuninstall", folder, false, true]
@@ -39,7 +38,7 @@ function unbuild_ (silent) { return function (folder, cb_) {
}
, [rmStuff, pkg, folder]
, [lifecycle, pkg, "postuninstall", folder, false, true]
- , [rm, folder] ]
+ , [gentlyRm, folder, undefined] ]
, cb )
})
}}
@@ -66,8 +65,8 @@ function rmBins (pkg, folder, parent, top, cb) {
log.verbose([binRoot, pkg.bin], "binRoot")
asyncMap(Object.keys(pkg.bin), function (b, cb) {
if (process.platform === "win32") {
- chain([ [rm, path.resolve(binRoot, b) + ".cmd"]
- , [rm, path.resolve(binRoot, b) ] ], cb)
+ chain([ [gentlyRm, path.resolve(binRoot, b) + ".cmd", undefined]
+ , [gentlyRm, path.resolve(binRoot, b), undefined] ], cb)
} else {
gentlyRm( path.resolve(binRoot, b)
, !npm.config.get("force") && folder
diff --git a/deps/npm/lib/unpublish.js b/deps/npm/lib/unpublish.js
index 225c1c3c455b18e46a1158d1c556c1424f6868d7..2566cd5ae62644f6e182a8064357b77fab11bab2 100644
--- a/deps/npm/lib/unpublish.js
+++ b/deps/npm/lib/unpublish.js
@@ -1,40 +1,51 @@
module.exports = unpublish
-var url = require("url")
- , log = require("npmlog")
+var log = require("npmlog")
, npm = require("./npm.js")
, registry = npm.registry
, readJson = require("read-package-json")
, path = require("path")
+ , mapToRegistry = require("./utils/map-to-registry.js")
+ , npa = require("npm-package-arg")
unpublish.usage = "npm unpublish [@]"
unpublish.completion = function (opts, cb) {
if (opts.conf.argv.remain.length >= 3) return cb()
- var un = encodeURIComponent(npm.config.get("username"))
- if (!un) return cb()
- var uri = url.resolve(npm.config.get("registry"), "-/by-user/"+un)
- registry.get(uri, null, function (er, pkgs) {
- // do a bit of filtering at this point, so that we don't need
- // to fetch versions for more than one thing, but also don't
- // accidentally a whole project.
- pkgs = pkgs[un]
- if (!pkgs || !pkgs.length) return cb()
- var partial = opts.partialWord.split("@")
- , pp = partial.shift()
- pkgs = pkgs.filter(function (p) {
- return p.indexOf(pp) === 0
- })
- if (pkgs.length > 1) return cb(null, pkgs)
- var uri = url.resolve(npm.config.get("registry"), pkgs[0])
- registry.get(uri, null, function (er, d) {
+ npm.commands.whoami([], true, function (er, username) {
+ if (er) return cb()
+
+ var un = encodeURIComponent(username)
+ if (!un) return cb()
+ var byUser = "-/by-user/" + un
+ mapToRegistry(byUser, npm.config, function (er, uri) {
if (er) return cb(er)
- var vers = Object.keys(d.versions)
- if (!vers.length) return cb(null, pkgs)
- return cb(null, vers.map(function (v) {
- return pkgs[0]+"@"+v
- }))
+
+ registry.get(uri, null, function (er, pkgs) {
+ // do a bit of filtering at this point, so that we don't need
+ // to fetch versions for more than one thing, but also don't
+ // accidentally a whole project.
+ pkgs = pkgs[un]
+ if (!pkgs || !pkgs.length) return cb()
+ var pp = npa(opts.partialWord).name
+ pkgs = pkgs.filter(function (p) {
+ return p.indexOf(pp) === 0
+ })
+ if (pkgs.length > 1) return cb(null, pkgs)
+ mapToRegistry(pkgs[0], npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.get(uri, null, function (er, d) {
+ if (er) return cb(er)
+ var vers = Object.keys(d.versions)
+ if (!vers.length) return cb(null, pkgs)
+ return cb(null, vers.map(function (v) {
+ return pkgs[0] + "@" + v
+ }))
+ })
+ })
+ })
})
})
}
@@ -42,23 +53,25 @@ unpublish.completion = function (opts, cb) {
function unpublish (args, cb) {
if (args.length > 1) return cb(unpublish.usage)
- var thing = args.length ? args.shift().split("@") : []
- , project = thing.shift()
- , version = thing.join("@")
+ var thing = args.length ? npa(args[0]) : {}
+ , project = thing.name
+ , version = thing.rawSpec
+ log.silly("unpublish", "args[0]", args[0])
+ log.silly("unpublish", "thing", thing)
if (!version && !npm.config.get("force")) {
return cb("Refusing to delete entire project.\n"
- +"Run with --force to do this.\n"
- +unpublish.usage)
+ + "Run with --force to do this.\n"
+ + unpublish.usage)
}
- if (!project || path.resolve(project) === npm.prefix) {
+ if (!project || path.resolve(project) === npm.localPrefix) {
// if there's a package.json in the current folder, then
// read the package name and version out of that.
- var cwdJson = path.join(process.cwd(), "package.json")
+ var cwdJson = path.join(npm.localPrefix, "package.json")
return readJson(cwdJson, function (er, data) {
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
- if (er) return cb("Usage:\n"+unpublish.usage)
+ if (er) return cb("Usage:\n" + unpublish.usage)
gotProject(data.name, data.version, cb)
})
}
@@ -79,7 +92,10 @@ function gotProject (project, version, cb_) {
return cb(er)
}
- var uri = url.resolve(npm.config.get("registry"), project)
- registry.unpublish(uri, version, cb)
+ mapToRegistry(project, npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.unpublish(uri, version, cb)
+ })
})
}
diff --git a/deps/npm/lib/utils/error-handler.js b/deps/npm/lib/utils/error-handler.js
index 5c4f4c99e8036205672310cf56d5ec37766394ba..788d3f8ccc9bf0d6f1dd4f306d5d6e546bd9b8bc 100644
--- a/deps/npm/lib/utils/error-handler.js
+++ b/deps/npm/lib/utils/error-handler.js
@@ -24,13 +24,18 @@ process.on("exit", function (code) {
}
if (wroteLogFile) {
- log.error("", [""
- ,"Additional logging details can be found in:"
+ // just a line break
+ if (log.levels[log.level] <= log.levels.error) console.error("")
+
+ log.error("",
+ ["Please include the following file with any support request:"
," " + path.resolve("npm-debug.log")
].join("\n"))
wroteLogFile = false
}
- log.error("not ok", "code", code)
+ if (code) {
+ log.error("code", code)
+ }
}
var doExit = npm.config.get("_exit")
@@ -87,7 +92,6 @@ function exit (code, noLog) {
function errorHandler (er) {
- var printStack = false
// console.error("errorHandler", er)
if (!npm.config || !npm.config.loaded) {
// logging won't work unless we pretend that it's ready
@@ -112,13 +116,55 @@ function errorHandler (er) {
var m = er.code || er.message.match(/^(?:Error: )?(E[A-Z]+)/)
if (m && !er.code) er.code = m
+ ; [ "type"
+ , "fstream_path"
+ , "fstream_unc_path"
+ , "fstream_type"
+ , "fstream_class"
+ , "fstream_finish_call"
+ , "fstream_linkpath"
+ , "stack"
+ , "fstream_stack"
+ , "statusCode"
+ , "pkgid"
+ ].forEach(function (k) {
+ var v = er[k]
+ if (!v) return
+ if (k === "fstream_stack") v = v.join("\n")
+ log.verbose(k, v)
+ })
+
+ log.verbose("cwd", process.cwd())
+
+ var os = require("os")
+ // log.error("System", os.type() + " " + os.release())
+ // log.error("command", process.argv.map(JSON.stringify).join(" "))
+ // log.error("node -v", process.version)
+ // log.error("npm -v", npm.version)
+ log.error("", os.type() + " " + os.release())
+ log.error("argv", process.argv.map(JSON.stringify).join(" "))
+ log.error("node", process.version)
+ log.error("npm ", "v" + npm.version)
+
+ ; [ "file"
+ , "path"
+ , "code"
+ , "errno"
+ , "syscall"
+ ].forEach(function (k) {
+ var v = er[k]
+ if (v) log.error(k, v)
+ })
+
+ // just a line break
+ if (log.levels[log.level] <= log.levels.error) console.error("")
+
switch (er.code) {
case "ECONNREFUSED":
log.error("", er)
log.error("", ["\nIf you are behind a proxy, please make sure that the"
,"'proxy' config is set properly. See: 'npm help config'"
].join("\n"))
- printStack = true
break
case "EACCES":
@@ -126,7 +172,6 @@ function errorHandler (er) {
log.error("", er)
log.error("", ["\nPlease try running this command again as root/Administrator."
].join("\n"))
- printStack = true
break
case "ELIFECYCLE":
@@ -160,24 +205,22 @@ function errorHandler (er) {
].join("\n"), "JSON.parse")
break
+ // TODO(isaacs)
+ // Add a special case here for E401 and E403 explaining auth issues?
+
case "E404":
var msg = [er.message]
if (er.pkgid && er.pkgid !== "-") {
msg.push("", "'"+er.pkgid+"' is not in the npm registry."
- ,"You should bug the author to publish it")
+ ,"You should bug the author to publish it (or use the name yourself!)")
if (er.parent) {
msg.push("It was specified as a dependency of '"+er.parent+"'")
}
- if (er.pkgid.match(/^node[\.\-]|[\.\-]js$/)) {
- var s = er.pkgid.replace(/^node[\.\-]|[\.\-]js$/g, "")
- if (s !== er.pkgid) {
- s = s.replace(/[^a-z0-9]/g, ' ')
- msg.push("\nMaybe try 'npm search " + s + "'")
- }
- }
msg.push("\nNote that you can also install from a"
- ,"tarball, folder, or http url, or git url.")
+ ,"tarball, folder, http url, or git url.")
}
+ // There's no need to have 404 in the message as well.
+ msg[0] = msg[0].replace(/^404\s+/, "")
log.error("404", msg.join("\n"))
break
@@ -185,9 +228,6 @@ function errorHandler (er) {
log.error("publish fail", ["Cannot publish over existing version."
,"Update the 'version' field in package.json and try again."
,""
- ,"If the previous version was published in error, see:"
- ," npm help unpublish"
- ,""
,"To automatically increment version numbers, see:"
," npm help version"
].join("\n"))
@@ -295,50 +335,13 @@ function errorHandler (er) {
break
default:
- log.error("", er.stack || er.message || er)
- log.error("", ["If you need help, you may report this *entire* log,"
- ,"including the npm and node versions, at:"
+ log.error("", er.message || er)
+ log.error("", ["", "If you need help, you may report this error at:"
," "
].join("\n"))
- printStack = false
break
}
- var os = require("os")
- // just a line break
- if (log.levels[log.level] <= log.levels.error) console.error("")
- log.error("System", os.type() + " " + os.release())
- log.error("command", process.argv
- .map(JSON.stringify).join(" "))
- log.error("cwd", process.cwd())
- log.error("node -v", process.version)
- log.error("npm -v", npm.version)
-
- ; [ "file"
- , "path"
- , "type"
- , "syscall"
- , "fstream_path"
- , "fstream_unc_path"
- , "fstream_type"
- , "fstream_class"
- , "fstream_finish_call"
- , "fstream_linkpath"
- , "code"
- , "errno"
- , "stack"
- , "fstream_stack"
- ].forEach(function (k) {
- var v = er[k]
- if (k === "stack") {
- if (!printStack) return
- if (!v) v = er.message
- }
- if (!v) return
- if (k === "fstream_stack") v = v.join("\n")
- log.error(k, v)
- })
-
exit(typeof er.errno === "number" ? er.errno : 1)
}
@@ -350,17 +353,16 @@ function writeLogFile (cb) {
var fs = require("graceful-fs")
, fstr = fs.createWriteStream("npm-debug.log")
- , util = require("util")
, os = require("os")
, out = ""
log.record.forEach(function (m) {
var pref = [m.id, m.level]
if (m.prefix) pref.push(m.prefix)
- pref = pref.join(' ')
+ pref = pref.join(" ")
m.message.trim().split(/\r?\n/).map(function (line) {
- return (pref + ' ' + line).trim()
+ return (pref + " " + line).trim()
}).forEach(function (line) {
out += line + os.EOL
})
diff --git a/deps/npm/lib/utils/fetch.js b/deps/npm/lib/utils/fetch.js
deleted file mode 100644
index f6e5166ff5f66628615a4e442861439f295a786d..0000000000000000000000000000000000000000
--- a/deps/npm/lib/utils/fetch.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * Fetch an HTTP url to a local file.
- **/
-
-var request = require("request")
- , fs = require("graceful-fs")
- , npm = require("../npm.js")
- , url = require("url")
- , log = require("npmlog")
- , path = require("path")
- , mkdir = require("mkdirp")
- , chownr = require("chownr")
- , regHost
- , once = require("once")
- , crypto = require("crypto")
-
-module.exports = fetch
-
-function fetch (remote, local, headers, cb) {
- if (typeof cb !== "function") cb = headers, headers = {}
- cb = once(cb)
- log.verbose("fetch", "to=", local)
- mkdir(path.dirname(local), function (er, made) {
- if (er) return cb(er)
- fetch_(remote, local, headers, cb)
- })
-}
-
-function fetch_ (remote, local, headers, cb) {
- var fstr = fs.createWriteStream(local, { mode : npm.modes.file })
- var response = null
-
- fstr.on("error", function (er) {
- cb(er)
- fstr.destroy()
- })
-
- var req = makeRequest(remote, fstr, headers)
- req.on("response", function (res) {
- log.http(res.statusCode, remote)
- response = res
- response.resume()
- // Work around bug in node v0.10.0 where the CryptoStream
- // gets stuck and never starts reading again.
- if (process.version === "v0.10.0") {
- response.resume = function (orig) { return function() {
- var ret = orig.apply(response, arguments)
- if (response.socket.encrypted)
- response.socket.encrypted.read(0)
- return ret
- }}(response.resume)
- }
- })
-
- fstr.on("close", function () {
- var er
- if (response && response.statusCode && response.statusCode >= 400) {
- er = new Error(response.statusCode + " "
- + require("http").STATUS_CODES[response.statusCode])
- }
- cb(er, response)
- })
-}
-
-function makeRequest (remote, fstr, headers) {
- remote = url.parse(remote)
- log.http("GET", remote.href)
- regHost = regHost || url.parse(npm.config.get("registry")).host
-
- if (remote.host === regHost && npm.config.get("always-auth")) {
- remote.auth = new Buffer( npm.config.get("_auth")
- , "base64" ).toString("utf8")
- if (!remote.auth) return fstr.emit("error", new Error(
- "Auth required and none provided. Please run 'npm adduser'"))
- }
-
- var proxy
- if (remote.protocol !== "https:" || !(proxy = npm.config.get("https-proxy"))) {
- proxy = npm.config.get("proxy")
- }
-
- var sessionToken = npm.registry.sessionToken
- if (!sessionToken) {
- sessionToken = crypto.randomBytes(8).toString("hex")
- npm.registry.sessionToken = sessionToken
- }
-
- var ca = remote.host === regHost ? npm.config.get("ca") : undefined
- var opts = { url: remote
- , proxy: proxy
- , strictSSL: npm.config.get("strict-ssl")
- , rejectUnauthorized: npm.config.get("strict-ssl")
- , ca: ca
- , headers:
- { "user-agent": npm.config.get("user-agent")
- , "npm-session": sessionToken
- , referer: npm.registry.refer
- }
- }
- var req = request(opts)
- req.on("error", function (er) {
- fstr.emit("error", er)
- })
- req.pipe(fstr)
- return req
-}
diff --git a/deps/npm/lib/utils/gently-rm.js b/deps/npm/lib/utils/gently-rm.js
index 241740fed6a90ac804255191e6d0c5ce859f103f..d43d0725ebb2d84a55178a068ba848e914ac2740 100644
--- a/deps/npm/lib/utils/gently-rm.js
+++ b/deps/npm/lib/utils/gently-rm.js
@@ -3,54 +3,159 @@
module.exports = gentlyRm
-var rimraf = require("rimraf")
- , fs = require("graceful-fs")
- , npm = require("../npm.js")
- , path = require("path")
+var npm = require("../npm.js")
+ , log = require("npmlog")
+ , resolve = require("path").resolve
+ , dirname = require("path").dirname
+ , lstat = require("graceful-fs").lstat
+ , readlink = require("graceful-fs").readlink
+ , isInside = require("path-is-inside")
+ , vacuum = require("fs-vacuum")
+ , rimraf = require("rimraf")
+ , some = require("async-some")
-function gentlyRm (p, gently, cb) {
- if (!cb) cb = gently, gently = null
+function gentlyRm (path, gently, cb) {
+ if (!cb) {
+ cb = gently
+ gently = null
+ }
// never rm the root, prefix, or bin dirs.
// just a safety precaution.
- p = path.resolve(p)
- if (p === npm.dir ||
- p === npm.root ||
- p === npm.bin ||
- p === npm.prefix ||
- p === npm.globalDir ||
- p === npm.globalRoot ||
- p === npm.globalBin ||
- p === npm.globalPrefix) {
- return cb(new Error("May not delete: " + p))
+ var prefixes = [
+ npm.dir, npm.root, npm.bin, npm.prefix,
+ npm.globalDir, npm.globalRoot, npm.globalBin, npm.globalPrefix
+ ]
+
+ var resolved = resolve(path)
+ if (prefixes.indexOf(resolved) !== -1) {
+ log.verbose("gentlyRm", resolved, "is part of npm and can't be removed")
+ return cb(new Error("May not delete: "+resolved))
}
- if (npm.config.get("force") || !gently) {
- return rimraf(p, cb)
+ var options = {log : log.silly.bind(log, "gentlyRm")}
+ if (npm.config.get("force") || !gently) options.purge = true
+
+ if (!gently) {
+ log.verbose("gentlyRm", "vacuuming", resolved)
+ return vacuum(resolved, options, cb)
}
- gently = path.resolve(gently)
+ var parent = resolve(gently)
+ log.verbose("gentlyRm", "verifying that", parent, "is managed by npm")
+ some(prefixes, isManaged(parent), function (er, matched) {
+ if (er) return cb(er)
+
+ if (!matched) {
+ log.verbose("gentlyRm", parent, "is not managed by npm")
+ return clobberFail(resolved, parent, cb)
+ }
+
+ log.silly("gentlyRm", parent, "is managed by npm")
+
+ if (isInside(resolved, parent)) {
+ log.silly("gentlyRm", resolved, "is under", parent)
+ log.verbose("gentlyRm", "vacuuming", resolved, "up to", parent)
+ options.base = parent
+ return vacuum(resolved, options, cb)
+ }
+
+ log.silly("gentlyRm", resolved, "is not under", parent)
+ log.silly("gentlyRm", "checking to see if", resolved, "is a link")
+ lstat(resolved, function (er, stat) {
+ if (er) {
+ if (er.code === "ENOENT") return cb(null)
+ return cb(er)
+ }
+
+ if (!stat.isSymbolicLink()) {
+ log.verbose("gentlyRm", resolved, "is outside", parent, "and not a link")
+ return clobberFail(resolved, parent, cb)
+ }
+
+ log.silly("gentlyRm", resolved, "is a link")
+ readlink(resolved, function (er, link) {
+ if (er) {
+ if (er.code === "ENOENT") return cb(null)
+ return cb(er)
+ }
- // lstat it, see if it's a symlink.
- fs.lstat(p, function (er, s) {
- if (er) return rimraf(p, cb)
- if (!s.isSymbolicLink()) next(null, path.resolve(p))
- realish(p, next)
+ var source = resolve(dirname(resolved), link)
+ if (isInside(source, parent)) {
+ log.silly("gentlyRm", source, "inside", parent)
+ log.verbose("gentlyRm", "vacuuming", resolved)
+ return vacuum(resolved, options, cb)
+ }
+
+ log.silly("gentlyRm", "checking to see if", source, "is managed by npm")
+ some(prefixes, isManaged(source), function (er, matched) {
+ if (er) return cb(er)
+
+ if (matched) {
+ log.silly("gentlyRm", source, "is under", matched)
+ log.verbose("gentlyRm", "removing", resolved)
+ rimraf(resolved, cb)
+ }
+
+ log.verbose("gentlyRm", source, "is not managed by npm")
+ return clobberFail(path, parent, cb)
+ })
+ })
+ })
})
+}
- function next (er, rp) {
- if (rp && rp.indexOf(gently) !== 0) {
- return clobberFail(p, gently, cb)
+var resolvedPaths = {}
+function isManaged (target) {
+ return predicate
+
+ function predicate (path, cb) {
+ if (!path) {
+ log.verbose("isManaged", "no path")
+ return cb(null, false)
+ }
+
+ path = resolve(path)
+
+ // if the path has already been memoized, return immediately
+ var resolved = resolvedPaths[path]
+ if (resolved) {
+ var inside = isInside(target, resolved)
+ log.silly("isManaged", target, inside ? "is" : "is not", "inside", resolved)
+
+ return cb(null, inside && path)
}
- rimraf(p, cb)
+
+ // otherwise, check the path
+ lstat(path, function (er, stat) {
+ if (er) {
+ if (er.code === "ENOENT") return cb(null, false)
+
+ return cb(er)
+ }
+
+ // if it's not a link, cache & test the path itself
+ if (!stat.isSymbolicLink()) return cacheAndTest(path, path, target, cb)
+
+ // otherwise, cache & test the link's source
+ readlink(path, function (er, source) {
+ if (er) {
+ if (er.code === "ENOENT") return cb(null, false)
+
+ return cb(er)
+ }
+
+ cacheAndTest(resolve(path, source), path, target, cb)
+ })
+ })
}
-}
-function realish (p, cb) {
- fs.readlink(p, function (er, r) {
- if (er) return cb(er)
- return cb(null, path.resolve(path.dirname(p), r))
- })
+ function cacheAndTest (resolved, source, target, cb) {
+ resolvedPaths[source] = resolved
+ var inside = isInside(target, resolved)
+ log.silly("cacheAndTest", target, inside ? "is" : "is not", "inside", resolved)
+ cb(null, inside && source)
+ }
}
function clobberFail (p, g, cb) {
diff --git a/deps/npm/lib/utils/is-git-url.js b/deps/npm/lib/utils/is-git-url.js
deleted file mode 100644
index 7ded4b602a20fae98b3c77b5e94c2db3982e59d0..0000000000000000000000000000000000000000
--- a/deps/npm/lib/utils/is-git-url.js
+++ /dev/null
@@ -1,13 +0,0 @@
-module.exports = isGitUrl
-
-function isGitUrl (url) {
- switch (url.protocol) {
- case "git:":
- case "git+http:":
- case "git+https:":
- case "git+rsync:":
- case "git+ftp:":
- case "git+ssh:":
- return true
- }
-}
diff --git a/deps/npm/lib/utils/lifecycle.js b/deps/npm/lib/utils/lifecycle.js
index 8bcb99689f42448ce079b7c60a902f95ddb71eb2..c0eb83dfb1d524be1dba470e02d22585d65905a6 100644
--- a/deps/npm/lib/utils/lifecycle.js
+++ b/deps/npm/lib/utils/lifecycle.js
@@ -71,11 +71,6 @@ function lifecycle_ (pkg, stage, wd, env, unsafe, failOk, cb) {
, p = wd.split("node_modules")
, acc = path.resolve(p.shift())
- // first add the directory containing the `node` executable currently
- // running, so that any lifecycle script that invoke "node" will execute
- // this same one.
- pathArr.unshift(path.dirname(process.execPath))
-
p.forEach(function (pp) {
pathArr.unshift(path.join(acc, "node_modules", ".bin"))
acc = path.join(acc, "node_modules", pp)
@@ -353,13 +348,9 @@ function makeEnv (data, prefix, env) {
function cmd (stage) {
function CMD (args, cb) {
- if (args.length) {
- chain(args.map(function (p) {
- return [npm.commands, "run-script", [p, stage]]
- }), cb)
- } else npm.commands["run-script"]([stage], cb)
+ npm.commands["run-script"]([stage].concat(args), cb)
}
- CMD.usage = "npm "+stage+" "
+ CMD.usage = "npm "+stage+" [-- ]"
var installedShallow = require("./completion/installed-shallow.js")
CMD.completion = function (opts, cb) {
installedShallow(opts, function (d) {
diff --git a/deps/npm/lib/utils/map-to-registry.js b/deps/npm/lib/utils/map-to-registry.js
new file mode 100644
index 0000000000000000000000000000000000000000..cf665e4f656087422c46c52c7eb179c3e225781e
--- /dev/null
+++ b/deps/npm/lib/utils/map-to-registry.js
@@ -0,0 +1,54 @@
+var url = require("url")
+
+var log = require("npmlog")
+ , npa = require("npm-package-arg")
+
+module.exports = mapToRegistry
+
+function mapToRegistry(name, config, cb) {
+ var uri
+ var scopedRegistry
+
+ // the name itself takes precedence
+ var data = npa(name)
+ if (data.scope) {
+ // the name is definitely scoped, so escape now
+ name = name.replace("/", "%2f")
+
+ log.silly("mapToRegistry", "scope", data.scope)
+
+ scopedRegistry = config.get(data.scope + ":registry")
+ if (scopedRegistry) {
+ log.silly("mapToRegistry", "scopedRegistry (scoped package)", scopedRegistry)
+ uri = url.resolve(scopedRegistry, name)
+ }
+ else {
+ log.verbose("mapToRegistry", "no registry URL found for scope", data.scope)
+ }
+ }
+
+ // ...then --scope=@scope or --scope=scope
+ var scope = config.get("scope")
+ if (!uri && scope) {
+ // I'm an enabler, sorry
+ if (scope.charAt(0) !== "@") scope = "@" + scope
+
+ scopedRegistry = config.get(scope + ":registry")
+ if (scopedRegistry) {
+ log.silly("mapToRegistry", "scopedRegistry (scope in config)", scopedRegistry)
+ uri = url.resolve(scopedRegistry, name)
+ }
+ else {
+ log.verbose("mapToRegistry", "no registry URL found for scope", scope)
+ }
+ }
+
+ // ...and finally use the default registry
+ if (!uri) {
+ uri = url.resolve(config.get("registry"), name)
+ }
+
+ log.verbose("mapToRegistry", "name", name)
+ log.verbose("mapToRegistry", "uri", uri)
+ cb(null, uri)
+}
diff --git a/deps/npm/lib/version.js b/deps/npm/lib/version.js
index 95d5ff2ee2badb6b79b5b42020e4f400f8d847cf..5091ab9e2dfcb2b52f1c8832d7a182cf7502a318 100644
--- a/deps/npm/lib/version.js
+++ b/deps/npm/lib/version.js
@@ -23,7 +23,7 @@ version.usage = "npm version [ | major | minor | patch | prerelease
function version (args, silent, cb_) {
if (typeof cb_ !== "function") cb_ = silent, silent = false
if (args.length > 1) return cb_(version.usage)
- fs.readFile(path.join(process.cwd(), "package.json"), function (er, data) {
+ fs.readFile(path.join(npm.localPrefix, "package.json"), function (er, data) {
if (!args.length) {
var v = {}
Object.keys(process.versions).forEach(function (k) {
@@ -63,7 +63,7 @@ function version (args, silent, cb_) {
if (data.version === newVer) return cb_(new Error("Version not changed"))
data.version = newVer
- fs.stat(path.join(process.cwd(), ".git"), function (er, s) {
+ fs.stat(path.join(npm.localPrefix, ".git"), function (er, s) {
function cb (er) {
if (!er && !silent) console.log("v" + newVer)
cb_(er)
@@ -111,7 +111,7 @@ function checkGit (data, cb) {
}
function write (data, cb) {
- fs.writeFile( path.join(process.cwd(), "package.json")
+ fs.writeFile( path.join(npm.localPrefix, "package.json")
, new Buffer(JSON.stringify(data, null, 2) + "\n")
, cb )
}
diff --git a/deps/npm/lib/view.js b/deps/npm/lib/view.js
index 33bf550dd9fc9f6997c16ad142724d012b0e0457..43d09cbbccfe420ef434406b08067143a138f1b6 100644
--- a/deps/npm/lib/view.js
+++ b/deps/npm/lib/view.js
@@ -4,21 +4,26 @@ module.exports = view
view.usage = "npm view pkg[@version] [[.subfield]...]"
view.completion = function (opts, cb) {
- var uri
if (opts.conf.argv.remain.length <= 2) {
- uri = url.resolve(npm.config.get("registry"), "-/short")
- return registry.get(uri, null, cb)
+ return mapToRegistry("-/short", npm.config, function (er, uri) {
+ if (er) return cb(er)
+
+ registry.get(uri, null, cb)
+ })
}
// have the package, get the fields.
var tag = npm.config.get("tag")
- uri = url.resolve(npm.config.get("registry"), opts.conf.argv.remain[2])
- registry.get(uri, null, function (er, d) {
+ mapToRegistry(opts.conf.argv.remain[2], npm.config, function (er, uri) {
if (er) return cb(er)
- var dv = d.versions[d["dist-tags"][tag]]
- , fields = []
- d.versions = Object.keys(d.versions).sort(semver.compareLoose)
- fields = getFields(d).concat(getFields(dv))
- cb(null, fields)
+
+ registry.get(uri, null, function (er, d) {
+ if (er) return cb(er)
+ var dv = d.versions[d["dist-tags"][tag]]
+ , fields = []
+ d.versions = Object.keys(d.versions).sort(semver.compareLoose)
+ fields = getFields(d).concat(getFields(dv))
+ cb(null, fields)
+ })
})
function getFields (d, f, pref) {
@@ -42,71 +47,75 @@ view.completion = function (opts, cb) {
}
}
-var url = require("url")
- , npm = require("./npm.js")
+var npm = require("./npm.js")
, registry = npm.registry
, log = require("npmlog")
, util = require("util")
, semver = require("semver")
+ , mapToRegistry = require("./utils/map-to-registry.js")
+ , npa = require("npm-package-arg")
function view (args, silent, cb) {
if (typeof cb !== "function") cb = silent, silent = false
if (!args.length) return cb("Usage: "+view.usage)
var pkg = args.shift()
- , nv = pkg.split("@")
- , name = nv.shift()
- , version = nv.join("@") || npm.config.get("tag")
+ , nv = npa(pkg)
+ , name = nv.name
+ , version = nv.rawSpec || npm.config.get("tag")
if (name === ".") return cb(view.usage)
// get the data about this package
- var uri = url.resolve(npm.config.get("registry"), name)
- registry.get(uri, null, function (er, data) {
+ mapToRegistry(name, npm.config, function (er, uri) {
if (er) return cb(er)
- if (data["dist-tags"] && data["dist-tags"].hasOwnProperty(version)) {
- version = data["dist-tags"][version]
- }
- if (data.time && data.time.unpublished) {
- var u = data.time.unpublished
- er = new Error("Unpublished by " + u.name + " on " + u.time)
- er.statusCode = 404
- er.code = "E404"
- er.pkgid = data._id
- return cb(er, data)
- }
+ registry.get(uri, null, function (er, data) {
+ if (er) return cb(er)
+ if (data["dist-tags"] && data["dist-tags"].hasOwnProperty(version)) {
+ version = data["dist-tags"][version]
+ }
+ if (data.time && data.time.unpublished) {
+ var u = data.time.unpublished
+ er = new Error("Unpublished by " + u.name + " on " + u.time)
+ er.statusCode = 404
+ er.code = "E404"
+ er.pkgid = data._id
+ return cb(er, data)
+ }
- var results = []
- , error = null
- , versions = data.versions || {}
- data.versions = Object.keys(versions).sort(semver.compareLoose)
- if (!args.length) args = [""]
- // remove readme unless we asked for it
- if (-1 === args.indexOf("readme")) {
- delete data.readme
- }
+ var results = []
+ , error = null
+ , versions = data.versions || {}
+ data.versions = Object.keys(versions).sort(semver.compareLoose)
+ if (!args.length) args = [""]
+
+ // remove readme unless we asked for it
+ if (-1 === args.indexOf("readme")) {
+ delete data.readme
+ }
- Object.keys(versions).forEach(function (v) {
- if (semver.satisfies(v, version, true)) args.forEach(function (args) {
- // remove readme unless we asked for it
- if (-1 === args.indexOf("readme")) {
- delete versions[v].readme
- }
- results.push(showFields(data, versions[v], args))
+ Object.keys(versions).forEach(function (v) {
+ if (semver.satisfies(v, version, true)) args.forEach(function (args) {
+ // remove readme unless we asked for it
+ if (-1 === args.indexOf("readme")) {
+ delete versions[v].readme
+ }
+ results.push(showFields(data, versions[v], args))
+ })
})
- })
- results = results.reduce(reducer, {})
- var retval = results
+ results = results.reduce(reducer, {})
+ var retval = results
- if (args.length === 1 && args[0] === "") {
- retval = cleanBlanks(retval)
- log.silly("cleanup", retval)
- }
+ if (args.length === 1 && args[0] === "") {
+ retval = cleanBlanks(retval)
+ log.silly("cleanup", retval)
+ }
- if (error || silent) cb(error, retval)
- else printData(results, data._id, cb.bind(null, error, retval))
+ if (error || silent) cb(error, retval)
+ else printData(results, data._id, cb.bind(null, error, retval))
+ })
})
}
diff --git a/deps/npm/lib/whoami.js b/deps/npm/lib/whoami.js
index f1c67e2b0df9776ed21580afd6a8508f713cef98..b33f93743d2bb4b32748a7c1f6db3ccc0510420c 100644
--- a/deps/npm/lib/whoami.js
+++ b/deps/npm/lib/whoami.js
@@ -1,13 +1,39 @@
-module.exports = whoami
-
var npm = require("./npm.js")
-whoami.usage = "npm whoami\n(just prints the 'username' config)"
+module.exports = whoami
+
+whoami.usage = "npm whoami\n(just prints username according to given registry)"
function whoami (args, silent, cb) {
- if (typeof cb !== "function") cb = silent, silent = false
- var me = npm.config.get("username")
- var msg = me ? me : "Not authed. Run 'npm adduser'"
+ // FIXME: need tighter checking on this, but is a breaking change
+ if (typeof cb !== "function") {
+ cb = silent
+ silent = false
+ }
+
+ var registry = npm.config.get("registry")
+ if (!registry) return cb(new Error("no default registry set"))
+
+ var credentials = npm.config.getCredentialsByURI(registry)
+ if (credentials) {
+ if (credentials.username) {
+ if (!silent) console.log(credentials.username)
+ return process.nextTick(cb.bind(this, null, credentials.username))
+ }
+ else if (credentials.token) {
+ return npm.registry.whoami(registry, function (er, username) {
+ if (er) return cb(er)
+
+ if (!silent) console.log(username)
+ cb(null, username)
+ })
+ }
+ }
+
+ // At this point, if they have a credentials object, it doesn't
+ // have a token or auth in it. Probably just the default
+ // registry.
+ var msg = "Not authed. Run 'npm adduser'"
if (!silent) console.log(msg)
- process.nextTick(cb.bind(this, null, me))
+ process.nextTick(cb.bind(this, null, msg))
}
diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1
index cfa8b459836c943b12797e073e484c075453f503..8f7d01ba7a1e48bfadb5e4aa082956008641fac9 100644
--- a/deps/npm/man/man1/npm-README.1
+++ b/deps/npm/man/man1/npm-README.1
@@ -1,221 +1,177 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm\fR \-\- node package manager then read on\.
-.
-.SH "Fancy Install (Unix)"
-There\'s a pretty robust install script at \fIhttps://www\.npmjs\.org/install\.sh\fR\|\. You can download that and run it\.
-.
-.P
-Here\'s an example using curl:
-.
-.IP "" 4
-.
-.nf
+.SH Fancy Install (Unix)
+.P
+There's a pretty robust install script at
+https://www\.npmjs\.org/install\.sh\|\. You can download that and run it\.
+.P
+Here's an example using curl:
+.P
+.RS 2
+.EX
curl \-L https://npmjs\.org/install\.sh | sh
-.
-.fi
-.
-.IP "" 0
-.
-.SS "Slightly Fancier"
+.EE
+.RE
+.SS Slightly Fancier
+.P
You can set any npm configuration params with that script:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
npm_config_prefix=/some/path sh install\.sh
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
Or, you can run it in uber\-debuggery mode:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
npm_debug=1 sh install\.sh
-.
-.fi
-.
-.IP "" 0
-.
-.SS "Even Fancier"
+.EE
+.RE
+.SS Even Fancier
+.P
Get the code with git\. Use \fBmake\fR to build the docs and do other stuff\.
If you plan on hacking on npm, \fBmake link\fR is your friend\.
-.
.P
-If you\'ve got the npm source code, you can also semi\-permanently set
+If you've got the npm source code, you can also semi\-permanently set
arbitrary config keys using the \fB\|\./configure \-\-key=val \.\.\.\fR, and then
run npm commands by doing \fBnode cli\.js \fR\|\. (This is helpful
for testing, or running stuff without actually installing npm itself\.)
-.
-.SH "Fancy Windows Install"
-You can download a zip file from \fIhttps://npmjs\.org/dist/\fR, and unpack it
+.SH Fancy Windows Install
+.P
+You can download a zip file from https://npmjs\.org/dist/, and unpack it
in the same folder where node\.exe lives\.
-.
.P
-If that\'s not fancy enough for you, then you can fetch the code with
+If that's not fancy enough for you, then you can fetch the code with
git, and mess with it directly\.
-.
-.SH "Installing on Cygwin"
+.SH Installing on Cygwin
+.P
No\.
-.
-.SH "Permissions when Using npm to Install Other Stuff"
+.SH Permissions when Using npm to Install Other Stuff
+.P
\fBtl;dr\fR
-.
-.IP "\(bu" 4
-Use \fBsudo\fR for greater safety\. Or don\'t, if you prefer not to\.
-.
-.IP "\(bu" 4
-npm will downgrade permissions if it\'s root before running any build
+.RS 0
+.IP \(bu 2
+Use \fBsudo\fR for greater safety\. Or don't, if you prefer not to\.
+.IP \(bu 2
+npm will downgrade permissions if it's root before running any build
scripts that package authors specified\.
-.
-.IP "" 0
-.
-.SS "More details\.\.\."
+
+.RE
+.SS More details\.\.\.
+.P
As of version 0\.3, it is recommended to run npm as root\.
This allows npm to change the user identifier to the \fBnobody\fR user prior
to running any package build or test commands\.
-.
.P
If you are not the root user, or if you are on a platform that does not
support uid switching, then npm will not attempt to change the userid\.
-.
.P
If you would like to ensure that npm \fBalways\fR runs scripts as the
"nobody" user, and have it fail if it cannot downgrade permissions, then
set the following configuration param:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
npm config set unsafe\-perm false
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
This will prevent running in unsafe mode, even as non\-root users\.
-.
-.SH "Uninstalling"
+.SH Uninstalling
+.P
So sad to see you go\.
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
sudo npm uninstall npm \-g
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
Or, if that fails,
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
sudo make uninstall
-.
-.fi
-.
-.IP "" 0
-.
-.SH "More Severe Uninstalling"
+.EE
+.RE
+.SH More Severe Uninstalling
+.P
Usually, the above instructions are sufficient\. That will remove
-npm, but leave behind anything you\'ve installed\.
-.
+npm, but leave behind anything you've installed\.
.P
If you would like to remove all the packages that you have installed,
then you can use the \fBnpm ls\fR command to find them, and then \fBnpm rm\fR to
remove them\.
-.
.P
-To remove cruft left behind by npm 0\.x, you can use the included \fBclean\-old\.sh\fR script file\. You can run it conveniently like this:
-.
-.IP "" 4
-.
-.nf
+To remove cruft left behind by npm 0\.x, you can use the included
+\fBclean\-old\.sh\fR script file\. You can run it conveniently like this:
+.P
+.RS 2
+.EX
npm explore npm \-g \-\- sh scripts/clean\-old\.sh
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
npm uses two configuration files, one for per\-user configs, and another
for global (every\-user) configs\. You can view them by doing:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
npm config get userconfig # defaults to ~/\.npmrc
npm config get globalconfig # defaults to /usr/local/etc/npmrc
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
Uninstalling npm does not remove configuration files by default\. You
must remove them yourself manually if you want them gone\. Note that
this means that future npm installs will not remember the settings that
you have chosen\.
-.
-.SH "Using npm Programmatically"
+.SH Using npm Programmatically
+.P
If you would like to use npm programmatically, you can do that\.
-It\'s not very well documented, but it \fIis\fR rather simple\.
-.
+It's not very well documented, but it \fIis\fR rather simple\.
.P
Most of the time, unless you actually want to do all the things that
-npm does, you should try using one of npm\'s dependencies rather than
+npm does, you should try using one of npm's dependencies rather than
using npm itself, if possible\.
-.
.P
Eventually, npm will be just a thin cli wrapper around the modules
that it depends on, but for now, there are some things that you must
use npm itself to do\.
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
var npm = require("npm")
npm\.load(myConfigObject, function (er) {
if (er) return handlError(er)
@@ -225,117 +181,98 @@ npm\.load(myConfigObject, function (er) {
})
npm\.on("log", function (message) { \.\.\.\. })
})
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
The \fBload\fR function takes an object hash of the command\-line configs\.
The various \fBnpm\.commands\.\fR functions take an \fBarray\fR of
-positional argument \fBstrings\fR\|\. The last argument to any \fBnpm\.commands\.\fR function is a callback\. Some commands take other
+positional argument \fBstrings\fR\|\. The last argument to any
+\fBnpm\.commands\.\fR function is a callback\. Some commands take other
optional arguments\. Read the source\.
-.
.P
You cannot set configs individually for any single npm function at this
time\. Since \fBnpm\fR is a singleton, any call to \fBnpm\.config\.set\fR will
change the value for \fIall\fR npm commands in that process\.
-.
.P
See \fB\|\./bin/npm\-cli\.js\fR for an example of pulling config values off of the
command line arguments using nopt\. You may also want to check out \fBnpm
help config\fR to learn about all the options you can set there\.
-.
-.SH "More Docs"
+.SH More Docs
+.P
Check out the docs \fIhttps://www\.npmjs\.org/doc/\fR,
especially the faq \fIhttps://www\.npmjs\.org/doc/faq\.html\fR\|\.
-.
.P
You can use the \fBnpm help\fR command to read any of them\.
-.
.P
-If you\'re a developer, and you want to use npm to publish your program,
+If you're a developer, and you want to use npm to publish your program,
you should read this \fIhttps://www\.npmjs\.org/doc/developers\.html\fR
-.
-.SH "Legal Stuff"
+.SH Legal Stuff
+.P
"npm" and "The npm Registry" are owned by npm, Inc\.
All rights reserved\. See the included LICENSE file for more details\.
-.
.P
"Node\.js" and "node" are trademarks owned by Joyent, Inc\.
-.
.P
Modules published on the npm registry are not officially endorsed by
npm, Inc\. or the Node\.js project\.
-.
.P
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\.
-.
.P
If you have a complaint about a package in the public npm registry,
and cannot resolve it with the package
-owner \fIhttps://www\.npmjs\.org/doc/misc/npm\-disputes\.html\fR, please email \fIsupport@npmjs\.com\fR and explain the situation\.
-.
+owner \fIhttps://www\.npmjs\.org/doc/misc/npm\-disputes\.html\fR, please email
+support@npmjs\.com and explain the situation\.
.P
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\.
-.
-.SS "In plainer english"
+.SS In plainer english
+.P
npm is the property of npm, Inc\.
-.
.P
-If you publish something, it\'s yours, and you are solely accountable
+If you publish something, it's yours, and you are solely accountable
for it\.
-.
.P
-If other people publish something, it\'s theirs\.
-.
+If other people publish something, it's theirs\.
.P
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\.
-.
.P
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\.
-.
-.SH "BUGS"
+ban your account in extreme cases\. So don't do that\.
+.SH BUGS
+.P
When you find issues, please report them:
-.
-.IP "\(bu" 4
-web: \fIhttps://github\.com/npm/npm/issues\fR
-.
-.IP "\(bu" 4
-email: \fInpm\-@googlegroups\.com\fR
-.
-.IP "" 0
-.
-.P
-Be sure to include \fIall\fR of the output from the npm command that didn\'t work
+.RS 0
+.IP \(bu 2
+web:
+https://github\.com/npm/npm/issues
+.IP \(bu 2
+email:
+npm\-@googlegroups\.com
+
+.RE
+.P
+Be sure to include \fIall\fR of the output from the npm command that didn't work
as expected\. The \fBnpm\-debug\.log\fR file is also helpful to provide\.
-.
.P
You can also look for isaacs in #node\.js on irc://irc\.freenode\.net\. He
will no doubt tell you to put the output in a gist or email\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help npm
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 faq
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help help
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 index
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1
index da1dcdbc3f388b4cecfdb8dd1d34464d716b76f6..5db7ee28a7160240a8eed51e054c01f02a62cbd0 100644
--- a/deps/npm/man/man1/npm-adduser.1
+++ b/deps/npm/man/man1/npm-adduser.1
@@ -1,63 +1,67 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-ADDUSER" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-adduser\fR \-\- Add a registry user account
-.
-.SH "SYNOPSIS"
-.
-.nf
-npm adduser
-.
-.fi
-.
-.SH "DESCRIPTION"
-Create or verify a user named \fB\fR in the npm registry, and
-save the credentials to the \fB\|\.npmrc\fR file\.
-.
+\fBnpm-adduser\fR \- Add a registry user account
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
+npm adduser [\-\-registry=url] [\-\-scope=@orgname]
+.EE
+.RE
+.SH DESCRIPTION
+.P
+Create or verify a user named \fB\fR in the specified registry, and
+save the credentials to the \fB\|\.npmrc\fR file\. If no registry is specified,
+the default registry will be used (see npm help 7 \fBnpm\-config\fR)\.
.P
The username, password, and email are read in from prompts\.
-.
.P
You may use this command to change your email address, but not username
or password\.
-.
.P
-To reset your password, go to \fIhttps://npmjs\.org/forgot\fR
-.
+To reset your password, go to https://www\.npmjs\.org/forgot
.P
You may use this command multiple times with the same user account to
authorize on a new machine\.
-.
-.SH "CONFIGURATION"
-.
-.SS "registry"
+.P
+\fBnpm login\fR is an alias to \fBadduser\fR and behaves exactly the same way\.
+.SH CONFIGURATION
+.SS registry
+.P
Default: http://registry\.npmjs\.org/
-.
.P
-The base URL of the npm package registry\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+The base URL of the npm package registry\. If \fBscope\fR is also specified,
+this registry will only be used for packages with that scope\. See npm help 7 \fBnpm\-scope\fR\|\.
+.SS scope
+.P
+Default: none
+.P
+If specified, the user and login credentials given will be associated
+with the specified scope\. See npm help 7 \fBnpm\-scope\fR\|\. You can use both at the same time,
+e\.g\.
+.P
+.RS 2
+.EX
+npm adduser \-\-registry=http://myregistry\.example\.com \-\-scope=@myco
+.EE
+.RE
+.P
+This will set a registry for the given scope and login or create a user for
+that registry at the same time\.
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help 7 registry
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help owner
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help whoami
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1
index 548bb6ad347d18b5af3e148fb6438adf9fc49e70..b4963914e9844178a88297b2ae1a97327e44cf0a 100644
--- a/deps/npm/man/man1/npm-bin.1
+++ b/deps/npm/man/man1/npm-bin.1
@@ -1,40 +1,30 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-BIN" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-bin\fR \-\- Display npm bin folder
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-bin\fR \- Display npm bin folder
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm bin
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
Print the folder where npm will install executables\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help prefix
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help root
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 folders
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1
index 328ac304515d29deb108414605a28dfe7f4a9da6..67c0a6114bda64bfff76cf613412d6a93d9d2594 100644
--- a/deps/npm/man/man1/npm-bugs.1
+++ b/deps/npm/man/man1/npm-bugs.1
@@ -1,78 +1,59 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-BUGS" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-bugs\fR \-\- Bugs for a package in a web browser maybe
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm bugs
npm bugs (with no args in a package dir)
-.
-.fi
-.
-.SH "DESCRIPTION"
-This command tries to guess at the likely location of a package\'s
+.EE
+.RE
+.SH DESCRIPTION
+.P
+This command tries to guess at the likely location of a package's
bug tracker URL, and then tries to open it using the \fB\-\-browser\fR
config param\. If no package name is provided, it will search for
a \fBpackage\.json\fR in the current folder and use the \fBname\fR property\.
-.
-.SH "CONFIGURATION"
-.
-.SS "browser"
-.
-.IP "\(bu" 4
+.SH CONFIGURATION
+.SS browser
+.RS 0
+.IP \(bu 2
Default: OS X: \fB"open"\fR, Windows: \fB"start"\fR, Others: \fB"xdg\-open"\fR
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: String
-.
-.IP "" 0
-.
+
+.RE
.P
The browser that is called by the \fBnpm bugs\fR command to open websites\.
-.
-.SS "registry"
-.
-.IP "\(bu" 4
+.SS registry
+.RS 0
+.IP \(bu 2
Default: https://registry\.npmjs\.org/
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: url
-.
-.IP "" 0
-.
+
+.RE
.P
The base URL of the npm package registry\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help docs
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help view
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help publish
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 registry
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 package\.json
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-build.1 b/deps/npm/man/man1/npm-build.1
index cc815b63b51035068c84d4bacc943252413fc3f0..ed530b38607abb9a9cb712f496950c83b082052c 100644
--- a/deps/npm/man/man1/npm-build.1
+++ b/deps/npm/man/man1/npm-build.1
@@ -1,43 +1,34 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-BUILD" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-build\fR \-\- Build a package
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-build\fR \- Build a package
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm build
-.
-.fi
-.
-.IP "\(bu" 4
+.EE
+.RE
+.RS 0
+.IP \(bu 2
\fB\fR:
A folder containing a \fBpackage\.json\fR file in its root\.
-.
-.IP "" 0
-.
-.SH "DESCRIPTION"
+
+.RE
+.SH DESCRIPTION
+.P
This is the plumbing command called by \fBnpm link\fR and \fBnpm install\fR\|\.
-.
.P
It should generally not be called directly\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help install
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help link
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 scripts
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 package\.json
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-bundle.1 b/deps/npm/man/man1/npm-bundle.1
index 5799f4b19d92dec7c6818937d2ed9f667d580ec0..7a8355d888b1717b37f8f32d06f258bfa777a596 100644
--- a/deps/npm/man/man1/npm-bundle.1
+++ b/deps/npm/man/man1/npm-bundle.1
@@ -1,23 +1,17 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-BUNDLE" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-bundle\fR \-\- REMOVED
-.
-.SH "DESCRIPTION"
+\fBnpm-bundle\fR \- REMOVED
+.SH DESCRIPTION
+.P
The \fBnpm bundle\fR command has been removed in 1\.0, for the simple reason
that it is no longer necessary, as the default behavior is now to
install packages into the local space\.
-.
.P
Just use \fBnpm install\fR now to do what \fBnpm bundle\fR used to do\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help install
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1
index 3977da0b1af651b3ee4d84cdd0169ae797b7fc53..5a99d11a2400a931fd8368dfef5ce24df7be5b80 100644
--- a/deps/npm/man/man1/npm-cache.1
+++ b/deps/npm/man/man1/npm-cache.1
@@ -1,100 +1,86 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-CACHE" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-cache\fR \-\- Manipulates packages cache
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-cache\fR \- Manipulates packages cache
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm cache add
npm cache add
npm cache add
npm cache add @
+
npm cache ls []
+
npm cache clean []
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
Used to add, list, or clear the npm cache folder\.
-.
-.IP "\(bu" 4
+.RS 0
+.IP \(bu 2
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\.
-.
-.IP "\(bu" 4
+.IP \(bu 2
ls:
Show the data in the cache\. Argument is a path to show in the cache
-folder\. Works a bit like the \fBfind\fR program, but limited by the \fBdepth\fR config\.
-.
-.IP "\(bu" 4
+folder\. Works a bit like the \fBfind\fR program, but limited by the
+\fBdepth\fR config\.
+.IP \(bu 2
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\.
-.
-.IP "" 0
-.
-.SH "DETAILS"
+
+.RE
+.SH DETAILS
+.P
npm stores cache data in the directory specified in \fBnpm config get cache\fR\|\.
For each package that is added to the cache, three pieces of information are
stored in \fB{cache}/{name}/{version}\fR:
-.
-.IP "\(bu" 4
+.RS 0
+.IP \(bu 2
\|\.\.\./package/package\.json:
The package\.json file, as npm sees it\.
-.
-.IP "\(bu" 4
+.IP \(bu 2
\|\.\.\./package\.tgz:
The tarball for that version\.
-.
-.IP "" 0
-.
+
+.RE
.P
Additionally, whenever a registry request is made, a \fB\|\.cache\.json\fR file
is placed at the corresponding URI, to store the ETag and the requested
data\. This is stored in \fB{cache}/{hostname}/{path}/\.cache\.json\fR\|\.
-.
.P
-Commands that make non\-essential registry requests (such as \fBsearch\fR and \fBview\fR, or the completion scripts) generally specify a minimum timeout\.
+Commands that make non\-essential registry requests (such as \fBsearch\fR and
+\fBview\fR, or the completion scripts) generally specify a minimum timeout\.
If the \fB\|\.cache\.json\fR file is younger than the specified timeout, then
they do not make an HTTP request to the registry\.
-.
-.SH "CONFIGURATION"
-.
-.SS "cache"
+.SH CONFIGURATION
+.SS cache
+.P
Default: \fB~/\.npm\fR on Posix, or \fB%AppData%/npm\-cache\fR on Windows\.
-.
.P
The root cache folder\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help 5 folders
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help install
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help publish
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help pack
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1
index 2ae25687a688a59fc7a1a089f1dc408026bc2f44..bbd224f76c2478b29620e8182e9c813112c4a198 100644
--- a/deps/npm/man/man1/npm-completion.1
+++ b/deps/npm/man/man1/npm-completion.1
@@ -1,47 +1,37 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-COMPLETION" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-completion\fR \-\- Tab Completion for npm
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-completion\fR \- Tab Completion for npm
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
\|\. <(npm completion)
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
Enables tab\-completion in all npm commands\.
-.
.P
The synopsis above
loads the completions into your current shell\. Adding it to
your ~/\.bashrc or ~/\.zshrc will make the completions available
everywhere\.
-.
.P
You may of course also pipe the output of npm completion to a file
such as \fB/usr/local/etc/bash_completion\.d/npm\fR if you have a system
that will read that file for you\.
-.
.P
When \fBCOMP_CWORD\fR, \fBCOMP_LINE\fR, and \fBCOMP_POINT\fR are defined in the
environment, \fBnpm completion\fR acts in "plumbing mode", and outputs
completions based on the arguments\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help 7 developers
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 faq
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help npm
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1
index 0b019c7c025eee8555fe3e04d46a04082132e035..ca7d69d1baee6fc7f5aa82c23b9c3f2b9eada7bc 100644
--- a/deps/npm/man/man1/npm-config.1
+++ b/deps/npm/man/man1/npm-config.1
@@ -1,14 +1,10 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-CONFIG" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-config\fR \-\- Manage the npm configuration files
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-config\fR \- Manage the npm configuration files
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm config set [\-\-global]
npm config get
npm config delete
@@ -17,97 +13,83 @@ npm config edit
npm c [set|get|delete|list]
npm get
npm set [\-\-global]
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
npm gets its config settings from the command line, environment
variables, \fBnpmrc\fR files, and in some cases, the \fBpackage\.json\fR file\.
-.
.P
See npm help 5 npmrc for more information about the npmrc files\.
-.
.P
See npm help 7 \fBnpm\-config\fR for a more thorough discussion of the mechanisms
involved\.
-.
.P
The \fBnpm config\fR command can be used to update and edit the contents
of the user and global npmrc files\.
-.
-.SH "Sub\-commands"
+.SH Sub\-commands
+.P
Config supports the following sub\-commands:
-.
-.SS "set"
-.
-.nf
+.SS set
+.P
+.RS 2
+.EX
npm config set key value
-.
-.fi
-.
+.EE
+.RE
.P
Sets the config key to the value\.
-.
.P
If value is omitted, then it sets it to "true"\.
-.
-.SS "get"
-.
-.nf
+.SS get
+.P
+.RS 2
+.EX
npm config get key
-.
-.fi
-.
+.EE
+.RE
.P
Echo the config value to stdout\.
-.
-.SS "list"
-.
-.nf
+.SS list
+.P
+.RS 2
+.EX
npm config list
-.
-.fi
-.
+.EE
+.RE
.P
Show all the config settings\.
-.
-.SS "delete"
-.
-.nf
+.SS delete
+.P
+.RS 2
+.EX
npm config delete key
-.
-.fi
-.
+.EE
+.RE
.P
Deletes the key from all configuration files\.
-.
-.SS "edit"
-.
-.nf
+.SS edit
+.P
+.RS 2
+.EX
npm config edit
-.
-.fi
-.
+.EE
+.RE
.P
Opens the config file in an editor\. Use the \fB\-\-global\fR flag to edit the
global config\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help 5 folders
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 package\.json
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help npm
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1
index cdfa3520f686f24e0b253aee416c2e43bdea8ab8..58c01ca287fc3b17bf68dd0f746b806a8d87b978 100644
--- a/deps/npm/man/man1/npm-dedupe.1
+++ b/deps/npm/man/man1/npm-dedupe.1
@@ -1,96 +1,74 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-DEDUPE" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-dedupe\fR \-\- Reduce duplication
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-dedupe\fR \- Reduce duplication
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm dedupe [package names\.\.\.]
npm ddp [package names\.\.\.]
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
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\.
-.
.P
For example, consider this dependency graph:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
a
+\-\- b <\-\- depends on c@1\.0\.x
| `\-\- c@1\.0\.3
`\-\- d <\-\- depends on c@~1\.0\.9
`\-\- c@1\.0\.10
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
In this case, npm help \fBnpm\-dedupe\fR will transform the tree to:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
a
+\-\- b
+\-\- d
`\-\- c@1\.0\.10
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
-Because of the hierarchical nature of node\'s module lookup, b and d
+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\.
-.
.P
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\.
-.
.P
If no suitable version can be found, then a warning is printed, and
nothing is done\.
-.
.P
If any arguments are supplied, then they are filters, and only the
named packages will be touched\.
-.
.P
Note that this operation transforms the dependency tree, and may
result in packages getting updated versions, perhaps from the npm
registry\.
-.
.P
This feature is experimental, and may change in future versions\.
-.
.P
The \fB\-\-tag\fR argument will apply to all of the affected dependencies\. If a
tag with the given name exists, the tagged version is preferred over newer
versions\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help ls
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help update
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help install
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1
index cc2d18ee52f915a6be8a97ce657a045d67532f20..3ff2f88e9cb02ed7d213dc0812bcb05e5ee59f6f 100644
--- a/deps/npm/man/man1/npm-deprecate.1
+++ b/deps/npm/man/man1/npm-deprecate.1
@@ -1,48 +1,37 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-DEPRECATE" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-deprecate\fR \-\- Deprecate a version of a package
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-deprecate\fR \- Deprecate a version of a package
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm deprecate [@]
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
This command will update the npm registry entry for a package, providing
a deprecation warning to all who attempt to install it\.
-.
.P
It works on version ranges as well as specific versions, so you can do
something like this:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
npm deprecate my\-thing@"< 0\.2\.3" "critical bug fixed in v0\.2\.3"
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
-Note that you must be the package owner to deprecate something\. See the \fBowner\fR and \fBadduser\fR help topics\.
-.
+Note that you must be the package owner to deprecate something\. See the
+\fBowner\fR and \fBadduser\fR help topics\.
.P
To un\-deprecate a package, specify an empty string (\fB""\fR) for the \fBmessage\fR argument\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help publish
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 registry
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1
index db3d4e768fb402fee3589d3712f1e5af512198d3..0a55953b0c576275231ff2f9341732452f30850a 100644
--- a/deps/npm/man/man1/npm-docs.1
+++ b/deps/npm/man/man1/npm-docs.1
@@ -1,78 +1,60 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-DOCS" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-docs\fR \-\- Docs for a package in a web browser maybe
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-docs\fR \- Docs for a package in a web browser maybe
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm docs [ [ \.\.\.]]
npm docs (with no args in a package dir)
npm home [ [ \.\.\.]]
npm home (with no args in a package dir)
-.
-.fi
-.
-.SH "DESCRIPTION"
-This command tries to guess at the likely location of a package\'s
+.EE
+.RE
+.SH DESCRIPTION
+.P
+This command tries to guess at the likely location of a package's
documentation URL, and then tries to open it using the \fB\-\-browser\fR
config param\. You can pass multiple package names at once\. If no
package name is provided, it will search for a \fBpackage\.json\fR in
the current folder and use the \fBname\fR property\.
-.
-.SH "CONFIGURATION"
-.
-.SS "browser"
-.
-.IP "\(bu" 4
+.SH CONFIGURATION
+.SS browser
+.RS 0
+.IP \(bu 2
Default: OS X: \fB"open"\fR, Windows: \fB"start"\fR, Others: \fB"xdg\-open"\fR
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: String
-.
-.IP "" 0
-.
+
+.RE
.P
The browser that is called by the \fBnpm docs\fR command to open websites\.
-.
-.SS "registry"
-.
-.IP "\(bu" 4
+.SS registry
+.RS 0
+.IP \(bu 2
Default: https://registry\.npmjs\.org/
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: url
-.
-.IP "" 0
-.
+
+.RE
.P
The base URL of the npm package registry\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help view
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help publish
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 registry
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 package\.json
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1
index 036d0715a4f0b589179ee9e1789d26c166e84ad7..d7f40561548e5001743c9ac70cee32cbb30a1e11 100644
--- a/deps/npm/man/man1/npm-edit.1
+++ b/deps/npm/man/man1/npm-edit.1
@@ -1,66 +1,50 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-EDIT" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-edit\fR \-\- Edit an installed package
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-edit\fR \- Edit an installed package
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm edit [@]
-.
-.fi
-.
-.SH "DESCRIPTION"
-Opens the package folder in the default editor (or whatever you\'ve
+.EE
+.RE
+.SH DESCRIPTION
+.P
+Opens the package folder in the default editor (or whatever you've
configured as the npm \fBeditor\fR config \-\- see npm help 7 \fBnpm\-config\fR\|\.)
-.
.P
After it has been edited, the package is rebuilt so as to pick up any
changes in compiled packages\.
-.
.P
For instance, you can do \fBnpm install connect\fR to install connect
into your package, and then \fBnpm edit connect\fR to make a few
changes to your locally installed copy\.
-.
-.SH "CONFIGURATION"
-.
-.SS "editor"
-.
-.IP "\(bu" 4
+.SH CONFIGURATION
+.SS editor
+.RS 0
+.IP \(bu 2
Default: \fBEDITOR\fR environment variable if set, or \fB"vi"\fR on Posix,
or \fB"notepad"\fR on Windows\.
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: path
-.
-.IP "" 0
-.
+
+.RE
.P
The command to run for \fBnpm edit\fR or \fBnpm config edit\fR\|\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help 5 folders
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help explore
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help install
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1
index c7d570745cf06d89d8f439bde8e4ec723430b07d..01f91bff91264ba1500a3940273eac7a92a324b2 100644
--- a/deps/npm/man/man1/npm-explore.1
+++ b/deps/npm/man/man1/npm-explore.1
@@ -1,76 +1,57 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-EXPLORE" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-explore\fR \-\- Browse an installed package
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-explore\fR \- Browse an installed package
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm explore [ \-\- ]
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
Spawn a subshell in the directory of the installed package specified\.
-.
.P
If a command is specified, then it is run in the subshell, which then
immediately terminates\.
-.
.P
-This is particularly handy in the case of git submodules in the \fBnode_modules\fR folder:
-.
-.IP "" 4
-.
-.nf
+This is particularly handy in the case of git submodules in the
+\fBnode_modules\fR folder:
+.P
+.RS 2
+.EX
npm explore some\-dependency \-\- git pull origin master
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
Note that the package is \fInot\fR automatically rebuilt afterwards, so be
sure to use \fBnpm rebuild \fR if you make any changes\.
-.
-.SH "CONFIGURATION"
-.
-.SS "shell"
-.
-.IP "\(bu" 4
+.SH CONFIGURATION
+.SS shell
+.RS 0
+.IP \(bu 2
Default: SHELL environment variable, or "bash" on Posix, or "cmd" on
Windows
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: path
-.
-.IP "" 0
-.
+
+.RE
.P
The shell to run for the \fBnpm explore\fR command\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help submodule
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 folders
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help edit
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help rebuild
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help build
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help install
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1
index 37ba03c7960df89f5a91fcc94c5fe67e2d3bf104..78864694ac597546bc9977e9566390a6bf31127f 100644
--- a/deps/npm/man/man1/npm-help-search.1
+++ b/deps/npm/man/man1/npm-help-search.1
@@ -1,59 +1,45 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-HELP\-SEARCH" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-help-search\fR \-\- Search npm help documentation
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-help-search\fR \- Search npm help documentation
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm help\-search some search terms
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
This command will search the npm markdown documentation files for the
terms provided, and then list the results, sorted by relevance\.
-.
.P
If only one result is found, then it will show that help topic\.
-.
.P
If the argument to \fBnpm help\fR is not a known help topic, then it will
call \fBhelp\-search\fR\|\. It is rarely if ever necessary to call this
command directly\.
-.
-.SH "CONFIGURATION"
-.
-.SS "long"
-.
-.IP "\(bu" 4
+.SH CONFIGURATION
+.SS long
+.RS 0
+.IP \(bu 2
Type: Boolean
-.
-.IP "\(bu" 4
+.IP \(bu 2
Default false
-.
-.IP "" 0
-.
+
+.RE
.P
If true, the "long" flag will cause help\-search to output context around
where the terms were found in the documentation\.
-.
.P
If false, then help\-search will just list out the help topics found\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help npm
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 faq
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help help
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1
index 7cc361f463b66009654256c8ceeb9446466ccff7..b0456ef22e6b51769ec7fabb71fa572f63f78b1c 100644
--- a/deps/npm/man/man1/npm-help.1
+++ b/deps/npm/man/man1/npm-help.1
@@ -1,77 +1,57 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-HELP" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-help\fR \-\- Get help on npm
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-help\fR \- Get help on npm
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm help
npm help some search terms
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
If supplied a topic, then show the appropriate documentation page\.
-.
.P
If the topic does not exist, or if multiple terms are provided, then run
the \fBhelp\-search\fR command to find a match\. Note that, if \fBhelp\-search\fR
finds a single subject, then it will run \fBhelp\fR on that topic, so unique
matches are equivalent to specifying a topic name\.
-.
-.SH "CONFIGURATION"
-.
-.SS "viewer"
-.
-.IP "\(bu" 4
+.SH CONFIGURATION
+.SS viewer
+.RS 0
+.IP \(bu 2
Default: "man" on Posix, "browser" on Windows
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: path
-.
-.IP "" 0
-.
+
+.RE
.P
The program to use to view help content\.
-.
.P
Set to \fB"browser"\fR to view html help content in the default web browser\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help npm
-.
-.IP "\(bu" 4
+.IP \(bu 2
README
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 faq
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 folders
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 package\.json
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help help\-search
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 index
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1
index 5091fdefd83d5845414880099896a18d8cc77ea2..93e3845754b0d6f8130358ecd66b51fd19d029eb 100644
--- a/deps/npm/man/man1/npm-init.1
+++ b/deps/npm/man/man1/npm-init.1
@@ -1,43 +1,33 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-INIT" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-init\fR \-\- Interactively create a package\.json file
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-init\fR \- Interactively create a package\.json file
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm init
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
This will ask you a bunch of questions, and then write a package\.json for you\.
-.
.P
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\.
-.
+and then writes a package\.json file with the options you've selected\.
.P
-If you already have a package\.json file, it\'ll read that first, and default to
+If you already have a package\.json file, it'll read that first, and default to
the options in there\.
-.
.P
It is strictly additive, so it does not delete options from your package\.json
without a really good reason to do so\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
-\fIhttps://github\.com/isaacs/init\-package\-json\fR
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
+https://github\.com/isaacs/init\-package\-json
+.IP \(bu 2
npm help 5 package\.json
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help version
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1
index 7e874f34900c423587b4381185b827fae9985596..ad6bdf55bb3132061ad02eea7c124a7bc0d9c232 100644
--- a/deps/npm/man/man1/npm-install.1
+++ b/deps/npm/man/man1/npm-install.1
@@ -1,335 +1,270 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-INSTALL" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-install\fR \-\- Install a package
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-install\fR \- Install a package
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm install (with no args in a package dir)
npm install
npm install
npm install
-npm install [\-\-save|\-\-save\-dev|\-\-save\-optional] [\-\-save\-exact]
-npm install @
-npm install @
-npm install @
+npm install [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional] [\-\-save\-exact]
+npm install [@/]@
+npm install [@/]@
+npm install [@/]@
npm i (with any of the previous argument usage)
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
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 help shrinkwrap\.
-.
.P
A \fBpackage\fR is:
-.
-.IP "\(bu" 4
+.RS 0
+.IP \(bu 2
a) a folder containing a program described by a package\.json file
-.
-.IP "\(bu" 4
+.IP \(bu 2
b) a gzipped tarball containing (a)
-.
-.IP "\(bu" 4
+.IP \(bu 2
c) a url that resolves to (b)
-.
-.IP "\(bu" 4
+.IP \(bu 2
d) a \fB@\fR that is published on the registry (see npm help 7 \fBnpm\-registry\fR) with (c)
-.
-.IP "\(bu" 4
+.IP \(bu 2
e) a \fB@\fR that points to (d)
-.
-.IP "\(bu" 4
+.IP \(bu 2
f) a \fB\fR that has a "latest" tag satisfying (e)
-.
-.IP "\(bu" 4
+.IP \(bu 2
g) a \fB\fR that resolves to (b)
-.
-.IP "" 0
-.
+
+.RE
.P
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)\.
-.
-.IP "\(bu" 4
+.RS 0
+.IP \(bu 2
\fBnpm install\fR (in package directory, no arguments):
-.
-.IP
-Install the dependencies in the local node_modules folder\.
-.
-.IP
-In global mode (ie, with \fB\-g\fR or \fB\-\-global\fR appended to the command),
-it installs the current package context (ie, the current working
-directory) as a global package\.
-.
-.IP
-By default, \fBnpm install\fR will install all modules listed as
-dependencies\. With the \fB\-\-production\fR flag,
-npm will not install modules listed in \fBdevDependencies\fR\|\.
-.
-.IP "\(bu" 4
+ Install the dependencies in the local node_modules folder\.
+ In global mode (ie, with \fB\-g\fR or \fB\-\-global\fR appended to the command),
+ it installs the current package context (ie, the current working
+ directory) as a global package\.
+ By default, \fBnpm install\fR will install all modules listed as
+ dependencies\. With the \fB\-\-production\fR flag,
+ npm will not install modules listed in \fBdevDependencies\fR\|\.
+.IP \(bu 2
\fBnpm install \fR:
-.
-.IP
-Install a package that is sitting in a folder on the filesystem\.
-.
-.IP "\(bu" 4
+ Install a package that is sitting in a folder on the filesystem\.
+.IP \(bu 2
\fBnpm install \fR:
-.
-.IP
-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 \fBnpm link\fR\|\.
-.
-.IP
-Example:
-.
-.IP "" 4
-.
-.nf
- npm install \./package\.tgz
-.
-.fi
-.
-.IP "" 0
-
-.
-.IP "\(bu" 4
+ 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 \fBnpm link\fR\|\.
+ Example:
+.P
+.RS 2
+.EX
+ npm install \./package\.tgz
+.EE
+.RE
+.IP \(bu 2
\fBnpm install \fR:
-.
-.IP
-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://"
-.
-.IP
-Example:
-.
-.IP "" 4
-.
-.nf
- npm install https://github\.com/indexzero/forever/tarball/v0\.5\.6
-.
-.fi
-.
-.IP "" 0
-
-.
-.IP "\(bu" 4
-\fBnpm install [\-\-save|\-\-save\-dev|\-\-save\-optional]\fR:
-.
-.IP
-Do a \fB@\fR install, where \fB\fR is the "tag" config\. (See npm help 7 \fBnpm\-config\fR\|\.)
-.
-.IP
-In most cases, this will install the latest version
-of the module published on npm\.
-.
-.IP
-Example:
-.
-.IP
- npm install sax
-.
-.IP
-\fBnpm install\fR takes 3 exclusive, optional flags which save or update
-the package version in your main package\.json:
-.
-.IP "\(bu" 4
+ 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:
+.P
+.RS 2
+.EX
+ npm install https://github\.com/indexzero/forever/tarball/v0\.5\.6
+.EE
+.RE
+.IP \(bu 2
+\fBnpm install [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional]\fR:
+ Do a \fB@\fR install, where \fB\fR is the "tag" config\. (See
+ npm help 7 \fBnpm\-config\fR\|\.)
+ In most cases, this will install the latest version
+ of the module published on npm\.
+ Example:
+.P
+.RS 2
+.EX
+ npm install sax
+.EE
+.RE
+ \fBnpm install\fR takes 3 exclusive, optional flags which save or update
+ the package version in your main package\.json:
+.RS 0
+.IP \(bu 2
\fB\-\-save\fR: Package will appear in your \fBdependencies\fR\|\.
-.
-.IP "\(bu" 4
+.IP \(bu 2
\fB\-\-save\-dev\fR: Package will appear in your \fBdevDependencies\fR\|\.
-.
-.IP "\(bu" 4
+.IP \(bu 2
\fB\-\-save\-optional\fR: Package will appear in your \fBoptionalDependencies\fR\|\.
-.
-.IP
When using any of the above options to save dependencies to your
package\.json, there is an additional, optional flag:
-.
-.IP "\(bu" 4
+.IP \(bu 2
\fB\-\-save\-exact\fR: Saved dependencies will be configured with an
-exact version rather than using npm\'s default semver range
+exact version rather than using npm's default semver range
operator\.
-.
-.IP
+\fB\fR is optional\. The package will be downloaded from the registry
+associated with the specified scope\. If no registry is associated with
+the given scope the default registry is assumed\. See npm help 7 \fBnpm\-scope\fR\|\.
+Note: if you do not include the @\-symbol on your scope name, npm will
+interpret this as a GitHub repository instead, see below\. Scopes names
+must also be followed by a slash\.
Examples:
-.
-.IP
- npm install sax \-\-save
- npm install node\-tap \-\-save\-dev
- npm install dtrace\-provider \-\-save\-optional
- npm install readable\-stream \-\-save \-\-save\-exact
-.
-.IP
-\fBNote\fR: If there is a file or folder named \fB\fR 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\.
-.
-.IP "" 0
-
-.
-.IP "\(bu" 4
-\fBnpm install @\fR:
-.
-.IP
-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\.
-.
-.IP
-Example:
-.
-.IP "" 4
-.
-.nf
- npm install sax@latest
-.
-.fi
-.
-.IP "" 0
+.P
+.RS 2
+.EX
+npm install sax \-\-save
+npm install githubname/reponame
+npm install @myorg/privatepackage
+npm install node\-tap \-\-save\-dev
+npm install dtrace\-provider \-\-save\-optional
+npm install readable\-stream \-\-save \-\-save\-exact
+.EE
+.RE
-.
-.IP "\(bu" 4
-\fBnpm install @\fR:
-.
-.IP
-Install the specified version of the package\. This will fail if the version
-has not been published to the registry\.
-.
-.IP
-Example:
-.
-.IP "" 4
-.
-.nf
- npm install sax@0\.1\.1
-.
-.fi
-.
-.IP "" 0
+.RE
-.
-.IP "\(bu" 4
-\fBnpm install @\fR:
-.
-.IP
-Install a version of the package matching the specified version range\. This
-will follow the same rules for resolving dependencies described in npm help 5 \fBpackage\.json\fR\|\.
-.
-.IP
-Note that most version ranges must be put in quotes so that your shell will
-treat it as a single argument\.
-.
-.IP
-Example:
-.
-.IP
- npm install sax@">=0\.1\.0 <0\.2\.0"
-.
-.IP "\(bu" 4
+.RE
+.P
+.RS 2
+.EX
+**Note**: If there is a file or folder named `` 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\.
+.EE
+.RE
+.RS 0
+.IP \(bu 2
+\fBnpm install [@/]@\fR:
+ 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:
+.P
+.RS 2
+.EX
+ npm install sax@latest
+ npm install @myorg/mypackage@latest
+.EE
+.RE
+.IP \(bu 2
+\fBnpm install [@/]@\fR:
+ Install the specified version of the package\. This will fail if the
+ version has not been published to the registry\.
+ Example:
+.P
+.RS 2
+.EX
+ npm install sax@0\.1\.1
+ npm install @myorg/privatepackage@1\.5\.0
+.EE
+.RE
+.IP \(bu 2
+\fBnpm install [@/]@\fR:
+ Install a version of the package matching the specified version range\. This
+ will follow the same rules for resolving dependencies described in npm help 5 \fBpackage\.json\fR\|\.
+ Note that most version ranges must be put in quotes so that your shell will
+ treat it as a single argument\.
+ Example:
+.P
+.RS 2
+.EX
+ npm install sax@">=0\.1\.0 <0\.2\.0"
+ npm install @myorg/privatepackage@">=0\.1\.0 <0\.2\.0"
+.EE
+.RE
+.IP \(bu 2
+\fBnpm install /\fR:
+ Install the package at \fBhttps://github\.com/githubname/githubrepo" by
+ attempting to clone it using\fRgit`\.
+ Example:
+.P
+.RS 2
+.EX
+ npm install mygithubuser/myproject
+.EE
+.RE
+ To reference a package in a git repo that is not on GitHub, see git
+ remote urls below\.
+.IP \(bu 2
\fBnpm install \fR:
-.
-.IP
-Install a package by cloning a git remote url\. The format of the git
-url is:
-.
-.IP
- ://[@][#]
-.
-.IP
-\fB\fR is one of \fBgit\fR, \fBgit+ssh\fR, \fBgit+http\fR, or \fBgit+https\fR\|\. If no \fB\fR is specified, then \fBmaster\fR is
-used\.
-.
-.IP
-Examples:
-.
-.IP "" 4
-.
-.nf
- git+ssh://git@github\.com:npm/npm\.git#v1\.0\.27
- git+https://isaacs@github\.com/npm/npm\.git
- git://github\.com/npm/npm\.git#v1\.0\.27
-.
-.fi
-.
-.IP "" 0
+ Install a package by cloning a git remote url\. The format of the git
+ url is:
+.P
+.RS 2
+.EX
+ ://[@][#]
+.EE
+.RE
+ \fB\fR is one of \fBgit\fR, \fBgit+ssh\fR, \fBgit+http\fR, or
+ \fBgit+https\fR\|\. If no \fB\fR is specified, then \fBmaster\fR is
+ used\.
+ Examples:
+.P
+.RS 2
+.EX
+ git+ssh://git@github\.com:npm/npm\.git#v1\.0\.27
+ git+https://isaacs@github\.com/npm/npm\.git
+ git://github\.com/npm/npm\.git#v1\.0\.27
+.EE
+.RE
-.
-.IP "" 0
-.
+.RE
.P
You may combine multiple arguments, and even multiple types of arguments\.
For example:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
npm install sax@">=0\.1\.0 <0\.2\.0" bench supervisor
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
The \fB\-\-tag\fR argument will apply to all of the specified install targets\. If a
tag with the given name exists, the tagged version is preferred over newer
versions\.
-.
.P
The \fB\-\-force\fR argument will force npm to fetch remote resources even if a
local copy exists on disk\.
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
npm install sax \-\-force
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
The \fB\-\-global\fR argument will cause npm to install the package globally
rather than locally\. See npm help 5 \fBnpm\-folders\fR\|\.
-.
.P
The \fB\-\-link\fR argument will cause npm to link global installs into the
local space in some cases\.
-.
.P
The \fB\-\-no\-bin\-links\fR argument will prevent npm from creating symlinks for
any binaries the package might contain\.
-.
.P
The \fB\-\-no\-optional\fR argument will prevent optional dependencies from
being installed\.
-.
.P
The \fB\-\-no\-shrinkwrap\fR argument, which will ignore an available
shrinkwrap file and use the package\.json instead\.
-.
.P
The \fB\-\-nodedir=/path/to/node/source\fR argument will allow npm to find the
node source code so that npm can compile native modules\.
-.
.P
See npm help 7 \fBnpm\-config\fR\|\. Many of the configuration params have some
-effect on installation, since that\'s most of what npm does\.
-.
-.SH "ALGORITHM"
+effect on installation, since that's most of what npm does\.
+.SH ALGORITHM
+.P
To install a package, npm uses the following algorithm:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
install(where, what, family, ancestors)
fetch what, unpack to /node_modules/
for each dep in what\.dependencies
@@ -339,103 +274,78 @@ for each dep@version in what\.dependencies
and not in
add precise version deps to
install(/node_modules/, dep, family)
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
For this \fBpackage{dep}\fR structure: \fBA{B,C}, B{C}, C{D}\fR,
this algorithm produces:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
A
+\-\- B
`\-\- C
`\-\- D
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
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\.
-.
.P
See npm help 5 folders for a more detailed description of the specific
folder structures that npm creates\.
-.
-.SS "Limitations of npm's Install Algorithm"
+.SS Limitations of npm's Install Algorithm
+.P
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:
-.
-.IP "" 4
-.
-.nf
-A \-> B \-> A\' \-> B\' \-> A \-> B \-> A\' \-> B\' \-> A \-> \.\.\.
-.
-.fi
-.
-.IP "" 0
-.
-.P
-where \fBA\fR is some version of a package, and \fBA\'\fR is a different version
+.P
+.RS 2
+.EX
+A \-> B \-> A' \-> B' \-> A \-> B \-> A' \-> B' \-> A \-> \.\.\.
+.EE
+.RE
+.P
+where \fBA\fR is some version of a package, and \fBA'\fR is a different version
of the same package\. Because \fBB\fR depends on a different version of \fBA\fR
than the one that is already in the tree, it must install a separate
-copy\. The same is true of \fBA\'\fR, which must install \fBB\'\fR\|\. Because \fBB\'\fR
+copy\. The same is true of \fBA'\fR, which must install \fBB'\fR\|\. Because \fBB'\fR
depends on the original version of \fBA\fR, which has been overridden, the
cycle falls into infinite regress\.
-.
.P
-To avoid this situation, npm flat\-out refuses to install any \fBname@version\fR that is already present anywhere in the tree of package
+To avoid this situation, npm flat\-out refuses to install any
+\fBname@version\fR 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\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help 5 folders
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help update
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help link
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help rebuild
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 scripts
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help build
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 registry
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help tag
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help rm
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help shrinkwrap
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1
index 15d45e4e079c11773b266453955a5bccd938ccba..11ef2dca14a587b1e5dbfd4fcf0a9866b66dd251 100644
--- a/deps/npm/man/man1/npm-link.1
+++ b/deps/npm/man/man1/npm-link.1
@@ -1,119 +1,100 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-LINK" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-link\fR \-\- Symlink a package folder
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-link\fR \- Symlink a package folder
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm link (in package folder)
-npm link
+npm link [@/]
npm ln (with any of the previous argument usage)
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
Package linking is a two\-step process\.
-.
.P
First, \fBnpm link\fR in a package folder will create a globally\-installed
-symbolic link from \fBprefix/package\-name\fR to the current folder\.
-.
+symbolic link from \fBprefix/package\-name\fR to the current folder (see
+npm help 7 \fBnpm\-config\fR for the value of \fBprefix\fR)\.
.P
Next, in some other location, \fBnpm link package\-name\fR will create a
symlink from the local \fBnode_modules\fR folder to the global symlink\.
-.
.P
Note that \fBpackage\-name\fR is taken from \fBpackage\.json\fR,
not from directory name\.
-.
+.P
+The package name can be optionally prefixed with a scope\. See npm help 7 \fBnpm\-scope\fR\|\.
+The scope must by preceded by an @\-symbol and followed by a slash\.
.P
When creating tarballs for \fBnpm publish\fR, the linked packages are
"snapshotted" to their current state by resolving the symbolic links\.
-.
.P
-This is
-handy for installing your own stuff, so that you can work on it and test it
-iteratively without having to continually rebuild\.
-.
+This is handy for installing your own stuff, so that you can work on it and
+test it iteratively without having to continually rebuild\.
.P
For example:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
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
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
Now, any changes to ~/projects/node\-redis will be reflected in
~/projects/node\-bloggy/node_modules/redis/
-.
.P
You may also shortcut the two steps in one\. For example, to do the
above use\-case in a shorter way:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
cd ~/projects/node\-bloggy # go into the dir of your main project
npm link \.\./node\-redis # link the dir of your dependency
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
The second line is the equivalent of doing:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
(cd \.\./node\-redis; npm link)
npm link redis
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
That is, it first creates a global link, and then links the global
-installation target into your project\'s \fBnode_modules\fR folder\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+installation target into your project's \fBnode_modules\fR folder\.
+.P
+If your linked package is scoped (see npm help 7 \fBnpm\-scope\fR) your link command must
+include that scope, e\.g\.
+.P
+.RS 2
+.EX
+npm link @myorg/privatepackage
+.EE
+.RE
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help 7 developers
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 faq
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 package\.json
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help install
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 folders
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1
index 1584fb0f28c769d0c7bb118f1248d43c4795fe91..64db5a46ebd3b00e5f04551dc48d6330e88a046a 100644
--- a/deps/npm/man/man1/npm-ls.1
+++ b/deps/npm/man/man1/npm-ls.1
@@ -1,146 +1,111 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-LS" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-ls\fR \-\- List installed packages
-.
-.SH "SYNOPSIS"
-.
-.nf
-npm list [ \.\.\.]
-npm ls [ \.\.\.]
-npm la [ \.\.\.]
-npm ll [ \.\.\.]
-.
-.fi
-.
-.SH "DESCRIPTION"
+\fBnpm-ls\fR \- List installed packages
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
+npm list [[@/] \.\.\.]
+npm ls [[@/] \.\.\.]
+npm la [[@/] \.\.\.]
+npm ll [[@/] \.\.\.]
+.EE
+.RE
+.SH DESCRIPTION
+.P
This command will print to stdout all the versions of packages that are
installed, as well as their dependencies, in a tree\-structure\.
-.
.P
Positional arguments are \fBname@version\-range\fR identifiers, which will
limit the results to only the paths to the packages named\. Note that
nested packages will \fIalso\fR show the paths to the specified packages\.
-For example, running \fBnpm ls promzard\fR in npm\'s source tree will show:
-.
-.IP "" 4
-.
-.nf
-npm@1.4.28 /path/to/npm
+For example, running \fBnpm ls promzard\fR in npm's source tree will show:
+.P
+.RS 2
+.EX
+npm@2.0.0 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
It will print out extraneous, missing, and invalid packages\.
-.
.P
If a project specifies git urls for dependencies these are shown
in parentheses after the name@version to make it easier for users to
recognize potential forks of a project\.
-.
.P
When run as \fBll\fR or \fBla\fR, it shows extended information by default\.
-.
-.SH "CONFIGURATION"
-.
-.SS "json"
-.
-.IP "\(bu" 4
+.SH CONFIGURATION
+.SS json
+.RS 0
+.IP \(bu 2
Default: false
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: Boolean
-.
-.IP "" 0
-.
+
+.RE
.P
Show information in JSON format\.
-.
-.SS "long"
-.
-.IP "\(bu" 4
+.SS long
+.RS 0
+.IP \(bu 2
Default: false
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: Boolean
-.
-.IP "" 0
-.
+
+.RE
.P
Show extended information\.
-.
-.SS "parseable"
-.
-.IP "\(bu" 4
+.SS parseable
+.RS 0
+.IP \(bu 2
Default: false
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: Boolean
-.
-.IP "" 0
-.
+
+.RE
.P
Show parseable output instead of tree view\.
-.
-.SS "global"
-.
-.IP "\(bu" 4
+.SS global
+.RS 0
+.IP \(bu 2
Default: false
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: Boolean
-.
-.IP "" 0
-.
+
+.RE
.P
List packages in the global install prefix instead of in the current
project\.
-.
-.SS "depth"
-.
-.IP "\(bu" 4
+.SS depth
+.RS 0
+.IP \(bu 2
Type: Int
-.
-.IP "" 0
-.
+
+.RE
.P
Max display depth of the dependency tree\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 folders
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help install
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help link
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help prune
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help outdated
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help update
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1
index 7376fcd24af8f66051b3c444269c01f50a5d9347..589bd6d527bd586a4d7d6c3165c8fb53338d887f 100644
--- a/deps/npm/man/man1/npm-outdated.1
+++ b/deps/npm/man/man1/npm-outdated.1
@@ -1,102 +1,79 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-OUTDATED" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-outdated\fR \-\- Check for outdated packages
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-outdated\fR \- Check for outdated packages
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm outdated [ [ \.\.\.]]
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
This command will check the registry to see if any (or, specific) installed
packages are currently outdated\.
-.
.P
-The resulting field \'wanted\' shows the latest version according to the
-version specified in the package\.json, the field \'latest\' the very latest
+The resulting field 'wanted' shows the latest version according to the
+version specified in the package\.json, the field 'latest' the very latest
version of the package\.
-.
-.SH "CONFIGURATION"
-.
-.SS "json"
-.
-.IP "\(bu" 4
+.SH CONFIGURATION
+.SS json
+.RS 0
+.IP \(bu 2
Default: false
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: Boolean
-.
-.IP "" 0
-.
+
+.RE
.P
Show information in JSON format\.
-.
-.SS "long"
-.
-.IP "\(bu" 4
+.SS long
+.RS 0
+.IP \(bu 2
Default: false
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: Boolean
-.
-.IP "" 0
-.
+
+.RE
.P
Show extended information\.
-.
-.SS "parseable"
-.
-.IP "\(bu" 4
+.SS parseable
+.RS 0
+.IP \(bu 2
Default: false
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: Boolean
-.
-.IP "" 0
-.
+
+.RE
.P
Show parseable output instead of tree view\.
-.
-.SS "global"
-.
-.IP "\(bu" 4
+.SS global
+.RS 0
+.IP \(bu 2
Default: false
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: Boolean
-.
-.IP "" 0
-.
+
+.RE
.P
Check packages in the global install prefix instead of in the current
project\.
-.
-.SS "depth"
-.
-.IP "\(bu" 4
+.SS depth
+.RS 0
+.IP \(bu 2
Type: Int
-.
-.IP "" 0
-.
+
+.RE
.P
Max depth for checking dependency tree\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help update
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 registry
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 folders
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1
index f204431e5dc091241e0e46001445da0fab99bbed..c073a8b87390df8ffcfb9e5be3293b85bd880e18 100644
--- a/deps/npm/man/man1/npm-owner.1
+++ b/deps/npm/man/man1/npm-owner.1
@@ -1,58 +1,47 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-OWNER" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-owner\fR \-\- Manage package owners
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-owner\fR \- Manage package owners
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm owner ls
npm owner add
npm owner rm
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
Manage ownership of published packages\.
-.
-.IP "\(bu" 4
+.RS 0
+.IP \(bu 2
ls:
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\.
-.
-.IP "\(bu" 4
+.IP \(bu 2
add:
Add a new user as a maintainer of a package\. This user is enabled to modify
metadata, publish new versions, and add other owners\.
-.
-.IP "\(bu" 4
+.IP \(bu 2
rm:
Remove a user from the package owner list\. This immediately revokes their
privileges\.
-.
-.IP "" 0
-.
+
+.RE
.P
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
+or you can't\. Future versions may contain more fine\-grained access levels, but
that is not implemented at this time\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help publish
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 registry
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help adduser
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 disputes
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1
index 951d209adb129a4ad2c110f94d9d4bc8ceb9a2a5..e90f3789bd82c3339bca819c9df42d15e16aa49f 100644
--- a/deps/npm/man/man1/npm-pack.1
+++ b/deps/npm/man/man1/npm-pack.1
@@ -1,48 +1,37 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-PACK" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-pack\fR \-\- Create a tarball from a package
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-pack\fR \- Create a tarball from a package
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm pack [ [ \.\.\.]]
-.
-.fi
-.
-.SH "DESCRIPTION"
-For anything that\'s installable (that is, a package folder, tarball,
+.EE
+.RE
+.SH DESCRIPTION
+.P
+For anything that's installable (that is, a package folder, tarball,
tarball url, name@tag, name@version, or name), this command will fetch
it to the cache, and then copy the tarball to the current working
directory as \fB\-\.tgz\fR, and then write the filenames out to
stdout\.
-.
.P
If the same package is specified multiple times, then the file will be
overwritten the second time\.
-.
.P
If no arguments are supplied, then npm packs the current package folder\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help cache
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help publish
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1
index 9cc3f7cadd6a762e678915c0c97efb9170efff95..373f5e4abead4bc675a2d8adfcabdd15c1b96e52 100644
--- a/deps/npm/man/man1/npm-prefix.1
+++ b/deps/npm/man/man1/npm-prefix.1
@@ -1,40 +1,34 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-PREFIX" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-prefix\fR \-\- Display prefix
-.
-.SH "SYNOPSIS"
-.
-.nf
-npm prefix
-.
-.fi
-.
-.SH "DESCRIPTION"
-Print the prefix to standard out\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+\fBnpm-prefix\fR \- Display prefix
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
+npm prefix [\-g]
+.EE
+.RE
+.SH DESCRIPTION
+.P
+Print the local prefix to standard out\. This is the closest parent directory
+to contain a package\.json file unless \fB\-g\fR is also specified\.
+.P
+If \fB\-g\fR is specified, this will be the value of the global prefix\. See
+npm help 7 \fBnpm\-config\fR for more detail\.
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help root
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help bin
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 folders
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1
index 71bb77c407d62060ebe99b20b516875751d4d8aa..3c8a66a7fcde067b4605c2cf6f25317278c95a93 100644
--- a/deps/npm/man/man1/npm-prune.1
+++ b/deps/npm/man/man1/npm-prune.1
@@ -1,42 +1,33 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-PRUNE" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-prune\fR \-\- Remove extraneous packages
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-prune\fR \- Remove extraneous packages
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm prune [ [ [ [\-\-tag ]
npm publish [\-\-tag ]
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
Publishes a package to the registry so that it can be installed by name\.
-.
-.IP "\(bu" 4
+.P
+By default npm will publish to the public registry\. This can be overridden by
+specifying a different default registry or using a npm help 7 \fBnpm\-scope\fR in the name
+(see npm help 5 \fBpackage\.json\fR)\.
+.RS 0
+.IP \(bu 2
\fB\fR:
A folder containing a package\.json file
-.
-.IP "\(bu" 4
+.IP \(bu 2
\fB\fR:
A url or file path to a gzipped tar archive containing a single folder
with a package\.json file inside\.
-.
-.IP "\(bu" 4
+.IP \(bu 2
\fB[\-\-tag ]\fR
Registers the published package with the given tag, such that \fBnpm install
@\fR will install this version\. By default, \fBnpm publish\fR updates
and \fBnpm install\fR installs the \fBlatest\fR tag\.
-.
-.IP "" 0
-.
+
+.RE
.P
Fails if the package name and version combination already exists in
-the registry\.
-.
+the specified registry\.
.P
Once a package is published with a given name and version, that
specific name and version combination can never be used again, even if
it is removed with npm help unpublish\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help 7 registry
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help adduser
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help owner
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help deprecate
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help tag
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1
index 4130eb773f26e0da14e1dc7f34098dc1f853cdc8..f8d52a9a1a65f8e71dc77ba7200fa595f0d92b68 100644
--- a/deps/npm/man/man1/npm-rebuild.1
+++ b/deps/npm/man/man1/npm-rebuild.1
@@ -1,37 +1,31 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-REBUILD" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-rebuild\fR \-\- Rebuild a package
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-rebuild\fR \- Rebuild a package
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm rebuild [ [ \.\.\.]]
npm rb [ [ \.\.\.]]
-.
-.fi
-.
-.IP "\(bu" 4
+.EE
+.RE
+.RS 0
+.IP \(bu 2
\fB\fR:
The package to rebuild
-.
-.IP "" 0
-.
-.SH "DESCRIPTION"
+
+.RE
+.SH DESCRIPTION
+.P
This command runs the \fBnpm build\fR command on the matched folders\. This is useful
when you install a new version of node, and must recompile all your C++ addons with
the new binary\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help build
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help install
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1
index 557a3566eaac442eaec4bdfb275cf86ec041434c..57c48fb3f518db7bed878f104323d3c45877416a 100644
--- a/deps/npm/man/man1/npm-repo.1
+++ b/deps/npm/man/man1/npm-repo.1
@@ -1,47 +1,37 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-REPO" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-repo\fR \-\- Open package repository page in the browser
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-repo\fR \- Open package repository page in the browser
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm repo
npm repo (with no args in a package dir)
-.
-.fi
-.
-.SH "DESCRIPTION"
-This command tries to guess at the likely location of a package\'s
+.EE
+.RE
+.SH DESCRIPTION
+.P
+This command tries to guess at the likely location of a package's
repository URL, and then tries to open it using the \fB\-\-browser\fR
config param\. If no package name is provided, it will search for
a \fBpackage\.json\fR in the current folder and use the \fBname\fR property\.
-.
-.SH "CONFIGURATION"
-.
-.SS "browser"
-.
-.IP "\(bu" 4
+.SH CONFIGURATION
+.SS browser
+.RS 0
+.IP \(bu 2
Default: OS X: \fB"open"\fR, Windows: \fB"start"\fR, Others: \fB"xdg\-open"\fR
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: String
-.
-.IP "" 0
-.
+
+.RE
.P
The browser that is called by the \fBnpm repo\fR command to open websites\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help docs
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1
index 828a43f30fc022d56d16eb0ac38d915c54b33458..a4f95db75809b5552273dee5c29a44a3bcc9c253 100644
--- a/deps/npm/man/man1/npm-restart.1
+++ b/deps/npm/man/man1/npm-restart.1
@@ -1,42 +1,32 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-RESTART" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-restart\fR \-\- Start a package
-.
-.SH "SYNOPSIS"
-.
-.nf
-npm restart
-.
-.fi
-.
-.SH "DESCRIPTION"
-This runs a package\'s "restart" script, if one was provided\.
-Otherwise it runs package\'s "stop" script, if one was provided, and then
+\fBnpm-restart\fR \- Start a package
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
+npm restart [\-\- ]
+.EE
+.RE
+.SH DESCRIPTION
+.P
+This runs a package's "restart" script, if one was provided\.
+Otherwise it runs package's "stop" script, if one was provided, and then
the "start" script\.
-.
.P
If no version is specified, then it restarts the "active" version\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help run\-script
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 scripts
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help test
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help start
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help stop
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-rm.1 b/deps/npm/man/man1/npm-rm.1
index 424314c7d57864522e70e68f42100e7f0f7b50b2..e9df0ff14fef257c1edabc159c2baf740f508409 100644
--- a/deps/npm/man/man1/npm-rm.1
+++ b/deps/npm/man/man1/npm-rm.1
@@ -1,44 +1,34 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-RM" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-rm\fR \-\- Remove a package
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-rm\fR \- Remove a package
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm rm
npm r
npm uninstall
npm un
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
This uninstalls a package, completely removing everything npm installed
on its behalf\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help prune
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help install
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 folders
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1
index 463eeaf934f9c4d594ac8c6e4a466d3f33c6f8a9..b80a8550e4b6a1487fcac33bd44641dcdbaea465 100644
--- a/deps/npm/man/man1/npm-root.1
+++ b/deps/npm/man/man1/npm-root.1
@@ -1,40 +1,30 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-ROOT" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-root\fR \-\- Display npm root
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-root\fR \- Display npm root
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm root
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
Print the effective \fBnode_modules\fR folder to standard out\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help prefix
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help bin
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 folders
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1
index aa2740c11980dd0291cac60137e570a4b682359d..7ee4fc791234b2b56bfcdb788f2eda2ffb8e7f41 100644
--- a/deps/npm/man/man1/npm-run-script.1
+++ b/deps/npm/man/man1/npm-run-script.1
@@ -1,45 +1,35 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-RUN\-SCRIPT" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-run-script\fR \-\- Run arbitrary package scripts
-.
-.SH "SYNOPSIS"
-.
-.nf
-npm run\-script [] [command]
-npm run [] [command]
-.
-.fi
-.
-.SH "DESCRIPTION"
-This runs an arbitrary command from a package\'s \fB"scripts"\fR object\.
+\fBnpm-run-script\fR \- Run arbitrary package scripts
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
+npm run\-script [command] [\-\- ]
+npm run [command] [\-\- ]
+.EE
+.RE
+.SH DESCRIPTION
+.P
+This runs an arbitrary command from a package's \fB"scripts"\fR object\.
If no package name is provided, it will search for a \fBpackage\.json\fR
in the current folder and use its \fB"scripts"\fR object\. If no \fB"command"\fR
is provided, it will list the available top level scripts\.
-.
.P
It is used by the test, start, restart, and stop commands, but can be
called directly, as well\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help 7 scripts
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help test
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help start
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help restart
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help stop
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1
index 2c7edcd2ad0c9823409a581299e377d4b550b855..16b3fa4fffdc392d3de7ee522d297bfe0b290d5c 100644
--- a/deps/npm/man/man1/npm-search.1
+++ b/deps/npm/man/man1/npm-search.1
@@ -1,62 +1,48 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-SEARCH" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-search\fR \-\- Search for packages
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-search\fR \- Search for packages
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm search [\-\-long] [search terms \.\.\.]
npm s [search terms \.\.\.]
npm se [search terms \.\.\.]
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
Search the registry for packages matching the search terms\.
-.
.P
-If a term starts with \fB/\fR, then it\'s interpreted as a regular expression\.
+If a term starts with \fB/\fR, then it's interpreted as a regular expression\.
A trailing \fB/\fR will be ignored in this case\. (Note that many regular
expression characters must be escaped or quoted in most shells\.)
-.
-.SH "CONFIGURATION"
-.
-.SS "long"
-.
-.IP "\(bu" 4
+.SH CONFIGURATION
+.SS long
+.RS 0
+.IP \(bu 2
Default: false
-.
-.IP "\(bu" 4
+.IP \(bu 2
Type: Boolean
-.
-.IP "" 0
-.
+
+.RE
.P
Display full package descriptions and other long text across multiple
lines\. When disabled (default) search results are truncated to fit
neatly on a single line\. Modules with extremely long names will
fall on multiple lines\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help 7 registry
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help view
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1
index 2a053a5b0b7d546e2d939614bb46e64a5f697f4a..e154851b21728708248c07e643cea66618a33125 100644
--- a/deps/npm/man/man1/npm-shrinkwrap.1
+++ b/deps/npm/man/man1/npm-shrinkwrap.1
@@ -1,44 +1,37 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-SHRINKWRAP" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-shrinkwrap\fR \-\- Lock down dependency versions
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-shrinkwrap\fR \- Lock down dependency versions
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm shrinkwrap
-.
-.fi
-.
-.SH "DESCRIPTION"
-This command locks down the versions of a package\'s dependencies so
+.EE
+.RE
+.SH DESCRIPTION
+.P
+This command locks down the versions of a package's dependencies so
that you can control exactly which versions of each dependency will be
used when your package is installed\. The "package\.json" file is still
required if you want to use "npm install"\.
-.
.P
-By default, "npm install" recursively installs the target\'s
+By default, "npm install" recursively installs the target's
dependencies (as specified in package\.json), choosing the latest
-available version that satisfies the dependency\'s semver pattern\. In
+available version that satisfies the dependency's semver pattern\. In
some situations, particularly when shipping software where each change
-is tightly managed, it\'s desirable to fully specify each version of
+is tightly managed, it's desirable to fully specify each version of
each dependency recursively so that subsequent builds and deploys do
not inadvertently pick up newer versions of a dependency that satisfy
the semver pattern\. Specifying specific semver patterns in each
-dependency\'s package\.json would facilitate this, but that\'s not always
+dependency's package\.json would facilitate this, but that's not always
possible or desirable, as when another author owns the npm package\.
-It\'s also possible to check dependencies directly into source control,
+It's also possible to check dependencies directly into source control,
but that may be undesirable for other reasons\.
-.
.P
As an example, consider package A:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
{
"name": "A",
"version": "0\.1\.0",
@@ -46,17 +39,13 @@ As an example, consider package A:
"B": "<0\.1\.0"
}
}
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
package B:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
{
"name": "B",
"version": "0\.0\.1",
@@ -64,83 +53,62 @@ package B:
"C": "<0\.1\.0"
}
}
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
and package C:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
{
"name": "C,
"version": "0\.0\.1"
}
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
If these are the only versions of A, B, and C available in the
registry, then a normal "npm install A" will install:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
A@0\.1\.0
`\-\- B@0\.0\.1
`\-\- C@0\.0\.1
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
However, if B@0\.0\.2 is published, then a fresh "npm install A" will
install:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
A@0\.1\.0
`\-\- B@0\.0\.2
`\-\- C@0\.0\.1
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
-assuming the new version did not modify B\'s dependencies\. Of course,
+assuming the new version did not modify B's dependencies\. Of course,
the new version of B could include a new version of C and any number
of new dependencies\. If such changes are undesirable, the author of A
-could specify a dependency on B@0\.0\.1\. However, if A\'s author and B\'s
-author are not the same person, there\'s no way for A\'s author to say
+could specify a dependency on B@0\.0\.1\. However, if A's author and B's
+author are not the same person, there's no way for A's author to say
that he or she does not want to pull in newly published versions of C
-when B hasn\'t changed at all\.
-.
+when B hasn't changed at all\.
+.P
+In this case, A's author can run
.P
-In this case, A\'s author can run
-.
-.IP "" 4
-.
-.nf
+.RS 2
+.EX
npm shrinkwrap
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
This generates npm\-shrinkwrap\.json, which will look something like this:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
{
"name": "A",
"version": "0\.1\.0",
@@ -155,79 +123,68 @@ This generates npm\-shrinkwrap\.json, which will look something like this:
}
}
}
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
The shrinkwrap command has locked down the dependencies based on
-what\'s currently installed in node_modules\. When "npm install"
+what's currently installed in node_modules\. When "npm install"
installs a package with a npm\-shrinkwrap\.json file in the package
root, the shrinkwrap file (rather than package\.json files) completely
drives the installation of that package and all of its dependencies
(recursively)\. So now the author publishes A@0\.1\.0, and subsequent
installs of this package will use B@0\.0\.1 and C@0\.1\.0, regardless the
-dependencies and versions listed in A\'s, B\'s, and C\'s package\.json
+dependencies and versions listed in A's, B's, and C's package\.json
files\.
-.
-.SS "Using shrinkwrapped packages"
+.SS Using shrinkwrapped packages
+.P
Using a shrinkwrapped package is no different than using any other
package: you can "npm install" it by hand, or add a dependency to your
package\.json file and "npm install" it\.
-.
-.SS "Building shrinkwrapped packages"
+.SS Building shrinkwrapped packages
+.P
To shrinkwrap an existing package:
-.
-.IP "1" 4
+.RS 0
+.IP 1. 3
Run "npm install" in the package root to install the current
versions of all dependencies\.
-.
-.IP "2" 4
+.IP 2. 3
Validate that the package works as expected with these versions\.
-.
-.IP "3" 4
+.IP 3. 3
Run "npm shrinkwrap", add npm\-shrinkwrap\.json to git, and publish
your package\.
-.
-.IP "" 0
-.
+
+.RE
.P
To add or update a dependency in a shrinkwrapped package:
-.
-.IP "1" 4
+.RS 0
+.IP 1. 3
Run "npm install" in the package root to install the current
versions of all dependencies\.
-.
-.IP "2" 4
+.IP 2. 3
Add or update dependencies\. "npm install" each new or updated
package individually and then update package\.json\. Note that they
must be explicitly named in order to be installed: running \fBnpm
install\fR with no arguments will merely reproduce the existing
shrinkwrap\.
-.
-.IP "3" 4
+.IP 3. 3
Validate that the package works as expected with the new
dependencies\.
-.
-.IP "4" 4
+.IP 4. 3
Run "npm shrinkwrap", commit the new npm\-shrinkwrap\.json, and
publish your package\.
-.
-.IP "" 0
-.
+
+.RE
.P
You can use npm help outdated to view dependencies with newer versions
available\.
-.
-.SS "Other Notes"
-A shrinkwrap file must be consistent with the package\'s package\.json
+.SS Other Notes
+.P
+A shrinkwrap file must be consistent with the package's package\.json
file\. "npm shrinkwrap" will fail if required dependencies are not
already installed, since that would result in a shrinkwrap that
-wouldn\'t actually work\. Similarly, the command will fail if there are
+wouldn't actually work\. Similarly, the command will fail if there are
extraneous packages (not referenced by package\.json), since that would
indicate that package\.json is not correct\.
-.
.P
Since "npm shrinkwrap" is intended to lock down your dependencies for
production use, \fBdevDependencies\fR will not be included unless you
@@ -235,31 +192,27 @@ explicitly set the \fB\-\-dev\fR flag when you run \fBnpm shrinkwrap\fR\|\. If
installed \fBdevDependencies\fR are excluded, then npm will print a
warning\. If you want them to be installed with your module by
default, please consider adding them to \fBdependencies\fR instead\.
-.
.P
-If shrinkwrapped package A depends on shrinkwrapped package B, B\'s
+If shrinkwrapped package A depends on shrinkwrapped package B, B's
shrinkwrap will not be used as part of the installation of A\. However,
-because A\'s shrinkwrap is constructed from a valid installation of B
-and recursively specifies all dependencies, the contents of B\'s
-shrinkwrap will implicitly be included in A\'s shrinkwrap\.
-.
-.SS "Caveats"
+because A's shrinkwrap is constructed from a valid installation of B
+and recursively specifies all dependencies, the contents of B's
+shrinkwrap will implicitly be included in A's shrinkwrap\.
+.SS Caveats
+.P
If you wish to lock down the specific bytes included in a package, for
example to have 100% confidence in being able to reproduce a
deployment or build, then you ought to check your dependencies into
source control, or pursue some other mechanism that can verify
contents rather than versions\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help install
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 package\.json
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help ls
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1
index bbcfee19eb1040e499fbf2966b73feb689a8b8a4..211225b2592d75f11d151b469086d81fb65e8083 100644
--- a/deps/npm/man/man1/npm-star.1
+++ b/deps/npm/man/man1/npm-star.1
@@ -1,39 +1,30 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-STAR" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-star\fR \-\- Mark your favorite packages
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-star\fR \- Mark your favorite packages
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm star [, \.\.\.]
npm unstar [, \.\.\.]
-.
-.fi
-.
-.SH "DESCRIPTION"
-"Starring" a package means that you have some interest in it\. It\'s
+.EE
+.RE
+.SH DESCRIPTION
+.P
+"Starring" a package means that you have some interest in it\. It's
a vaguely positive way to show that you care\.
-.
.P
"Unstarring" is the same thing, but in reverse\.
-.
.P
-It\'s a boolean thing\. Starring repeatedly has no additional effect\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+It's a boolean thing\. Starring repeatedly has no additional effect\.
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help view
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help whoami
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help adduser
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1
index 9b2d6d187e43ded015be9e4ee195e5088e7a1668..455cf4fcbc700b84b85273a85512042641901949 100644
--- a/deps/npm/man/man1/npm-stars.1
+++ b/deps/npm/man/man1/npm-stars.1
@@ -1,40 +1,31 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-STARS" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-stars\fR \-\- View packages marked as favorites
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-stars\fR \- View packages marked as favorites
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm stars
npm stars [username]
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
If you have starred a lot of neat things and want to find them again
quickly this command lets you do just that\.
-.
.P
-You may also want to see your friend\'s favorite packages, in this case
+You may also want to see your friend's favorite packages, in this case
you will most certainly enjoy this command\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help star
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help view
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help whoami
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help adduser
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1
index c76e2c92a5de0eaa0f7ce065d8d0b08f21930090..866cfd3a2a3b06d96570952fb7844cd9393ec5e8 100644
--- a/deps/npm/man/man1/npm-start.1
+++ b/deps/npm/man/man1/npm-start.1
@@ -1,37 +1,28 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-START" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-start\fR \-\- Start a package
-.
-.SH "SYNOPSIS"
-.
-.nf
-npm start
-.
-.fi
-.
-.SH "DESCRIPTION"
-This runs a package\'s "start" script, if one was provided\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+\fBnpm-start\fR \- Start a package
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
+npm start [\-\- ]
+.EE
+.RE
+.SH DESCRIPTION
+.P
+This runs a package's "start" script, if one was provided\.
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help run\-script
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 scripts
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help test
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help restart
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help stop
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1
index 37c1a5fe03f188dc58a1290aa0bf2f210ef5cd8f..1c4a6a677587ecc7741fd592352f96f7cd2548b6 100644
--- a/deps/npm/man/man1/npm-stop.1
+++ b/deps/npm/man/man1/npm-stop.1
@@ -1,37 +1,28 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-STOP" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-stop\fR \-\- Stop a package
-.
-.SH "SYNOPSIS"
-.
-.nf
-npm stop
-.
-.fi
-.
-.SH "DESCRIPTION"
-This runs a package\'s "stop" script, if one was provided\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+\fBnpm-stop\fR \- Stop a package
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
+npm stop [\-\- ]
+.EE
+.RE
+.SH DESCRIPTION
+.P
+This runs a package's "stop" script, if one was provided\.
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help run\-script
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 scripts
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help test
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help start
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help restart
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-submodule.1 b/deps/npm/man/man1/npm-submodule.1
index 71853335c5998450fcce68fa7359c67180a8b115..bfb210d6ebb366678b9ced2642be3bc1be56d291 100644
--- a/deps/npm/man/man1/npm-submodule.1
+++ b/deps/npm/man/man1/npm-submodule.1
@@ -1,42 +1,35 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-SUBMODULE" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-submodule\fR \-\- Add a package as a git submodule
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-submodule\fR \- Add a package as a git submodule
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm submodule
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
If the specified package has a git repository url in its package\.json
-description, then this command will add it as a git submodule at \fBnode_modules/\fR\|\.
-.
+description, then this command will add it as a git submodule at
+\fBnode_modules/\fR\|\.
.P
-This is a convenience only\. From then on, it\'s up to you to manage
+This is a convenience only\. From then on, it's up to you to manage
updates by using the appropriate git commands\. npm will stubbornly
refuse to update, modify, or remove anything with a \fB\|\.git\fR subfolder
in it\.
-.
.P
This command also does not install missing dependencies, if the package
does not include them in its git repository\. If \fBnpm ls\fR reports that
things are missing, you can either install, link, or submodule them yourself,
or you can do \fBnpm explore \-\- npm install\fR to install the
dependencies into the submodule folder\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help 5 package\.json
-.
-.IP "\(bu" 4
+.IP \(bu 2
git help submodule
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-tag.1 b/deps/npm/man/man1/npm-tag.1
index c1d463f8cefeee5cef957290537abed213cb2b7b..03fdbdb428b6ee680edfeeabf2e553fc77d72d63 100644
--- a/deps/npm/man/man1/npm-tag.1
+++ b/deps/npm/man/man1/npm-tag.1
@@ -1,74 +1,54 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-TAG" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-tag\fR \-\- Tag a published version
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-tag\fR \- Tag a published version
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm tag @ []
-.
-.fi
-.
-.SH "DESCRIPTION"
-Tags the specified version of the package with the specified tag, or the \fB\-\-tag\fR config if not specified\.
-.
+.EE
+.RE
+.SH DESCRIPTION
+.P
+Tags the specified version of the package with the specified tag, or the
+\fB\-\-tag\fR config if not specified\.
.P
A tag can be used when installing packages as a reference to a version instead
of using a specific version number:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
npm install @
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
When installing dependencies, a preferred tagged version may be specified:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
npm install \-\-tag
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
This also applies to \fBnpm dedupe\fR\|\.
-.
.P
Publishing a package always sets the "latest" tag to the published version\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help publish
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help install
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help dedupe
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 registry
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1
index 063fc926793a4922880c33cc7f2ae4edd992b38d..8e92115ac4eefaf97a9907d920864a76b0c48680 100644
--- a/deps/npm/man/man1/npm-test.1
+++ b/deps/npm/man/man1/npm-test.1
@@ -1,42 +1,32 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-TEST" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-test\fR \-\- Test a package
-.
-.SH "SYNOPSIS"
-.
-.nf
- npm test
- npm tst
-.
-.fi
-.
-.SH "DESCRIPTION"
-This runs a package\'s "test" script, if one was provided\.
-.
+\fBnpm-test\fR \- Test a package
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
+ npm test [\-\- ]
+ npm tst [\-\- ]
+.EE
+.RE
+.SH DESCRIPTION
+.P
+This runs a package's "test" script, if one was provided\.
.P
To run tests as a condition of installation, set the \fBnpat\fR config to
true\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help run\-script
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 scripts
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help start
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help restart
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help stop
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1
index 364d9c1d7c41fb6c5851fcb6ccb0de81ba1413e8..2ade4acd039dd01487cb87ed6075ec124f73f153 100644
--- a/deps/npm/man/man1/npm-uninstall.1
+++ b/deps/npm/man/man1/npm-uninstall.1
@@ -1,87 +1,68 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-RM" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-rm\fR \-\- Remove a package
-.
-.SH "SYNOPSIS"
-.
-.nf
-npm uninstall [\-\-save|\-\-save\-dev|\-\-save\-optional]
+\fBnpm-rm\fR \- Remove a package
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
+npm uninstall [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional]
npm rm (with any of the previous argument usage)
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
This uninstalls a package, completely removing everything npm installed
on its behalf\.
-.
.P
Example:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
npm uninstall sax
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
In global mode (ie, with \fB\-g\fR or \fB\-\-global\fR appended to the command),
it uninstalls the current package context as a global package\.
-.
.P
\fBnpm uninstall\fR takes 3 exclusive, optional flags which save or update
the package version in your main package\.json:
-.
-.IP "\(bu" 4
+.RS 0
+.IP \(bu 2
\fB\-\-save\fR: Package will be removed from your \fBdependencies\fR\|\.
-.
-.IP "\(bu" 4
+.IP \(bu 2
\fB\-\-save\-dev\fR: Package will be removed from your \fBdevDependencies\fR\|\.
-.
-.IP "\(bu" 4
+.IP \(bu 2
\fB\-\-save\-optional\fR: Package will be removed from your \fBoptionalDependencies\fR\|\.
-.
-.IP "" 0
-.
+
+.RE
+.P
+Scope is optional and follows the usual rules for npm help 7 \fBnpm\-scope\fR\|\.
.P
Examples:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
npm uninstall sax \-\-save
+npm uninstall @myorg/privatepackage \-\-save
npm uninstall node\-tap \-\-save\-dev
npm uninstall dtrace\-provider \-\-save\-optional
-.
-.fi
-.
-.IP "" 0
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.EE
+.RE
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help prune
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help install
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 folders
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 config
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 npmrc
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1
index e5b8a6560106f1179d8ea9589fb3fb13b0c6234d..9aec7540b0d471214b63c00e20e619f523414456 100644
--- a/deps/npm/man/man1/npm-unpublish.1
+++ b/deps/npm/man/man1/npm-unpublish.1
@@ -1,58 +1,47 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-UNPUBLISH" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-unpublish\fR \-\- Remove a package from the registry
-.
-.SH "SYNOPSIS"
-.
-.nf
-npm unpublish [@]
-.
-.fi
-.
-.SH "WARNING"
+\fBnpm-unpublish\fR \- Remove a package from the registry
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
+npm unpublish [@/][@]
+.EE
+.RE
+.SH WARNING
+.P
\fBIt is generally considered bad behavior to remove versions of a library
that others are depending on!\fR
-.
.P
Consider using the \fBdeprecate\fR command
instead, if your intent is to encourage users to upgrade\.
-.
.P
There is plenty of room on the registry\.
-.
-.SH "DESCRIPTION"
+.SH DESCRIPTION
+.P
This removes a package version from the registry, deleting its
entry and removing the tarball\.
-.
.P
If no version is specified, or if all versions are removed then
the root package entry is removed from the registry entirely\.
-.
.P
Even if a package version is unpublished, that specific name and
version combination can never be reused\. In order to publish the
package again, a new version number must be used\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.P
+The scope is optional and follows the usual rules for npm help 7 \fBnpm\-scope\fR\|\.
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help deprecate
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help publish
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 registry
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help adduser
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help owner
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1
index de2201209f8cf797e43324973cac5283a8f8173a..4edfab32066c244be491bed417a1b89374b6ca20 100644
--- a/deps/npm/man/man1/npm-update.1
+++ b/deps/npm/man/man1/npm-update.1
@@ -1,45 +1,37 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-UPDATE" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-update\fR \-\- Update a package
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-update\fR \- Update a package
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm update [\-g] [ [ \.\.\.]]
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
This command will update all the packages listed to the latest version
(specified by the \fBtag\fR config)\.
-.
.P
It will also install missing packages\.
-.
.P
-If the \fB\-g\fR flag is specified, this command will update globally installed packages\.
-If no package name is specified, all packages in the specified location (global or local) will be updated\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+If the \fB\-g\fR flag is specified, this command will update globally installed
+packages\.
+.P
+If no package name is specified, all packages in the specified location (global
+or local) will be updated\.
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help install
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help outdated
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 registry
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 folders
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help ls
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1
index fc52da6e8f53f7eddf7f5871f2ce462ca68e8e66..5c05aab9bde78d1d1c2de73d8d21d62a5167fe71 100644
--- a/deps/npm/man/man1/npm-version.1
+++ b/deps/npm/man/man1/npm-version.1
@@ -1,75 +1,61 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-VERSION" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-version\fR \-\- Bump a package version
-.
-.SH "SYNOPSIS"
-.
-.nf
+\fBnpm-version\fR \- Bump a package version
+.SH SYNOPSIS
+.P
+.RS 2
+.EX
npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease]
-.
-.fi
-.
-.SH "DESCRIPTION"
+.EE
+.RE
+.SH DESCRIPTION
+.P
Run this in a package directory to bump the version and write the new
data back to the package\.json file\.
-.
.P
The \fBnewversion\fR argument should be a valid semver string, \fIor\fR a
valid second argument to semver\.inc (one of "patch", "minor", "major",
"prepatch", "preminor", "premajor", "prerelease")\. In the second case,
the existing version will be incremented by 1 in the specified field\.
-.
.P
If run in a git repo, it will also create a version commit and tag, and
fail if the repo is not clean\.
-.
.P
If supplied with \fB\-\-message\fR (shorthand: \fB\-m\fR) config option, npm will
-use it as a commit message when creating a version commit\. If the \fBmessage\fR config contains \fB%s\fR then that will be replaced with the
+use it as a commit message when creating a version commit\. If the
+\fBmessage\fR config contains \fB%s\fR then that will be replaced with the
resulting version number\. For example:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
npm version patch \-m "Upgrade to %s for reasons"
-.
-.fi
-.
-.IP "" 0
-.
+.EE
+.RE
.P
If the \fBsign\-git\-tag\fR config is set, then the tag will be signed using
the \fB\-s\fR flag to git\. Note that you must have a default GPG key set up
in your git config for this to work properly\. For example:
-.
-.IP "" 4
-.
-.nf
+.P
+.RS 2
+.EX
$ npm config set sign\-git\-tag true
$ npm version patch
+
You need a passphrase to unlock the secret key for
user: "isaacs (http://blog\.izs\.me/) "
2048\-bit RSA key, ID 6C481CF6, created 2010\-08\-31
+
Enter passphrase:
-.
-.fi
-.
-.IP "" 0
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
+.EE
+.RE
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
npm help init
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 5 package\.json
-.
-.IP "\(bu" 4
+.IP \(bu 2
npm help 7 semver
-.
-.IP "" 0
+
+.RE
diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1
index 44b42b308d62d6ac32a1394b94cc31fd663cca08..af435f023d3775a92a1b7694642a0e617194b049 100644
--- a/deps/npm/man/man1/npm-view.1
+++ b/deps/npm/man/man1/npm-view.1
@@ -1,186 +1,136 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
.TH "NPM\-VIEW" "1" "September 2014" "" ""
-.
.SH "NAME"
-\fBnpm-view\fR \-\- View registry info
-.
-.SH "SYNOPSIS"
-.
-.nf
-npm view [@] [