1.0.0 • Published 6 years ago

tinypm v1.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

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