question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

option to generate an es module instead of commonjs module

See original GitHub issue

Issue type

Feature Request:

Description

When pegjs produces an output .js file, it is in common js format:

module.exports = {
  SyntaxError: peg$SyntaxError,
  parse:       peg$parse
};

I want the output as an es module instead:

export { peg$parse as parse, peg$SyntaxError as SyntaxError };

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12

github_iconTop GitHub Comments

4reactions
hildjjcommented, Apr 15, 2021

Yes, it’s resolved in Peggy. We’re working toward a first release within days, I hope.

0reactions
mreinsteincommented, Apr 23, 2021

Same, I’m migragted to peggy!

Read more comments on GitHub >

github_iconTop Results From Across the Web

CommonJS vs. ES modules in Node.js - LogRocket Blog
ES modules are the standard for JavaScript, while CommonJS is the default in Node. js. The ES module format was created to standardize...
Read more >
CommonJS vs ES Modules in Node.js - A Detailed Comparison
CommonJS modules are a popular way to modularize JavaScript code. They allow you to export and import modules using the export and import ......
Read more >
CommonJS vs. ES Modules: Modules and Imports in NodeJS
We are going to have a look into CommonJS and ES Modules. ... Here we import the http module in order to create...
Read more >
Upgrade your Node app: From CommonJS to ES Modules
Step by step: From CommonJS to ES Modules · 1) Prepare your code · 2) Update the package.json · 3) Convert all imports...
Read more >
NodeJS — Using ES Modules Instead of CommonJS
Make your own project folder to start using ES Modules in your code, name whatever you want, go inside that folder, and start...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found