I have a .TS file where I store all of my utility functions that I use in alot of my projects (kind of like my own private lodash) However every time I want to use this I have to manually copy and paste this file into the project that I am working on. I also know how to use node to make scripts and write to the file system using FS, my question is how do I make this node script available globally without having to specify ".js" so I can use it in the terminal like this: "node loadLibrary"?
TL;DR
How do I make .js files available to node globally so I do not have to specify the path and just call the script by name EX: "node loadLibrary"
npm -g installwill install a module globally and then any project can use that module with justimport "someLibrary"orrequire("someLibrary")