tinypm
v1.0.0
Published
<p align="center"> <img alt="TinyPM Logo" src="http://ww1.sinaimg.cn/large/9b85365dgy1fnjev4v3j6j208a02q746" /> </p>
Downloads
4
Readme
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.
- resolve: read package.json and resolve the whole dependency tree
- optimize: optimize the dependency tree, try to flat it as much as we can
- 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