https://github.com/gera2ld/locky
Transform lock files for different registries.
https://github.com/gera2ld/locky
Last synced: about 2 months ago
JSON representation
Transform lock files for different registries.
- Host: GitHub
- URL: https://github.com/gera2ld/locky
- Owner: gera2ld
- Created: 2020-03-22T16:31:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-20T05:26:53.000Z (over 5 years ago)
- Last Synced: 2026-05-12T00:32:14.734Z (2 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @gera2ld/locky



Transform `yarn.lock` files for different registries.
Requires Node.js greater than v10.0.
## Why
`yarn.lock` has a `resolved` field that contains the full URL to the tarball of each dependency. When installing with the lock file, the package manager will download the package with the `resolved` URL instead of resolving it with the name and version.
There is a chance that different users have different network conditions, and they may expect different registry to use, resulting as different resolved URLs to download.
For example, in China the NPM registry is slow and people use [taobao registry](https://developer.aliyun.com/mirror/NPM) instead. But for people outside China, it is just the opposite.
With this package, you can always transform the lock file with resolved URLs on an expected registry so that other people could easily install them.
## Installation
You can even use it without installation, via `npx`.
Or install it globally:
```sh
$ yarn global add @gera2ld/locky
```
## Usage
```
Usage: locky yarn [options]
Transform a yarn.lock file
Options:
-t, --throw Throw exception if lock file is changed
-h, --help display help for command
```
```sh
# transform the yarn.lock to resolve to npm registry
$ locky yarn npm
# use with npx
$ npx @gera2ld/locky yarn npm
```