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

jsrun

v1.0.0

Published

The npm run-script build system, compatible with gulp

Downloads

5

Readme

JsRun

Build Status

The npm run-script build system, compatible with gulp.

The struggle

Does this seems familiar to you?

{
  "name": "my-awesome-package",
  ...
  "scripts": {
    // My very long lines run-scripts:
    "lint": "jshint lib test index.js --reporter node_modules/jshint-stylish/stylish.js --exclude node_modules",
    "test": "npm run lint && node test/index.js | tap-spec",
    "build": "browserify index.js -d -t babelify | uglifyjs -m -c > bundle.min.js",
    "cover": "istanbul cover --report html --print detail ./test/index.js",
    "coveralls": "npm run cover && istanbul report lcov && cat coverage/lcov.info | coveralls && rm -rf ./coverage"
  }
}

Well, it happened to me. My run-scripts grew longer from time to time. And one day, I just couldn't take it anymore.

Introducing JsRun - Just run your scripts

Thanks to npm-run, JsRun runs your local bins, just like npm run stuff.

// jsrunfile.js
var jsrun = require('jsrun');

jsrun.just('lint', [
  'jshint', [
    'lib test index.js',
    ['--reporter', 'node_modules/jshint-stylish/stylish.js'],
    ['--exclude', 'node_modules']
  ]
]);

// Use task dependencies like we did in gulp
jsrun.just('test', ['lint'], [
  'node test/index.js | tap-spec'
]);

var bundleFileName = 'bundle.min.js';
jsrun.just('build', [
  // Create as many layers of array as you want
  ['browserify', [
    'index.js',
    '-d',
    ['-t', 'babelify']
  ]],
  // You can use "|" and "&&" in JsRun
  '|',
  'uglifyjs', [
    '-m', '-c',
    // Use string variables
    ['>', bundleFileName]
  ]
]);

// Just like gulp.task
// You can use callbacks, promises and of course, streams.
jsrun.task('hello', function(cb) {
  console.log('Hello');

  setTimeout(function() {
    console.log('World!');
    cb();
  }, 500);
});

jsrun.task('default', ['lint', 'test', 'build']);

Installation

npm install jsrun -g

Why?

No more plugins

With JsRun, you won't need another plugin like grunt-contrib-something or gulp-this-and-that. Your tools always stay updated instead of relying on plugins. And most importantly, JsRun is always compatible to your tools, as long as they are command-line scripts.

Comments and variables

Sometimes, there might be something you want to comment in your build script, and it is impossible in the package.json. And we want variables for filenames in different scripts, again, impossible for package.json.

FAQ

Copying, moving and removing files

You can always write shell scripts inside JsRun for these tasks. However, if you want to keep these shell commands portable, we recommend using shelljs.

Watching file changes

You can use watch mode from your tools if they are available. On the other hand, if it's not available, you can try catw.

JsRun eats its own dog food

JsRun's jsrunfile.js

Documentation

Documentation page

Gulp

JsRun is a fork of gulp. We simply took the file-system-related stuff(vinyl-fs) away and put the npm-run task runner inside.

In addition, thanks to the modular source code of gulp, JsRun is made simple and lean. The implementation of JsRun is only about 0.5kloc.