Create a Vanilla JavaScript Package on npm

November 2025

These are my notes for creating the npm package for bitty

  • Pick the folder you want to use for the package and do the following
  • Create a package.json file using @username for the scope along with the name of the project.

    {
      "name": "@alanwsmith/test-package",
      "version": "1.0.0",
      "description": "a test package to see how things work",
      "license": "CC0-1.0",
      "author": "Alan W. Smith"
    }
  • Create a README.md file next to the package.json file with details about the package.
  • Log into npm if you aren't already (can check with npm whoami)

    npm login

  • Publish the package with:

    npm publish --access public
end of line