Skip to content

Commit

Permalink
docs: include note about overriding module.exports
Browse files Browse the repository at this point in the history
  • Loading branch information
homer0 committed May 26, 2024
1 parent 0376a3a commit 6da8764
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,14 @@ If there's no `package.json`, it tries to find `index.mjs` or `index.js`.
module.exports = Rosario;
module.exports.Pilar = Pilar;

module.exports = {
Rosario,
Pilar,
};

// Becomes

export default Rosario;
export { Pilar }

const exported = { Rosario, Pilar };
export default exported;
export { Rosario, Pilar };
```

> ⚠️: Do not do `module.exports = { Pilar }`, as the latest version of the parser doesn't support it.
## 🚀 Usage

The package comes with a binary that you can execute from your `package.json`, or with `npm`/`yarn`:
Expand Down

0 comments on commit 6da8764

Please sign in to comment.