Skip to main content
Hendoi

How to Publish Your First NPM Package Step by Step

7 min read

Publishing your first NPM package is straightforward if you follow a few steps. Here’s a concise guide so you can ship your first package and iterate.

Create a folder with a package.json: name (scoped like @yourorg/package-name if you want), version (start at 1.0.0), main (or exports) pointing to your entry file, and keywords for discoverability. Add a README with install, usage, and API overview. Run npm pack locally to ensure the tarball looks correct.

Sign up at npmjs.com if you don’t have an account. Run npm login in the terminal and enter your credentials. Use 2FA for security.

Run npm publish (or npm publish --access public for scoped packages the first time). Your package will be live on the registry. Double-check the name—it’s permanent once published.

Make changes, bump version in package.json (patch: 1.0.1, minor: 1.1.0, major: 2.0.0). Run npm publish again. Follow semver so users know what to expect from updates.

Respond to issues, keep the README and types up to date, and deprecate gracefully if you need to retire the package. Consider automation (CI to run tests and publish on tag).

If you’d rather focus on your product and want a team to build and maintain NPM packages for you, Hendoi Technologies ships and maintains packages for companies in the USA, Canada, and Bengaluru. Get in touch.

📞 +91-9677261485 | 📧 support@hendoi.in | Contact us

Showing slide 1 of 6. Use the buttons below to change slide.

Need web app, mobile app, or desktop app development? We serve USA, Canada, and Bengaluru. React Native, Flutter, MCP servers, AI chatbots, SDKs, APIs. Explore our services and blog for more.

Book a Free Consultation