How to Test an NPM Package Locally

If you’re developing your own npm package, it’s important to test it locally before publishing. This is especially useful when you want to modularize your project and reuse specific functionality. To demonstrate, let’s say I have a package called flaviocopes-common-database. I’ve given it a unique namespace by prefixing it with flaviocopes-. Inside the package directory, I’ve added a package.json file that includes the module name and its dependencies: { "name": "flaviocopes-common-database", "version": "1....