Creating a custom npm package with large csv and json files

Hey everyone!

I have a question on behalf of a friend of mine - we are working on a Vue.js / electron app and I would like to move a section of my code into a module, however I have rather large csv and json files which I need to load during setup (initiated during app launch)

Does anyone know, or have you ever created an NPM package, with these types of data files, and have them auto loaded when a module is loaded? (Anywhere from 5 to 25Mb)

Maybe I am searching for the wrong thing, but everything I find is for loading files from common paths, not within an actual module itself. Plus, I don’t want to have to copy the data files into the main project, I would rather they all stay self contained within the module.

Any pointers or links to example modules would be awesome. Thanks in advance!!

I just finished creating a npm package yesterday that i needed for a project.It takes github username and repo as arguments and extracts all the dependencies and dev-dependencies used in that repo. You can take a look and see if this helps you in any way .

Thanks for the reply! I’ll check this out.

There’s no reason why you can’t do that (have a module that is effectively just read-only data). With it being client side it’s just a case of loading JSON in the same way you would any other fetch request (although given the size you would probably want it in a worker so it isn’t loaded on the same thread as the app). But can you explain a bit more what you mean? What’s the use case?