Прокси-сервер реестра NPM, скрывающий версии пакетов, выпущенные после указанной даты

e22m4u f52493fa75 chore: initial commit 1 месяц назад
.gitignore f52493fa75 chore: initial commit 1 месяц назад
.goreleaser.yml f52493fa75 chore: initial commit 1 месяц назад
LICENSE f52493fa75 chore: initial commit 1 месяц назад
README.md f52493fa75 chore: initial commit 1 месяц назад
go.mod f52493fa75 chore: initial commit 1 месяц назад
main.go f52493fa75 chore: initial commit 1 месяц назад
start.sh f52493fa75 chore: initial commit 1 месяц назад

README.md

NPM Proxy Time Machine

A proxy for the NPM registry that hides package versions released after a specified date.

Usage

Start the proxy with a specified date.

./nptm --port=9000 --date=2021-12-05

Node.js configuration

Switch to a Node.js version for that date.

nvm install 12
nvm use 12

Or if you are using a project-wide .nvmrc, just run nvm use.

Option 1: Global NPM configuration

Check your current registry URL and save it (to restore later).

npm config get registry

Set the proxy as your NPM registry.

npm config set registry http://localhost:9000/

Option 2: Local NPM configuration (project-wide)

Create an .npmrc file in your project with the proxy URL.

registry=http://localhost:9000/

That's it

Now you can run npm install for your project. Dependencies will be resolved as of the specified date.

Build

You need Go installed to build this project.

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o nptm .

License

MIT