DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป is a community of 967,611 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
mohsen
mohsen

Posted on • Originally published at e2e.utopiops.com

How to publish a package to npm

If you've built a package you want to publish as a public package to npm you can follow these steps:

  1. Sign up
  2. Create an organisation
  3. Choose the following option Image description
  4. On the command line, navigate to the root directory of your package
cd /path/to/package
Enter fullscreen mode Exit fullscreen mode
  1. Authorize the machine to publish a package
npm login
Enter fullscreen mode Exit fullscreen mode
  1. Publish the package

Assuming you've built the package correctly, you can publish it like this:

npm publish --access public
Enter fullscreen mode Exit fullscreen mode

If you're interested to see a package publish exactly this way, take a look at this repository:

https://github.com/utopiops/utopiops

Top comments (0)

Need a better mental model for async/await?

Check out this classic DEV post on the subject.

โญ๏ธ๐ŸŽ€ JavaScript Visualized: Promises & Async/Await

async await