summaryrefslogtreecommitdiff
path: root/doc/api/modules.md
diff options
context:
space:
mode:
authorСковорода Никита Андреевич <chalkerx@gmail.com>2016-07-09 08:13:09 +0300
committerСковорода Никита Андреевич <chalkerx@gmail.com>2016-07-14 12:26:50 +0300
commita58b48bc3bcf43f7090d4cc914606af68fe55815 (patch)
tree0fdf8a6a67489aa0474a6be3420dfb5cde3d61f9 /doc/api/modules.md
parente09c62ae3307c434dd237a3bb47805207b36a0d1 (diff)
downloadnode-new-a58b48bc3bcf43f7090d4cc914606af68fe55815.tar.gz
doc: various documentation formatting fixes
* Fix markdown code sample in releases.md, it was <a id="x.y.x></a>" * Fix some markdown errors, e.g. in changelogs * Fix broken defs links, e.g. in domain-postmortem.md * Fix other broken refs, by addaleax * Add links to some defs that were present but not linked to * Remove dead defs * Move defs to the bottom (one file affected) * Add language indicators to all code blocks, using `txt` when no specific language could be chosen * Some minor formatting changes (spaces, ident, headings) PR-URL: https://github.com/nodejs/node/pull/7637 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'doc/api/modules.md')
-rw-r--r--doc/api/modules.md14
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/api/modules.md b/doc/api/modules.md
index 836285b26f..9f6093aaec 100644
--- a/doc/api/modules.md
+++ b/doc/api/modules.md
@@ -143,7 +143,7 @@ the `require.resolve()` function.
Putting together all of the above, here is the high-level algorithm
in pseudocode of what require.resolve does:
-```
+```txt
require(X) from module at path Y
1. If X is a core module,
a. return the core module
@@ -244,7 +244,7 @@ Consider this situation:
`a.js`:
-```
+```js
console.log('a starting');
exports.done = false;
const b = require('./b.js');
@@ -255,7 +255,7 @@ console.log('a done');
`b.js`:
-```
+```js
console.log('b starting');
exports.done = false;
const a = require('./a.js');
@@ -266,7 +266,7 @@ console.log('b done');
`main.js`:
-```
+```js
console.log('main starting');
const a = require('./a.js');
const b = require('./b.js');
@@ -282,7 +282,7 @@ provided to the `a.js` module.
By the time `main.js` has loaded both modules, they're both finished.
The output of this program would thus be:
-```
+```txt
$ node main.js
main starting
a starting
@@ -336,7 +336,7 @@ The first is to create a `package.json` file in the root of the folder,
which specifies a `main` module. An example package.json file might
look like this:
-```
+```json
{ "name" : "some-library",
"main" : "./lib/some-library.js" }
```
@@ -351,7 +351,7 @@ Note: If the file specified by the `"main"` entry of `package.json` is missing
and can not be resolved, Node.js will report the entire module as missing with
the default error:
-```
+```txt
Error: Cannot find module 'some-library'
```