Wolfgang Steiner
f70c71f168
doc: explain error message on missing main file
...
Added a hint saying that node uses the default "Cannot find module"
error when requiring a module for which the "main" file specified in
the package.json is missing.
PR-URL: https://github.com/nodejs/node/pull/5812
Reviewed-By: Myles Borins <myles.borins@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-03-21 14:59:13 -07:00
Hugo Wood
5298c81f42
doc: require behavior on case-insensitive systems
...
This adds a paragraph in the Module Caching Caveats section about the
behavior of require when Node is running on top of a file system (e.g.
HFS) or operating system (e.g. Windows) that will not consider the case
of file paths to find files.
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Alexis Campailla <orangemocha@nodejs.org >
Reviewed-By: Rod Vagg <rod@vagg.org >
Reviewed-By: Roman Reiss <me@silverwind.io >
2016-02-27 14:33:51 +01:00
Claudio Rodriguez
47e926a8d6
doc: fix type references for link gen, link css
...
Fixes several type references in the docs so that the
doc html gen tool that parses them can put the correct
links in.
Changes css styling for the generated type links.
PR-URL: https://github.com/nodejs/node/pull/4741
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Chris Dickinson <chris@neversaw.us >
Reviewed-By: Roman Reiss <me@silverwind.io >
2016-02-09 13:12:21 +01:00
Benjamin Gruenbaum
334a7e3614
doc: replace function expressions with arrows
...
This commit replaces multiple usages of `function(){}` with ES2015
arrow functions in places it was forgotten earlier. The goal is to
make the docs more consistent since other functions were already
replaced with ES2015 arrows.
In addition, it fixes invalid syntax in modules.markdown to valid
syntax as well as remove `var self = this` pattern usages in the code
where they are now possible to avoid through arrow functions.
PR-URL: https://github.com/nodejs/node/pull/4832
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-01-27 23:00:20 +01:00
Robert Jefe Lindstaedt
e436272897
doc: fenced all code blocks, typo fixes
...
This changes the code blocks from 4-space indentation to ``` fences for
better syntax highlighting and future linting support. Minor On-the-fly
changes for typos and highlight breaking markdown have been made.
JSON-Style objects have been changed so their closing bracket is
on the same line as the opening one.
Known issues:
* Not every JSON / object notation has been improved. Should
make another run for this.
* Some example functions break hightlighting due to various
combinations of brackets. However changing them means leaving
the code style.
Fixes: https://github.com/nodejs/node/issues/4726
PR-URL: https://github.com/nodejs/node/pull/4733
Reviewed-By: Roman Reiss <me@silverwind.io >
2016-01-21 20:55:09 +01:00
Richard Sun
a2e77cedef
doc: remove "above" and "below" references
...
The docs were recently refactored, and some "above" and "below"
references were no longer accurate. This commit removes many
such references, and replaces others with links.
PR-URL: https://github.com/nodejs/node/pull/4499
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-01-11 13:06:00 -05:00
James M Snell
9b21119e17
doc: fix, modernize examples in docs
...
* Use single quotes consistently
* Modernize examples to use template strings and arrow funcs
* Fix a few typos
* Example edits for consistency
PR-URL: https://github.com/nodejs/node/pull/4282
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2015-12-17 08:07:29 -08:00
jpersson
14b3aab7d2
doc: add links and backticks around names
...
* add backticks around names
* add single quotes around event names
* add parenthesis after function names
* add internal links between different sections
* add external links to MDN for some JavaScript references
* sort the link definitions alphabetically
PR-URL: https://github.com/nodejs/node/pull/4054
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
2015-12-03 13:39:09 -08:00
Lewis Cowper
3becac2e60
doc: replace sane with reasonable
...
Removing ableist language because we don't need to make the comparison
to people with mental health issues to get our point across.
PR-URL: https://github.com/nodejs/node/pull/3980
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2015-11-23 14:47:55 +01:00
cjihrig
5900d14966
doc: clarify module loading behavior
...
The module loading system will not append node_modules to a
path already ending in node_modules. This used to be documented,
but it was lost.
Fixes: https://github.com/nodejs/node/issues/3873
PR-URL: https://github.com/nodejs/node/pull/3920
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
2015-11-19 13:12:00 -05:00
Bryan English
cd1123a0fb
doc: consistent reference-style links
...
Moved all the URLs in API docs to the bottom of the files as
reference-style links.
PR-URL: https://github.com/nodejs/node/pull/3845
Reviewed-By: James M Snell <jasnell@gmail.com >
2015-11-16 07:36:59 -08:00
Tristian Flanagan
0ca44b093d
doc: sort modules alphabetically
...
Reorders, with no contextual changes, the modules documentation
alphabetically.
PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2015-11-12 17:40:37 -08:00
Sakthipriyan Vairamani
7953c83b85
doc: remove usage of events.EventEmitter
...
The `events` module already exports `EventEmitter` constructor function
So, we don't have to use `events.EventEmitter` to access it.
Refer: https://github.com/nodejs/node/pull/2896
PR-URL: https://github.com/nodejs/node/pull/2921
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
2015-09-23 00:22:11 +05:30
Anne-Gaelle Colom
e1fb0e8289
doc: use US English for consistency
...
behaviour -> behavior
PR-URL: https://github.com/nodejs/node/pull/2784
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com >
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
2015-09-10 14:39:16 -07:00
James M Snell
2e8bb62011
doc: fix bad merge on modules.markdown
...
My previous commit landed a bad merge on modules.markdown.
This fixes it.
2015-08-25 19:00:02 -07:00
James M Snell
dc27ff4d85
doc: small clarifications to modules.markdown
...
per: https://github.com/joyent/node/pull/8708
A modified version of the original PR submitted by @builtbylane.
Reviewed By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/2378
2015-08-25 18:51:37 -07:00
James M Snell
cc912b99c6
doc: Clarify the module.parent is set once
...
Per: https://github.com/jorrit/node/commit/54a7f79a4a2ecb9c6f235a03287fe2992f19f0bb
Fixes: https://github.com/joyent/node/issues/6149
Originally submitted by @jorrit
Reviewed By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/2378
2015-08-25 18:50:24 -07:00
cjihrig
a69ab27ab4
node: rename from io.js to node
...
This commit replaces instances of io.js with Node.js, based on the
recent convergence. There are some remaining instances of io.js,
related to build and the installer.
Fixes: https://github.com/nodejs/node/issues/2361
PR-URL: https://github.com/nodejs/node/pull/2367
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: João Reis <reis@janeasystems.com >
2015-08-23 17:59:43 -04:00
Сковорода Никита Андреевич
96165f9be2
doc: minor clarification in the modules API doc.
...
PR-URL: https://github.com/nodejs/io.js/pull/1983
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2015-06-16 05:42:05 +03:00
smikes
7d90c90aaf
doc: recommend against use of NODE_PATH
...
PR-URL: https://github.com/nodejs/io.js/pull/1708
Reviewed-By: Roman Reiss <me@silverwind.io >
2015-05-17 20:25:07 +02:00
Chris Dickinson
cf0306cd71
doc: update stability index
...
This simplifies the stability index to 4 levels:
0 - deprecated
1 - experimental / feature-flagged
2 - stable
3 - locked
Domains has been downgraded to deprecated, assert has been
downgraded to stable. Timers and Module remain locked. All
other APIs are now stable.
PR-URL: https://github.com/iojs/io.js/pull/943
Fixes: https://github.com/iojs/io.js/issues/930
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Vladimir Kurchatkin <vladimir.kurchatkin@gmail.com >
2015-02-27 14:23:01 -08:00
Ben Noordhuis
789bbb91d3
doc: update node.js references in api docs
...
Fixes: https://github.com/iojs/io.js/issues/740
PR-URL: https://github.com/iojs/io.js/pull/750
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2015-02-07 17:07:15 -05:00
sudodoki
fd2226894a
doc: note ability to require files within packages
...
Adding note to api/modules.markdown about ability to
load arbitrary path from modules from node_module path
by adding reference to path after module name in call
to require()
PR-URL: https://github.com/joyent/node/pull/7794
Reviewed-by: Trevor Norris <trev.norris@gmail.com >
Reviewed-by: Fedor Indutny <fedor@indutny.com >
Reviewed-by: Timothy J Fontaine <tjfontaine@gmail.com >
2014-11-09 21:46:35 -08:00
Stiliyan Lazarov
47f119cabf
doc: fix wording and punctuation in modules
...
[trev.norris@gmail.com: break lines at 80 characters]
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-10-08 16:48:31 -07:00
Mathias Schreck
7c5fabe405
doc: fix modules require.resolve documentation
...
The behavior of the `node_modules` lookup algorithm was
changed in #1177 , but the documentation was not updated completely
to describe the new behavior.
The pseudocode of the lookup algorithm did not metion that
`index.json` is tried to be loaded if you require a folder.
Reviewed-By: Fedor Indutny <fedor@indutny.com >
2014-09-15 17:17:05 +04:00
Maurice Butler
71fc4d9486
doc: added X.json to the LOAD_AS_FILE sudo code
...
Signed-off-by: Fedor Indutny <fedor@indutny.com >
2014-07-07 12:00:10 +03:00
Ryan Graham
5ac6f4de13
doc: improve module documentation
...
Expands on when to use module.exports vs. exports. This is a recurring
question on mailing list and continues to confuse new devs.
2013-10-27 11:47:11 +01:00
Ryan Graham
1deeab29f2
doc: improve exports/module.exports consistency
...
While they reference the same object, they are only interchangeable
for updates, not assignment.
2013-05-15 21:06:32 +02:00
Ryan Graham
93391ae9cb
doc: clarify exports and module.exports
...
When exporting a single function you must use `module.exports` instead
of the `exports` convenience reference.
2013-05-15 21:05:57 +02:00
Trent Mick
196207c228
node: remove unused flags and files
...
Drop vestigial `process.installPrefix`, `node --vars`, NODE_CFLAGS and
NODE_PREFIX.
Also removed unused node_config.h.in (replaced with config.gypi a while back).
2012-06-18 23:56:42 +02:00
isaacs
1d5b6f26fe
Merge remote-tracking branch 'ry/v0.6' into v0.6-merge
...
Conflicts:
ChangeLog
Makefile
deps/npm/AUTHORS
deps/npm/html/api/bin.html
deps/npm/html/api/bugs.html
deps/npm/html/api/commands.html
deps/npm/html/api/config.html
deps/npm/html/api/deprecate.html
deps/npm/html/api/docs.html
deps/npm/html/api/edit.html
deps/npm/html/api/explore.html
deps/npm/html/api/help-search.html
deps/npm/html/api/init.html
deps/npm/html/api/install.html
deps/npm/html/api/link.html
deps/npm/html/api/load.html
deps/npm/html/api/ls.html
deps/npm/html/api/npm.html
deps/npm/html/api/outdated.html
deps/npm/html/api/owner.html
deps/npm/html/api/pack.html
deps/npm/html/api/prefix.html
deps/npm/html/api/prune.html
deps/npm/html/api/publish.html
deps/npm/html/api/rebuild.html
deps/npm/html/api/restart.html
deps/npm/html/api/root.html
deps/npm/html/api/run-script.html
deps/npm/html/api/search.html
deps/npm/html/api/shrinkwrap.html
deps/npm/html/api/start.html
deps/npm/html/api/stop.html
deps/npm/html/api/submodule.html
deps/npm/html/api/tag.html
deps/npm/html/api/test.html
deps/npm/html/api/uninstall.html
deps/npm/html/api/unpublish.html
deps/npm/html/api/update.html
deps/npm/html/api/version.html
deps/npm/html/api/view.html
deps/npm/html/api/whoami.html
deps/npm/html/doc/README.html
deps/npm/html/doc/adduser.html
deps/npm/html/doc/bin.html
deps/npm/html/doc/bugs.html
deps/npm/html/doc/build.html
deps/npm/html/doc/bundle.html
deps/npm/html/doc/cache.html
deps/npm/html/doc/changelog.html
deps/npm/html/doc/coding-style.html
deps/npm/html/doc/completion.html
deps/npm/html/doc/config.html
deps/npm/html/doc/deprecate.html
deps/npm/html/doc/developers.html
deps/npm/html/doc/disputes.html
deps/npm/html/doc/docs.html
deps/npm/html/doc/edit.html
deps/npm/html/doc/explore.html
deps/npm/html/doc/faq.html
deps/npm/html/doc/folders.html
deps/npm/html/doc/help-search.html
deps/npm/html/doc/help.html
deps/npm/html/doc/index.html
deps/npm/html/doc/init.html
deps/npm/html/doc/install.html
deps/npm/html/doc/json.html
deps/npm/html/doc/link.html
deps/npm/html/doc/list.html
deps/npm/html/doc/npm.html
deps/npm/html/doc/outdated.html
deps/npm/html/doc/owner.html
deps/npm/html/doc/pack.html
deps/npm/html/doc/prefix.html
deps/npm/html/doc/prune.html
deps/npm/html/doc/publish.html
deps/npm/html/doc/rebuild.html
deps/npm/html/doc/registry.html
deps/npm/html/doc/removing-npm.html
deps/npm/html/doc/restart.html
deps/npm/html/doc/root.html
deps/npm/html/doc/run-script.html
deps/npm/html/doc/scripts.html
deps/npm/html/doc/search.html
deps/npm/html/doc/semver.html
deps/npm/html/doc/shrinkwrap.html
deps/npm/html/doc/star.html
deps/npm/html/doc/start.html
deps/npm/html/doc/stop.html
deps/npm/html/doc/submodule.html
deps/npm/html/doc/tag.html
deps/npm/html/doc/test.html
deps/npm/html/doc/uninstall.html
deps/npm/html/doc/unpublish.html
deps/npm/html/doc/update.html
deps/npm/html/doc/version.html
deps/npm/html/doc/view.html
deps/npm/html/doc/whoami.html
deps/npm/lib/install.js
deps/npm/lib/ls.js
deps/npm/man/man1/npm.1
deps/npm/man/man1/shrinkwrap.1
deps/npm/man/man3/npm.3
deps/npm/man/man3/shrinkwrap.3
deps/npm/node_modules/request/main.js
deps/npm/node_modules/request/package.json
deps/npm/package.json
deps/uv/src/unix/core.c
deps/v8/src/conversions-inl.h
deps/v8/src/elements.cc
deps/v8/src/version.cc
doc/about/index.html
doc/api/assert.markdown
doc/api/child_process.markdown
doc/api/cluster.markdown
doc/api/crypto.markdown
doc/api/debugger.markdown
doc/api/dgram.markdown
doc/api/dns.markdown
doc/api/documentation.markdown
doc/api/events.markdown
doc/api/fs.markdown
doc/api/globals.markdown
doc/api/http.markdown
doc/api/https.markdown
doc/api/modules.markdown
doc/api/net.markdown
doc/api/os.markdown
doc/api/path.markdown
doc/api/process.markdown
doc/api/querystring.markdown
doc/api/readline.markdown
doc/api/stdio.markdown
doc/api/stream.markdown
doc/api/timers.markdown
doc/api/tls.markdown
doc/api/tty.markdown
doc/api/url.markdown
doc/api/util.markdown
doc/api/vm.markdown
doc/api/zlib.markdown
doc/api_assets/style.css
doc/community/index.html
doc/index.html
doc/logos/index.html
doc/template.html
src/node_version.h
tools/doc/html.js
tools/gyp/test/mac/app-bundle/empty.c
2012-03-03 23:38:52 -08:00
isaacs
2d44dcc8be
doc: Add stability indicators to documentation
2012-03-03 17:03:52 -08:00
isaacs
e88a1ba74a
doc refactor: modules
2012-02-29 16:04:52 -08:00
isaacs
0cf7156f08
doc refactor: modules
2012-02-27 11:14:34 -08:00
Nathan Rajlich
ec11525d33
docs: Add docs for MODULE_NOT_FOUND error.
2011-12-19 23:47:02 +09:00
kyle@dontkry.com
34f34e4411
docs: fix typo
...
Fixes #2193 .
2011-11-27 01:45:27 +09:00
koichik
1b55010a04
docs: added .json modules.
2011-10-13 17:06:27 +09:00
isaacs
4f91b72dbe
Fix #1851 Correct X/index doc
2011-10-10 12:44:20 -07:00
isaacs
dc8f4eed53
Fix #1694 Document require() cycles
2011-09-13 10:59:42 -07:00
isaacs
703a1ffe52
Revert "AMD compatibility for node"
...
This reverts commit 9967c369c9 .
Conflicts:
test/simple/test-module-loading.js
2011-07-29 11:56:38 -07:00
koichik
3eb246485a
Doc improvements
2011-07-23 14:29:13 +09:00
isaacs
448eab2587
Close #1349 Delimit NODE_PATH with ; on Windows
2011-07-17 14:35:49 -07:00
isaacs
7f0047c2d5
Close #1348 Remove require.paths
...
Module.globalPaths is still set to a read-only copy of the global
include paths pulled off of the NODE_PATH environment variable.
It's important to be able to inspect this, but modifying it no longer
has any effect.
2011-07-15 15:11:33 -07:00
isaacs
ebc4d5cd29
Remove duplicate docs about main module
2011-07-15 15:11:32 -07:00
Ryan Dahl
041c983290
Merge branch 'v0.4'
...
Conflicts:
deps/libev/wscript
doc/api/modules.markdown
2011-07-14 15:52:08 -07:00
isaacs
9b5098f509
Close #1281 Make require a public member of module
...
Reviewed by @felixge
2011-07-14 14:25:49 -07:00
koichik
432d54900e
Remove duplicate section in modules.markdown
...
Fixes #1263
2011-07-03 11:26:44 -07:00
Ryan Dahl
23b8931b62
Merge branch 'v0.4'
...
Conflicts:
src/node.js
src/node_version.h
2011-06-29 14:50:03 +02:00
Ryan Dahl
3d7d994ffc
Merge branch 'v0.4'
...
Conflicts:
doc/api/modules.markdown
test/simple/test-crypto.js
2011-06-15 14:43:37 +02:00
Mathias Buus
39246f65df
Closes #1177 remove one node_modules optimization
...
to better support certain project structures.
2011-06-14 15:32:41 -07:00