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

@318h7/nlink

v1.3.0

Published

node linking utility

Downloads

34

Readme

nlink

pipeline coverage TypeScript MIT Licence tested with jest semantic-release PRs Welcome

nlink is a CLI utility to aid linking Node.js projects for development

  • wrapper around npm\yarn link
  • analyzes multi-repo folder to create a map of interdependent projects
  • links projects to bring mono-repo powers to multi-repos
  • TypeScript friendly
  • contextual actions to aid linking during development

Status

The project is in beta phase. PRs are very welcome. As well as issues and suggestions

If something isn't working for you, do raise an issue.

Work in progress:

  • Typescript type safe linking
  • Scope (wildcard) matching

Planned functionality:

  • Watch mode (link and wait, then unlink on quit)

Installation

yarn

yarn global add @318h7/nlink

npm

npm install -g @318h7/nlink

Note: You will probably need to run the commands with sudo

Usage

nlk [command]

Commands:
  nlk setup          Creates project map in the current location
  nlk link [name]    Links project dependencies
  nlk unlink [name]  Uninks project dependencies

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

Description

Setup

To analyze a folder and link all developed projects together:

cd projects/my_multy_repo
nlk setup
nlk link

The setup command will traverse current directory in search of node projects, and save a map in the file .nlink.json Don't be afraid to edit the file manually according to your needs, it's just a plane JSON. After creating the file it will run yarn/npm link to register projects for linking. Running link command without parameters will link together all developed projects. Consequent runs of setup will just prepare the links.

In order to regenerate the projects map:

nlk setup --force

Linking 🔗

Info

  • nlink accepts the package name (name field in the package.json) or the folder name where the project is located as a dependency name.

  • nlink will detect if project is using npm or yarn as dependency manager and execute the appropriate command.

  • nlink will also detect if project is using TypeScript and check if any other project dependencies depend on the same package you are trying to link. It will link all related projects, to avoid type errors in case of incompatible type update in related projects.

Commands

To setup links for all project dependencies:

cd project_in_question
nlk link

Note: If run from a projects that has no dependencies, creates links in all projects that depend on that package:

To link a dependency:

cd depending_project
nlk link <dependency>

Note: If run from a project that has no named dependency, will try to link current directory project in the named one.

To link couple of packages:

cd depending_project
nlk link <dependency_A> <dependency_B>

To link scoped packages:

cd depending_project
nlk link @example/**

Will link all dependencies that have @example scope in the name.

🦄 To link all the dependencies in the multi-repo:

cd <folder with .nlink.json>
nlk link