Skip to content

Commit

Permalink
docs: add review suggestions to require()
Browse files Browse the repository at this point in the history
  • Loading branch information
ErickWendel committed Oct 13, 2018
1 parent b4e979f commit 18f6f8e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion doc/api/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,18 @@ added: v0.1.13

* {Function}

To require modules.
Used to import modules, `JSON` and local files. Modules can be imported from `node_modules`. Local modules and JSON files can be imported using the pattern `'./'`.

```js
// importing localModule
const myLocalModule = require('./path/myLocalModule');

// importing JSON file
const jsonData = require('./path/filename.json');

// importing module from node_modules or Node.js internals
const crypto = require('crypto');
```

#### require.cache
<!-- YAML
Expand Down

0 comments on commit 18f6f8e

Please sign in to comment.