require-esm

1.0.0 • Public • Published

require-esm

Use default while requiring an esmodule

How to use

// a.js
export default 1;
 
// b.js
import req from 'require-esm';
// import a from 'a'
// const a = require('a').default;
const a = req(require('a'));
export default { a, b: 2 }

Package Sidebar

Install

npm i require-esm

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

2.23 kB

Total Files

4

Last publish

Collaborators

  • kingback