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

nslm

v0.0.10

Published

Symbolically link node packages en masse for local development

Downloads

14

Readme

nslm - Node Symbolic Link Manager

Symbolically link node packages en masse for local development

NOTE: Some features have not been documented yet!

Installation

Ensure you have node version 14 or above:

node -v

Install globally with npm:

sudo npm install -g nslm

Usage

Register

  • nslm register will recursively search all directories in the current working directory for node modules, saving their locations to ~/.nslm/modules.json
  • The locations registered will be what's used as the source for the given modules when linking.
  • As the command searches recursively, you may only need to run it once to capture all of your node projects. For example if you keep all of your node projects within a directory named Git repos, you can simply run nslm register in that folder and it'll register everything.
  • You'll only need to run the command again you wish to register a brand new module or move the location of any of them.
  • No additional arguments are required for this command.

Link

  • nslm link needs arguments. You have a few options:
    • --pathscontaining will link every single module that contains one or more given strings in its path (separated by spaces). For example you can run nslm link --pathscontaining my-directory-1 my-directory-2 and it will attempt link every module which contains either my-directory-1 or my-directory-2 in their paths.
    • --modules will only link modules that match the exact name given. For example nslm link --modules my-node-project will only link the package with the name my-node-project.
    • --a or --all will link every single module you registered with nslm register. This probably won't be what you want to do most of the time!
  • By default it will only link modules that you've already installed. For example let's say you want to link everything in my-directory-1 to my-node-project. If you haven't run npm install or yarn install (ie. the package isn't yet included in package.json), it will not link anything. To bypass this and link it anyway, add the --allowmissing argument. For example nslm link --pathscontaining my-directory-1 my-directory-2 --allowmissing
  • Be careful about running npm install or yarn install after you've linked a module to something, as this may unlink one or more modules. To fix, simply relink the module again.

Delink

  • nslm delink works in the same way as npm link, with most of the same arguments, but in reverse. Use it to put things back to normal. The --allowmissing argument won't do anything here.
  • You may want to use the --all argument most of the time to ensure everything has been reset in the given directory, rather than removing modules one at a time. It'll not only remove the symbolic links but will also try to restore your original local copy of the given module.
    • For example let's say you're working in my-node-project and you've nslm linked a module called excellent-project. When I run nslm delink --all it'll remove that link and replace it with the module that was installed before you linked anything. If the module was missing to begin with (ie. you used the --allowmissing arg on nslm link) then nothing will be restored as nothing would've been there to back up in the first place.