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 🙏

© 2026 – Pkg Stats / Ryan Hefner

exec-spec-runner

v0.2.1

Published

Simple spec-runner for executable scripts.

Readme

exec-spec-runner

Simple spec-runner for executable scripts.

Installation

Install exec-spec-runner using npm:

$ npm install exec-spec-runner --save-dev

For example you may use this npm task in the packet directory:

$ cd node_modules/exec-spec-runner
$ npm test

Usage

This is very simple framework for testing your executable scripts. It executes scipts synchronously one by one and compares each result with the expected. You should describe your scripts in manifest file.

const SpecRunner = require('exec-spec-runner');
let sr = new SpecRunner(require('./mans'), {
        rootDir: `./`,
        parse: (output) => output,
        print: process.stdout.write.bind(process.stdout)
    }
});
sr.run();

Options

  • rootDir {string} Root directory for your scripts, Default: ./
  • parse {function} Used parse function for scripts output, Default: returns raw stdout
  • print {function} Used print function, Default: process.stdout.write

Manifest format

Manifest example

[{
  "name": "return.js",
  "path": "return.js",
  "usage": "node",
  "tests": [
    { "argv": "--answer=100", "result": 100 },
    { "argv": "--answer=-20", "result": -20 }
  ]
}]
  • name {string} Script name
  • path {string} Relative to rootDir script path
  • usage {string} Used interpreter (node, sh, python etc)
  • tests {Array} The set of acceptance tests
    • argv {string} Scripts arguments
    • result {number} The expected result (after use parse method)

Exemplary run

> [email protected] test /Users/cerberus/Pro/exec-spec-runner
> node ./examples/test.js

Testing executable scripts:
  Testing: testr.js
   - script exists
   - 1. "$ node testr.js --answer=hello --ack=hello" should be 100 [95 ms]
   - 2. "$ node testr.js --answer=hello --ack=" hello "" should be 100 [91 ms]
   * 3. "$ node testr.js --answer=hello --ack=hellO" should be 20 but returned 0 [92 ms]
   - 4. "$ node testr.js --answer=hello --ack=hellO --i" should be 100 [94 ms]
   ! 5. "$ node testr.js --answer=hello" should be 0 but threw an exception
  Testing: return.js
   * script exists
   * 1. "$ node return.js --answer=100" should be 100
   * 2. "$ node return.js --answer=-20" should be -20
  Testing: time.js
   - script exists
   - 1. "$ node time.js" should be 100 [92 ms]

Specs passed: 6/11
Total time: 0.545 s