All Articles

How to test library using private registry

I recently need a private npm registry for testing a standalone library before publishing it to npm.

Verdaccio came to mind - I recall it is introduced via a framework publish showcase. Verdaccio is a simple, zero-config-required local private npm registry.

Install Verdaccio

yarn global add verdaccio@6-next

Start it

verdaccio

Visit http://localhost:4873/.

This is the private registry

Create user

npm adduser --registry http://localhost:4873

Publish

npm publish --registry http://localhost:4873

Visit http://localhost:4873/.

Verify the node module has been published

npm link is also very convenient for testing the library before publish.

But it cannot completely simulate the production ENV.

I would suggest using Verdaccio afterwards.


Happy new year!!!

I haven’t publish anything in last two month because some life updates.

I feel very energized about updating my blog again.

I’m currently sitting in a warm apartment.

Fresh air, unblocked internet and sparkling water perfectly fit in.

Published Jan 11, 2023

Personal blog. I share frontend development technique and life.