Skip to content

Commit

Permalink
doc: clarify that import also uses main
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jan 27, 2022
1 parent acc92a7 commit 71775aa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions doc/api/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -1094,8 +1094,7 @@ added: v0.4.0
```

The `"main"` field defines the script that is used when the [package directory
is loaded via `require()`](modules.md#folders-as-modules). Its value
is a path.
is loaded](modules.md#folders-as-modules). Its value is a path.

```cjs
require('./path/to/directory'); // This resolves to ./path/to/directory/main.js.
Expand Down

0 comments on commit 71775aa

Please sign in to comment.