NativeScript modules are JavaScript modules that adhere to the CommonJS specification and provide access to native APIs through the NativeScript runtime. Because NativeScript modules adhere to CommonJS, npm is a perfect place to store them. For more details on what NativeScript modules, how they work, and how to write your own, check out the link below.
Read Building Your Own NativeScript Modules on the Telerik Developer Network