g-plane/tiny-package-manager
소개
npm 또는 Yarn v1이 작동하는 방식을 알아보세요.
학습 및 교육What you can do
- Download packages to node_modules directory.
- Simply resolve dependency conflicts.
- Flatten dependencies tree.
- Support lock file. (Like yarn.lock or package-lock.json)
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalTiny Package Manager
A very very simple demo and guide for explaining package manager.
Introduction
As a JavaScript developer, you may use package manager like npm or Yarn frequently.
However, do you know how a package manager works? Or, you may be curious about how to build a package manager.
Well, the purpose of this guide is not to let you re-invent a new wheel. There is no need to do that because both npm and Yarn are mature and stable enough. The purpose is just to explain how a package manager works under the hood. You can read the code, and the comments will explain how it works.
Note: To simplify the guide and make it as simple as possible, this demo doesn't handle some edge cases and catch errors and exceptions. If you are really curious about that, it's recommended to read the source code of npm or Yarn.
Features
- Download packages to
node_modulesdirectory. - Simple CLI.
- Simply resolve dependency conflicts.
- Flatten dependencies tree.
- Support lock file. (Like
yarn.lockorpackage-lock.json) - Add a new package through CLI. (Like
yarn addornpm i <package>command) - Run lifecycle scripts. (
preinstallandpostinstall) - Symlink the
binfiles.
How to start?
Read the source code in the src directory.
You can read the src/index.ts file in the beginning.
If you would like to try this simple package manager, just install it globally:
Via Yarn:
$ yarn global add tiny-package-manager
Via npm:
$ npm i -g tiny-package-manager
Then just go to a directory which contains valid package.json and run:
$ tiny-pm
License
MIT License (c) 2018-present Pig Fang
관련 프로젝트 살펴보기
불러오는 중…