imprt
v0.0.0
Published
Executes ES2015 / ES6 module statements
Downloads
7
Maintainers
Readme
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)