https://github.com/scalvert/link-tarball
Link another package's tarball to this package
https://github.com/scalvert/link-tarball
Last synced: 5 months ago
JSON representation
Link another package's tarball to this package
- Host: GitHub
- URL: https://github.com/scalvert/link-tarball
- Owner: scalvert
- Created: 2023-05-11T22:43:36.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-07T16:52:34.000Z (about 2 years ago)
- Last Synced: 2025-01-06T20:41:06.055Z (6 months ago)
- Language: TypeScript
- Size: 282 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# link-tarball

[](https://badge.fury.io/js/link-tarball)
[](https://github.com/checkupjs/checkup/blob/master/package.json)

Link another package's tarball to this package
## Usage
```sh
npx link-tarball
```Running `npx link-tarball` will build a tarball of the package at the given path and link it to the current package. This is useful for testing changes to a package who's dependencies may interfere with the current package's dependencies, such as React.
## Example
Let's say you have a package called `my-package` that depends on `some-other-package`. You want to test a change to `some-other-package` in `my-package`, but `some-other-package` depends on React, which is also a dependency of `my-package`. This will cause React to be installed twice, which will cause errors.
To avoid this, you can link `some-other-package`'s tarball to `my-package`, which will circumvent the dependency resolution process. To do this, run the following command in `my-package`'s root:
```sh
npx link-tarball ../some-other-package
✔ Successfully linked some-other-package.tar.gz to my-package
```Now, in `my-package`'s root, run node with the following arguments:
```sh
node --preserve-symlinks --preserve-symlinks-main
```This will ensure that the linked tarball is used instead of the installed version of the package.