MV Installing a NPM Library in your RM project?

I know how to go about adding a library if I am provided a single JS file- for example, with loglevel.js I just move that file into my project's js/lib folder and edit main.js:

folder_JS-Libs.PNG

scriptLibs.PNG

And, voilà, I can use log.warn(), etc.:
loglevel_example.PNG


But what if a library doesn't provide the JS file and asks you to install it using a command line?
npmInstall.PNG


Thanks 🙂
I know how to go about adding a library if I am provided a single JS file- for example, with loglevel.js I just move that file into my project's js/lib folder and edit main.js:
Huh... why do all that when you can just add the js file to your plugins folder and enable it on the plugin manager?

But what if a library doesn't provide the JS file and asks you to install it using a command line?
View attachment 176641

Thanks 🙂
Sometimes you can find the js file on the github repository, but gm is **a lot** more than just some Javascript code. It's not impossible to make it work on nw.js, but it's not a matter of just copying files to the right place either. Before you dive into that, it's important for you to know exactly what you're working with.

Original thread: https://forums.rpgmakerweb.com/threads/installing-a-npm-library-in-your-rm-project.132530/