imprt

0.0.0 • Public • Published

imprt

Evaluate ES2015 module statements in Node.js and webpack-based applications.

Intention

Node.js 6.x does not yet support the ES2015 module syntax. This module intends to make the transition easier as soon Node.js might implement the proposal "ES6 Module Interoperability" in its core.

Currently, solely the import statement is supported.

Solution

imprt tokenizes, parses the given string and returns the result according to the specified ES2015 expression by calling Node.js require().

Usage

const imprt = require('imprt'); const buf = imprt('import buffer'); console.log(new buf.Buffer([0x47, 0x49, 0x46, 0x38, 0x39, 61]).toString('utf8'));

License

MIT (see LICENSE)

Package Sidebar

Install

npm i imprt

Weekly Downloads

1

Version

0.0.0

License

MIT

Last publish

Collaborators

  • cmtt