Build your own Package Manager
A tiny npm: resolve version ranges from the registry, build the dependency tree, verify downloads and write a lockfile.
- Intermediate
- About 6–12 h
- 4 checkpoints
- 1 tutorial · TypeScript
Pick a tutorial, then check yourself at each checkpoint. Work in any language you like.
Choose a tutorialWhy build it
Dependency resolution is a graph problem with security consequences. Building it explains lockfiles, version ranges, and why supply-chain attacks target installs.
You will be able to
- Resolve semver ranges against registry metadata.
- Build a dependency tree and handle conflicting versions.
- Write a lockfile that makes installs reproducible.
- Verify package integrity hashes before extracting.
Skills it exercises
Recommended on DevOps Engineer, Frontend Engineer and Cybersecurity Engineer.
How you know you are there
Work in any language. Each checkpoint ends with something you can run or observe, so you can check it yourself.
- Checkpoint 1Self-check
Resolve
Done when: Given a package.json, your tool fetches registry metadata and picks a version that satisfies each range.
- Checkpoint 2Self-check
Install
Done when: Tarballs are downloaded, checked against their integrity hash and extracted into node_modules, and a small project runs.
- Checkpoint 3Self-check
Lockfile
Done when: A second install from the lockfile produces identical node_modules without resolving again.
- Checkpoint 4Self-check
Conflicts
Done when: Two dependencies that need incompatible versions of the same package both work.
Stretch goals
- Parallel downloads with a local cache.
- Refuse install scripts unless the package is allow-listed.
Step-by-step guides
Pick one in a language you know (tutorial languages: TypeScript). They open on the author’s site.
- TypeScript
Tiny Package Manager: Learns how npm or Yarn works(external site)
TypeScript: a minimal, commented npm.
Practice builds are self-paced: Tech Atlas does not track them or count them as evidence. To show a skill, take its knowledge check from the skill page.
Tutorials come from codecrafters-io/build-your-own-x (CC0, snapshot of 2026-07-14, commit aa17439; links checked on 2026-10-19). Each tutorial belongs to its author and keeps its own licence; Tech Atlas links to it and does not host it. Briefs, checkpoints and the mapping to skills are Tech Atlas editorial drafts.