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

gloup

v4.0.0

Published

Mini task runner based on bach (DEPRECATED)

Downloads

6

Readme

gloup

NPM version

Another mini task runner based on bach

Deprecated

This project is no longer maintained.

Features

  • One task = one file = one function
  • Task on the command line are executed in series
  • Compose task in parallel or in series (based on bach)
  • Supports node's (or iojs) flags on the command line

This tool as been drafted for some specific needs: use it if you like, enhance it if you don't. Else gulp is a better fit for you.

Installation

npm install --save gloup

Usage

With the folder structure below:

├─ myapp
└─ tasks
   ├─ bundle.js
   ├─ clean.js
   ├─ dev.js
   ├─ dist.js
   ├─ statics.js
   └─ serve.js

myapp: The executable main script (chmod +x myapp)

#!/usr/bin/env node
var gloup = require('gloup')
gloup(__dirname + '/tasks')

tasks/clean.js: A task must export a function that return anything async-done supports (stream, promise, etc.)

var del = require('promised-del')
var resolve = require('path').resolve

module.exports = function () {
  return del(['build'], {
    cwd: resolve(__dirname, '../../')
  })
}

tasks/dist.js: You can compose tasks using tasks name (based on filename) or function

var series = require('gloup').series(__dirname)
var parallel = require('gloup').parallel(__dirname)

module.exports = series([
  'clean',
  parallel('bundle','statics'),
  function () {
    return new Promise(function (resolve, reject) {
      // ...
    })
  }
])

Now, myapp can be used as a task runner

> myapp clean bundle serve
  gloup ⇢ clean +0ms
  gloup ⇠ clean +0ms
  gloup ⇢ bundle +1s
  gloup ⇠ bundle +6s
  gloup ⇢ serve +0ms
  gloup ⇠ serve +2ms

Start a composed task

> myapp dist
  gloup ⇢ clean +0ms
  gloup ⇠ clean +0ms
  gloup ⇢ bundle +1s
  gloup ⇢ statics +1s
  gloup ⇠ bundle +6s
  gloup ⇠ statics +6s
  gloup ⇢ serve +0ms
  gloup ⇠ serve +2ms

With node options:

> myapp --debug --es_staging serve
Debugger listening on port 5858
  gloup ⇢ serve +0ms
  gloup ⇠ serve +2ms

Quiet mode (remove gloup messages):

> myapp serve --quiet

api

Create a command line tool

#!/usr/bin/env node
var gloup = require('gloup')

// Path to the tasks folder
gloup(__dirname + '/tasks')

// Force node (iojs) flags
gloup(__dirname + '/tasks', {
  flags: ['--es_staging']
})

Use series and parallel composer (just a convenient wrapper around bach) to compose tasks with name.

// gloup.series(taskFolder) -> {function} :
var series = require('gloup').series(__dirname)
// gloup.parallel(taskFolder) -> {function} :
var parallel = require('gloup').parallel(__dirname)
module.exports = series(['clean', parallel('bundle','statics')])

The MIT License