Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/man1
diff options
context:
space:
mode:
authorWhyme.Lyu <5longluna@gmail.com>2010-10-26 19:30:19 +0400
committerisaacs <i@izs.me>2010-10-26 21:04:46 +0400
commit19206eea4a10e09e6adfe855e2c35ff7034ed36f (patch)
tree762c027a3a7f328233114a836b847acc556a55d7 /man1
parent8d0cfdbc3dd1fbb07d42517b0f9319acae89138f (diff)
Document require.main doesn't work as usual in bin file.
Diffstat (limited to 'man1')
-rw-r--r--man1/json.17
1 files changed, 7 insertions, 0 deletions
diff --git a/man1/json.1 b/man1/json.1
index 5cac88a71..cb64c4403 100644
--- a/man1/json.1
+++ b/man1/json.1
@@ -152,6 +152,13 @@ So, when you install npm, it\'ll create a symlink from the \fBcli\.js\fR script
create a symlink from \fB/usr/local/bin/npm\-version\fR to \fB/usr/local/bin/npm\fR\|\.
.
.P
+Notice that if the executable file is interpreted by node (i\.e\., specifying
+node in the shebang line), npm actually installs a shim instead of symlinking
+it, which causes expressions \fBrequire\.main === module\fR and \fBmodule\.id === "\."\fR
+evaluate to \fBfalse\fR within the file\. This seems unable to be resolved until
+node provides a "flexible \fBrequire()\fR"\.
+.
+.P
Shortcut: If you have a single executable, and its name is already what you
want it to be, then you can just supply it as a string\. For example:
.