@navaru/es

Converts ES Modules to CommonJS on runtime

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
@navaru/es
Minified + gzip package size for @navaru/es in KB

Readme

@navaru/es

A set of tools for JS module development

Installation

  $ npm install @navaru/es

API

@navaru/es/register

Convert ES Modules to CommonJS on runtime:

read.js

import { readFile } from 'fs'

export default (path, handler) => {
  readFile(path, 'utf8', handler)
}

index.js

require('@navaru/es/register')

const read = require('./read.js')

es

Run ES Modules files:

passwords.js

import { readFileSync } from 'fs'

console.log(readFileSync('/etc/passwd', 'utf8'))
 ▸ es passwords.js

License ISC  ·  GitHub @navaru  ·  Twitter @navaru

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.