zenparsing / es6now

ECMAScript 6 to 5 Compiler and Runtime Environment
MIT License
29 stars 2 forks source link

Export module for node usage #17

Closed Bartvds closed 10 years ago

Bartvds commented 10 years ago

I'd like to be able to use the translator as a module in a build script or build plugin.

To be able to do this most effetively a module needs to be exported as main field in package.json.

And maybe use a npm prepublish command and push the module as ES5 so it doesn't need a new --harmony process.

zenparsing commented 10 years ago

This should already be possible. I've added instructions to the README for using es6now as a library:

https://github.com/zenparsing/es6now#api

Does this work for you? If not, please let me know!

Bartvds commented 10 years ago

Oh, I didn't try yet, though it wasn't supported.

But I tried just now and it totally works as described in the readme, and without --harmony so that's cool too.

Very nice, I'll close this issue then.

Bartvds commented 10 years ago

This exists now: https://www.npmjs.org/package/grunt-es6now

Cheers :+1: