1

If I'm developing a library which work is based a lot around of current working directory and the filesystem generally, a lot of paths resolution, and I want to see how it will behave when will be installed as a node module, I don't want to get unexpected results when I'll upload it to the npm. How do I test my library behavior pretending it's a node module? Is placing its folder in node_modules enough?

felps321
  • 357
  • 4
  • 10

1 Answers1

1

Make a local package and install it everywhere:

$ npm pack

it will generate a zipped file, so you can copy somewhere and install it.

// another project
$ npm install /path/to/pack

Resources: npm pack, Add local package

Absolutely you can use npm link too. link

Raeisi
  • 1,647
  • 1
  • 6
  • 18