0

I'm facing the problem to import a min.js file into a nodejs project. I don't have an HTML file (I'm using express.js for backend activities) therefore I cannot import it in the normal way.

You can ask why I need a minified file inside the project. I forked another npm package and I made some edit to it. I don't want to publish it on npm since I need to test it first but I don't want to copy and paste the entire project inside others.

A min.js is perfect since it can places in many projects without effort.

Is it then possible? Do you know best practices regarding this problem?

EDIT: The minified file was useful in a DOM context but I don't need to have it. It would be really handy if I could use it also in Nodejs.

What I need it's to import an edited npm package in other projects such that I don't need to copy and paste it every time in each project folder.

Other ways using package.json would be great.

Thank you in advance!

stefanodecillis
  • 160
  • 1
  • 1
  • 7
  • It really isn't clear what you are asking here. The [tag:min.js] library you have tagged is for manipulating HTML documents. It has nothing to do with minification and it makes no sense to run it inside Node.js. – Quentin May 21 '21 at 11:05
  • If you have forked an NPM package, then it really isn't clear why you have minified it. Nor is it clear **how** you have done so. – Quentin May 21 '21 at 11:06
  • This feels like an [XY Problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). Are you trying to ask [How to install a private NPM module without my own registry?](https://stackoverflow.com/questions/10386310/how-to-install-a-private-npm-module-without-my-own-registry)? – Quentin May 21 '21 at 11:08
  • Thank you for your comments, I edited my question! Hope that it's now more clear – stefanodecillis May 21 '21 at 11:55

0 Answers0