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 🙏

© 2025 – Pkg Stats / Ryan Hefner

packagesmith

v1.1.2

Published

Provisioning/scaffolding tool for Rapid Development

Readme

PackageSmith

PackageSmith is a library to help you make tools which can intelligently generate & maintain (or provision, or scaffold) projects quickly and easily.

If you typically create & use "boilerplate" repositories and modify them, or if you have a project where you copy folders/files into new destinations, just so you can re-use the boilerplate code from them; then this tool may be able to help you - rather than making a boilerplate, you can make an intelligent provisioning tool which can generate & maintain a package.

Install

This is a utility library, to use on top of your own tools. To get it working, simply run:

$ npm install --save packagesmith@latest

However, PackageSmith comes with a handy provisioning tool, to provision your own PackageSmith tools! Simply run:

# Locally
$ npm install --save packagesmith@latest
$ ./node_modules/.bin/provision-packagesmith .

# Globally
$ npm install --global packagesmith@latest
$ provision-packagesmith my-new-provisioning-tool

Usage

PackageSmith's main export is a function: runProvisionerSet. This takes an Object - which declares a set of files to create, and instructions on how to create them.

runProvisionerSet

runProvisionerSet which will take an Object describing a set of provisioner files, and run them. It determines the old contents of the file to give to the provisioner which calculates the new contents, works out a diff - and if there is a difference it will ask the user if they like and want to write the differences.

Here's a slightly more extended sequence of events on how runProvisionerSet works:

  1. Ensures the given project directory exists
  2. For every file in the provisioner set:
  3. Gather the list of questions that need answering before this file can be provisioned
  4. De-duplicate this list
  5. Ask all of the gathered questions, formulating an answers object.
  6. For every file in the provisioner set:
  7. Determine if an existing file exists, and read its contents
  8. Run the file provisioner, determining the new contents of the file.
  9. Work out a diff between the old and new contents
  10. If the file has changed, present the diff to the user and ask the user wants to write the file
  11. If the user says yes: 1. If the file provisioner had a beforeStep, run it 2. If the user wants to write the file, then do so 3. If the file provisioner had an afterStep, run it
  12. Finish

Here is a simple example demonstrating basic functionality;

import { runProvisionerSet } from 'packagesmith';

runProvisionerSet('/path/to/the/dir/i/want/to/provision', {

  'file': {
    contents(oldContents) {
      return oldContents || 'This is a file!';
    }
  }

});