Writing npm modules in TypeScript

前端 未结 7 505
醉话见心
醉话见心 2020-11-30 16:58

I am working on my first npm module. I briefly worked with TypeScript before and a big problem was that for many modules there were no definition files available. So I thoug

7条回答
  •  难免孤独
    2020-11-30 17:37

    I mainly follow the suggestion by Varun Chatterji

    But, I would like to show a complete example with unit testing and code coverage and publishing it into npm and importing them using javascript or typescript

    This module is written using typescript 2.2 and it is important to configure the prepublish hook to compile the code using tsc before publish it to npm

    https://github.com/sweetim/haversine-position

    https://www.npmjs.com/package/haversine-position

提交回复
热议问题