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

packin

v0.4.7

Published

a simple package manager

Downloads

32

Readme

packin

All you need a package manager to do is download your dependencies and stick them in a folder. Packin does just this and understands several meta data formats including package.json and component.json so you can consume a wider selection of dependencies.

Here is a few interesting design decisions:

  • Everything symlinked
    Symlinks carry semantic value which other tools can leverage. It also means you don't end up copying dependencies all over your file system.
  • Caching
    Once a package is installed it never needs to be installed again. This makes it super fast and can help you work offline.

Installation

First install node. Then run: npm install packin --global

API

Packin provides an executable designed primarily to be used via make but also provides a few nice commands to help you manage your dependencies.

packin-add deps... [-d]

The add command helps you add dependencies to you ./deps.json file. It takes a list of dependencies in their shorthand form. If the dependecy is just a plain word it is assumed to come from npm.org. If it has one slash its assumed to come from github. If it starts with a . or a / then its assumed to be in the local filesystem. All three cases are demonstrated below:

animation

packin-install [-tpdmfRc]

The install command will recursively walk through all dependencies downloading them if necessary as it goes then add symlinks between all of them under the alias each package expects. Thats right you get to deside the names of the packages you consume not the person who wrote it. Also dependency cycles are fine unlike with npm-install(1). A further difference from npm-install(1) is that it does have some important configuration options so if you project depends on packin-install(1) and is going to be published you should document your configuration in a Makefile.

animation

Notice how the second call returns almost immediatly. This is thanks to packins caching mechanism. Also this cache is global, so the first time install of your projects gets faster the more projects you have previously installed with packin.

packin-update

Iterate through each dependency and query their respective registries for the latest release tag. If the latest one is different from the current one the dep is swapped for the new one.

animation

packin-rm deps... [-d]

This is the undo for packin-add

animation

Programmatic API

install(directory, [options])

install all dependecies of directory

var install = require('packin');
install(__dirname, {
  files: [
    'package.json', 
    'component.json', 
    'deps.json'
  ],                     // files to check for dependency data
  folder: 'node_modules' // install to __dirname/node_modules
  development: false,    // don't install development deps
  production: true,      // install production deps
  retrace: true          // update cached deps
}); // => Promise<Package>

The returned Package gives you access to your whole dependency graph.