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

@bcronin/rbuild

v0.1.1

Published

A `make`-like tool with a few additional conventions and conveniences.

Downloads

5

Readme

rbuild

A make-like tool with a few additional conventions and conveniences.

Example

build.task("tbd")

Command-line Usage

  • -w, --watch - runs in watch mode: will run the given task then poll all the dependent files and rerun the top-level task whenever
  • -f, --force - ignores timestamps and forces all tasks to be run. When combined with the watch option, the force option only applies to the first run of the tasks
  • -h, --help - describes the tasks
  • -d, --describe, - outputs a detailed JSON dependency graph

rbuild.config.js

The configuration file has the following properties:

  • Interpreted as ES6 JavaScript
  • The build variable is exposed as a global
  • The environment variables are exposed as the map ENV

API

Builds are described in a file named rbuild.config.js. This exports two special variables build and ENV. It is also compiled as ES6 Javascript.

build

  • task(name) - create a new named task
  • include(directory) - add in the tasks and commands from another rbuild.config
  • addCmd(name, { desc }) - add a custom named command

Task

  • describe(msg) - give the task a brief description
  • deps([ dependencies ]) - ordered list of dependencies of this task
  • watch([ dependencies ]) - dependencies that should retrigger this task in watch mode
  • shell(command) - run the command string via the shell
  • exec(process, [ args ], { options }) - run an executable outside the shell
  • cmd(name, ...) - run a command registered with addCmd

task(name)

Create a new named task.

build.task("test")

describe(msg)

build.task("test")
    .describe("runs all the unit tests")
    .shell("npm run test")

deps(deps)

build.task("test")
    .describe("runs all the unit tests")
    .deps([ "build", "lint" ])
    .shell("npm run test")

shell(command)

Runs a command or array of commands as bash scripts. rbuild will go out of its way to try to run these commands with bash (e.g. using MinGW on Windows).

  • shell(command)
  • shell([ commands ])
build.task("test")
    .describe("runs all the unit tests")
    .deps([ "build", "lint" ])
    .shell("npm run test")
build.task("test")
    .describe("runs all the unit tests")
    .deps([ "build", "lint" ])
    .shell([
        "npm run test-fast",
        "npm run test-slow",        
    ]);

As rbuild compiles the source files using ES6 syntax, the long-string form can be used to construct full scripts inline in the rbuild.config.js file:

build.task("<tbd>")
    .shell(`\
set -e
echo
echo Hello World
echo
gcc -c myfile.cc -o myfile.o
`)

exec(cmdName, ...args, options)

The exec command explicitly launches a new process without going through a sub-shell.

build.task("test")
    .describe("runs all the unit tests")
    .deps([ "build", "lint" ]
    .exec("go", "build", "...", { })

subtasks(arr, opts, cb(task))

Creates a new anonymous child task for each element in the array. The child task is automatically a dependency of the named parent task.

var glob = require("glob");
build.task("compile-less")
    .subtasks(glob.sync("assets/style/*.less"), (task, filename) => {
        task.shell(`lessc ${fileanme}`)
    })