Where to put my own modules

I am starting to get more organised with my code and am now creating my own node.js modules to compartmentalise the bits of code I’m writing.

The question I have now is, what is the best way to pull in a node module I’ve written myself (and is stored on github) so that it’s usable by a plugin?

I know I can use package.json to pull in a github repository, and then use npm install to install it, but I can’t figure out where this actually goes on the system - it doesn’t seem to appear in volumio/node_modules

To be clear - these modules aren’t plugins. They are modules that I want my plugins to reference.

I do need to find out where it’s being installed so I can set some environmental things within it.

Any help appreciated!

have a look here : Plugin system overview | Volumio Developers Documentation

Thanks for the reply!

I can’t see the answer to my question there though - that page you posted is generally about plugins and how they work. I couldn’t see anything about where to put other modules (that aren’t plugins)

Could you give me any more specific guidance?

I updated my question to clarify that these modules are not plugins. They are modules that I want to reference and use in my plugins

If you read what I sent, you’ll see the doc is howto write a plugin…

I know how to write a plugin

That wasn’t my question.

Do you know the answer to what I asked? I would really appreciate it

Maybe I can ask this in a simpler way.

When I add a package to a plugin’s package.json and install it with “npm install” where does it go?

In the plugin folder.

It goes in the plugin folder, which will eventually be copied under

/data/plugins/PLUGIN_CATEGORY/PLUGIN_NAME/node_modules/MODULE_NAME