Skip to content

Commit b3617fc

Browse files
lpincaMylesBorins
authored andcommitted
doc: add added: information for modules
PR-URL: #8250 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent a48469f commit b3617fc

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

doc/api/modules.md

+27
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,9 @@ to the module, such as:
451451
module's absolute filename and directory path.
452452

453453
## The `module` Object
454+
<!-- YAML
455+
added: v0.1.16
456+
-->
454457

455458
<!-- type=var -->
456459
<!-- name=module -->
@@ -463,12 +466,18 @@ also accessible via the `exports` module-global. `module` isn't actually
463466
a global but rather local to each module.
464467

465468
### module.children
469+
<!-- YAML
470+
added: v0.1.16
471+
-->
466472

467473
* {Array}
468474

469475
The module objects required by this one.
470476

471477
### module.exports
478+
<!-- YAML
479+
added: v0.1.16
480+
-->
472481

473482
* {Object}
474483

@@ -521,6 +530,9 @@ console.log(x.a);
521530
```
522531

523532
#### exports alias
533+
<!-- YAML
534+
added: v0.1.16
535+
-->
524536

525537
The `exports` variable that is available within a module starts as a reference
526538
to `module.exports`. As with any variable, if you assign a new value to it, it
@@ -546,32 +558,47 @@ As a guideline, if the relationship between `exports` and `module.exports`
546558
seems like magic to you, ignore `exports` and only use `module.exports`.
547559

548560
### module.filename
561+
<!-- YAML
562+
added: v0.1.16
563+
-->
549564

550565
* {String}
551566

552567
The fully resolved filename to the module.
553568

554569
### module.id
570+
<!-- YAML
571+
added: v0.1.16
572+
-->
555573

556574
* {String}
557575

558576
The identifier for the module. Typically this is the fully resolved
559577
filename.
560578

561579
### module.loaded
580+
<!-- YAML
581+
added: v0.1.16
582+
-->
562583

563584
* {Boolean}
564585

565586
Whether or not the module is done loading, or is in the process of
566587
loading.
567588

568589
### module.parent
590+
<!-- YAML
591+
added: v0.1.16
592+
-->
569593

570594
* {Object} Module object
571595

572596
The module that first required this one.
573597

574598
### module.require(id)
599+
<!-- YAML
600+
added: v0.5.1
601+
-->
575602

576603
* `id` {String}
577604
* Return: {Object} `module.exports` from the resolved module

0 commit comments

Comments
 (0)