Skip to content

Commit

Permalink
doc: add review suggestions to require()
Browse files Browse the repository at this point in the history
PR-URL: nodejs#23605
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
  • Loading branch information
ErickWendel authored and BridgeAR committed Oct 15, 2018
1 parent cc2d9ae commit bb616a8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion doc/api/modules.md
Expand Up @@ -552,7 +552,20 @@ 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 bb616a8

Please sign in to comment.