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

slnpm

v1.2.1

Published

An alternative package installer using symbolic link.

Downloads

6

Readme

slnpm

A simple and fast node.js package manager using symbolic link.

npm Package Version

The design is heavily inspired by pnpm, which downloads and caches each npm package, then setup hardlink of each file to the project's node_modules. However, this package setup symbolic link (softlink) of each package's directory.

Installation

npm i -g slnpm

Feature

  • save network - only need to download each package once
  • save disk space - only need to store each package once
  • save time - faster than npm and pnpm

Advantages over pnpm

  1. This tool setup symbolic link instead of hardlink, this allows the cache to be used across different file-systems / partitions

  2. This tool setup link per package (directory) instead of per file, which takes less time

Functions

  • [x] install packages
    • [x] read package list from package.json
      • [x] support dependencies
      • [x] support devDependencies
      • [x] support peerDependencies
    • [x] add new packages to package.json
      • [x] save to dependencies
      • [x] save to devDependencies
      • [x] support @types shortcuts with <package>:ts and <package>:dts format to auto install @types/<package> to dependencies and devDependencies correspondingly
    • [x] support multiple source type
      • [x] npm package
      • [x] link: package*
      • [x] file: package**
    • [x] support "bin" in packages.json (setup symbolic link in node_modules/.bin)
    • [x] recursively install in every package / project
  • [x] remove packages
    • [x] remove extra packages not specified in package.json
    • [x] remove specified packages from package.json

Remarks:

link: package*: the dependencies are not further installed, slnpm assumes the linked package has already been built and installed it's own dependencies

file: package**: treated same as link: package in current version

Benchmark

The benchmark is done using this package's dependencies as example.

node_modules and lock files are deleted before each run, and all packages were already cached by the installers.

The test was conducted on laptop with zst-compressed zfs and desktop with zst-compressed btrfs. The result is almost identical.

| Package Installer | Time used | | ----------------- | --------- | | slnpm | 0.1s | | pnpm | 1.6s | | npm | 2.1s |

Remark:

  • --prefer-offline flag is used in pnpm's test
  • The time used is measured by the linux command time
  • The time used is average of 5 runs
  • slnpm actually only takes 39ms for the actual installation process but I cannot separate the time used to load dependencies from other installers so this matrix is not compared

License

This project is licensed with BSD-2-Clause

This is free, libre, and open-source software. It comes down to four essential freedoms [ref]:

  • The freedom to run the program as you wish, for any purpose
  • The freedom to study how the program works, and change it so it does your computing as you wish
  • The freedom to redistribute copies so you can help others
  • The freedom to distribute copies of your modified versions to others