Free course

npm and Package Publishing Course

Create, test, package, publish, secure, version, and maintain a small npm package as a real consumer contract.

5 modules · 25 lessons · No signup

Prerequisites: JavaScript and Node.js

~~~

Your progress

of lessons completed.

Course completed.

What you'll learn

Publish and verify a small npm package with intentional exports, dependency policy, consumer tests, a release gate, and a recovery plan.

Course contents

  1. Package foundations

    Define the contract, metadata, exports, license, and packed artifact.

    1. ✓ Decide what the package owns
    2. ✓ Write package.json deliberately
    3. ✓ Design package exports
    4. ✓ Inspect the package tarball
    5. ✓ Check your understanding: package foundations
  2. Versions and dependencies

    Use semantic versions, ranges, lockfiles, dependency roles, and peer contracts.

    1. ✓ Use semantic versioning
    2. ✓ Read version ranges
    3. ✓ Separate dependency roles
    4. ✓ Use lockfiles with purpose
    5. ✓ Check your understanding: versions and dependencies
  3. Local package development

    Build, test, consume, and develop packages through scripts and workspaces.

    1. ✓ Design package scripts
    2. ✓ Test from a real consumer
    3. ✓ Use workspaces with clear boundaries
    4. ✓ Publish types and build output
    5. ✓ Check your understanding: local package development
  4. Publish safely

    Protect registry identity, run a release gate, publish, verify, and recover.

    1. ✓ Prepare the registry identity
    2. ✓ Run the release gate
    3. ✓ Publish and verify
    4. ✓ Recover from a bad release
    5. ✓ Check your understanding: publish safely
  5. Maintain the package

    Protect compatibility, communicate changes, update dependencies, and retire responsibly.

    1. ✓ Protect the public contract
    2. ✓ Write useful release notes
    3. ✓ Update dependencies with evidence
    4. ✓ Deprecate and retire
    5. ✓ Check your understanding: maintain the package