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

script-kitty

v1.0.8

Published

Generate "scripts" attribute in your package.json

Downloads

7

Readme

🐱 script-kitty

Install

With npm:

npm install -g script-kitty

With yarn:

yarn global add script-kitty

You can also install it in your project's devDependencies:

npm install --save-dev script-kitty

and then create an update-scripts command like so:

{
    "scripts": {
        "update-scripts": "./node_modules/.bin/script-kitty scripts"
    }
}

Overview

Script Kitty is a command line tool that takes a folder full of scripts (bash or otherwise) and sets them as scripts commands in your package.json.

For example, given a folder system that looks like this:

MyAwesomeProject
  - ... // Some code files
  - package.json 
  - scripts
    - bloop.sh
    - shmoop.sh
    - fuzzbing.js

Running script-kitty scripts in your project root will generate 3 commands for you like this:

npm run bloop
npm run shmoop
npm run fuzzbing

It does this by editing your package.json like so:

{
    "scripts": {
        "bloop": "./scripts/bloop.sh",
        "shmoop": "./scripts/shmoop.sh",
        "fuzzbing": "node ./scripts/fuzzbing.js"
    }
}

Why would I need this?

This tool was made to avoid scripts bloat. If your scripts look like this:

"scripts": {
    "build": "webpack --config app/renderer/renderer.config.js",
    "db-migrate-create": "node node_modules/db-migrate/bin/db-migrate create $NAME -e dev --config config/database.json",
    "test": "NODE_ENV=test ./node_modules/.bin/jest",
    "test-windows": "set NODE_ENV=test&& npm run test-windows2",
    "test-windows2": "./node_modules/.bin/jest",
    "test-on-ci": "xvfb-maybe ./node_modules/.bin/jest --runInBand",
    "test-watch": "./node_modules/.bin/jest --watch",
    "plop": "./node_modules/.bin/plop",
    "lint": "./node_modules/.bin/eslint lib app",
    "lint-fix": "./node_modules/.bin/eslint --fix lib app",
    "dev": "NODE_ENV=dev && npm run build && electron app/main/index.js",
    "prod": "NODE_ENV=prod && npm run build && electron app/main/index.js",
    "dev-down": "node node_modules/db-migrate/bin/db-migrate down -e dev --config config/database.json",
    "prod-down": "node node_modules/db-migrate/bin/db-migrate down -e prod --config config/database.json",
    "test-down": "node node_modules/db-migrate/bin/db-migrate down -e test --config config/database.json",
    "dev-up": "node node_modules/db-migrate/bin/db-migrate up -e dev --config config/database.json",
    "prod-up": "node node_modules/db-migrate/bin/db-migrate up -e prod --config config/database.json",
    "test-up": "node node_modules/db-migrate/bin/db-migrate up -e test --config config/database.json",
    "dev-reset": "node node_modules/db-migrate/bin/db-migrate reset -e dev --config config/database.json",
    "prod-reset": "node node_modules/db-migrate/bin/db-migrate reset -e prod --config config/database.json",
    "test-reset": "node node_modules/db-migrate/bin/db-migrate reset -e test --config config/database.json",
    "create-db-config": "NODE_ENV=dev babel-node lib/io/sqlite/scripts/createDatabaseConfig.js",
    "dev-windows": "set NODE_ENV=dev&& npm run build && electron app/main/index.js",
    "prod-windows": "set NODE_ENV=prod&& npm run build && electron app/main/index.js",
    "fmt": "./node_modules/.bin/prettier --write '!(coverage|scripts|.vscode|node_modules)/**/!(.compiled|build|dist)/*.js'",
    "storybook": "start-storybook -p 6006",
    "build-storybook": "build-storybook",
    "dist": "./node_modules/.bin/electron-packager . --out ./dist --overwrite",
    "snyk-protect": "snyk protect",
    "prepare": "npm run snyk-protect"
  }

Instead, we can move these commands into single files that will let us combine some of these tools into single commands.