npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yarn-relink

v1.3.1

Published

[![GitHub stars](https://img.shields.io/github/stars/fdt2k/relink.svg?style=social&label=Stars)](https://github.com/fdt2k/relink)

Downloads

7

Readme

relink

GitHub stars

Relinks packages from package.json

Please ★ this repo if you found it useful ★ ★ ★

Story Time

Relink is a script for Yarn that allow you to use your use and work on your local packages as you go without republishing them every time.

I came up with this while working on my microservices libs, I had a sh*t load of packages and a lot of stuff to modify at the same time with micromanaging unittests & dependencies. Publishing or manually linking them was not a productive option.

It's also useful with React, to use the same version if you develop hooks or stuff that requires an identical version of react that persist even when you add a new dep with yarn (which sometimes decide to remove the link of your linked deps)

Usage

install

yarn global add yarn-relink

usage

Let's say you work on lib-a and lib-b, lib-a being a dep of lib-b

Add the following to your lib-b package.json

{
    ... 
    "links": [
        "lib-a"
    ],
    "scripts": {
        "prepare": "relink",
        "relink": "relink",
        .... your scripts ... 
    },
    ...
}

then in lib-a folder, just use yarn link as usual

$> yarn link 

success Registered "lib-a".
info You can now run `yarn link "lib-a"` in the projects where you want to use this package and it will be used instead.
Done in 0.04s.

and in lib-b folder

$> yarn link lib-a

yarn link v1.22.10
success Using linked package for "lib-a".
Done in 0.03s.

And you're good to go.

Now everytime you use yarn add or yarn install, it'll automatically reapply links and reapply links in your linked packages.

Bonus stage: if you use nodemon to automatically reload while coding you can now do it for your whole lib chain by adding a line like this. Doing this in all your local dev libs, will allow you to automagically reload the whole dependency chain.

...
"scripts": {
    ...
    "start:dev": "nodemon $(relink -w) --watch src  src/index.js"
    ...
}
...

To use this feature you HAVE TO add a nodemon.json file at the root of your project folder or the watch deamon will not work.

nodemon.json

{
    "ignoreRoot": [".git"]
}

Todo

  • relink.json instead of using package.json
  • add max_depth as an argument
  • categorize the links so you don't have to watch all the links in nodemon.

Contribute

Contribute usage docs

Support

Submit an issue

Contributing

Review the guidelines for contributing

License

MIT License

Fabien Karsegard © 2020

Changelog

Review the changelog

Credits