https://github.com/jeromewu/npm-vs-yarn-in-cicd
A (hopefully) comprehensive speed experiment for npm and yarn install in cicd
https://github.com/jeromewu/npm-vs-yarn-in-cicd
Last synced: about 1 year ago
JSON representation
A (hopefully) comprehensive speed experiment for npm and yarn install in cicd
- Host: GitHub
- URL: https://github.com/jeromewu/npm-vs-yarn-in-cicd
- Owner: jeromewu
- License: mit
- Created: 2020-03-26T02:48:50.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-07-20T23:16:33.000Z (almost 4 years ago)
- Last Synced: 2025-03-31T02:13:43.211Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 5.98 MB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# npm vs yarn in CI/CD pipeline
A (hopefully) comprehensive speed experiment for npm and yarn install in CI/CD pipeline
Check [HERE](https://medium.com/@jeromewus/how-to-speed-up-node-js-modules-installation-in-ci-cd-pipeline-as-of-2020-4865d77c0eb7) for the result of this experiment!
## Preparation
Before starting the experiment, please run `bootstrap.sh` to:
- Start local registry
- Generate cache in local registry
- Generate node\_modules.tar.gz
- Generate cache.tar.gz
```
$ bash bootstrap.sh
```
After the experiment, don't forget to run followin command to clean up local registry:
```
$ bash stop-local-registry.sh
```
## Execution
You can use `run-test.sh` to run experiments, the syntax are like this:
```
$ bash run-test.sh c-
```
There are 5 commands you can use:
- npm-install
- npm-ci
- yarn-install
- yarn-install-fl
- pnpm-install
For example, if you want to execute `npm install` in configuration #1 (FFFF) for 3 iterations:
```
$ bash run-test.sh 3 c1-npm-install
```
Sample output:
```
Run c1-npm-install 3 times
[1]: Spend 35.150 Seconds.
Average: 35 Seconds.
[2]: Spend 32.064 Seconds.
Average: 33 Seconds.
[3]: Spend 27.108 Seconds.
Average: 31 Seconds.
```