wajatimur / node-phonenumber

Google's phone number handling library ported to Node
33 stars 5 forks source link

Tips on converting a closure library to nodejs for npm? #4

Closed trusktr closed 9 years ago

trusktr commented 9 years ago

Hello, would have any tips on how to convert this library, webglearth2, to nodejs to publish it on npm?

wajatimur commented 9 years ago

@trusktr the concept is simple, you have to create stub project (simply clone) of webglearth2 in you npm library folder then you have to bootstrap it by using require in you main npm file in this case might be index.js. Lastly you have to expose the webglearth2 object using export. If you inspect the index.js of node-phonenumber you can see significant line of code from 3-5 and 80. Please let me know if you do start the npm lib.

trusktr commented 9 years ago

Cool, thanks for the tip. @wajatimur You've made it sound fairly easy.

@klokan ^

wajatimur commented 9 years ago

Welcome @trusktr