npm.io
1.0.0 • Published 8 years agoCLI

tinypm

Licence
MIT
Version
1.0.0
Deps
9
Vulns
25
Weekly
0

TinyPM Logo

A tiny nodejs package manager built for fun

Intro

this project is heavily inspired by the awesome post: Let's Dev: A Package Manager but reimplement it from scratch.

It has a clean code base, add some tests and remove babel-node requirement compared to original implementation.

Usage

just type tinypm and you are done .

Implementation

the whole process is divided into 3 steps implemented in corresponding js files.

  1. resolve: read package.json and resolve the whole dependency tree
  2. optimize: optimize the dependency tree, try to flat it as much as we can
  3. link: download packages and link them to node_modules folder

to speed up the processing, tinypm uses /tmp/.tinypm as cache dir.

Notes

as the original implementation, the binary installation directory is wrong.

e.g. if package A depends on package B which has a binary called cli-b, tinypm will install cli-b to root/node_modules/.bin/cli-b, but the correct location is root/node_modules/A/node_modules/.bin/cli-b.

License

Released under the MIT license