How to publish a module written in ES6 to NPM?

前端 未结 11 622
自闭症患者
自闭症患者 2020-11-29 15:22

I was about to publish a module to NPM, when I thought about rewriting it in ES6, to both future-proof it, and learn ES6. I\'ve used Babel to transpile to ES5, and run tests

11条回答
  •  执笔经年
    2020-11-29 15:46

    If you want to see this in action in a very simple small open source Node module then take a look at nth-day (which I started - also other contributors). Look in the package.json file and at the prepublish step which will lead you to where and how to do this. If you clone that module you can run it locally and use it as a template for yous.

提交回复
热议问题