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

foundry-release-base

v1.0.2

Published

CLI base for foundry release commands

Downloads

105

Readme

foundry-release-base Build status Build status

CLI base for foundry release commands

This was built to make creating foundry-release-spec integrations as easy as possible.

Getting Started

Install the module with: npm install foundry-release-base

// Inside of `my-release-command.js`
// Define our command
var FoundryReleaseBase = require('foundry-release-base');
var pkg = require('./package.json');
var myReleaseCommand = new FoundryReleaseBase({
    // Define action to run on `my-release-plugin update-files`
    updateFiles: function (params) { // params = {version, message}
        // Update files for release
    },
    // Define action to run on `my-release-plugin commit`
    commit: function (params) { // params = {version, message}
        // Commit changes to files
    },
    // Define action to run on `my-release-plugin register`
    register: function (params) { // params = {version, message}
        // Register our package to its repository
    },
    // Define action to run on `my-release-plugin publish`
    publish: function (params) { // params = {version, message}
        // Publish our package to its repository
    }
});
myReleaseCommand.version(pkg.version);

// Parse CLI arguments
myReleaseCommand.parse(process.argv);

Usage from CLI:

# Invoke each of the respective functions from above
node my-release-command.js update-files "1.0.0" "Release 1.0.0"
node my-release-command.js commit "1.0.0" "Release 1.0.0"
node my-release-command.js register "1.0.0" "Release 1.0.0"
node my-release-command.js publish "1.0.0" "Release 1.0.0"

Documentation

foundry-release-base exposes FoundryReleaseBase via its module.exports.

FoundryReleaseBase(params)

FoundryReleaseBase is a constructor that inherits from Command from commander.js.

  • params Object - Container for methods and options
    • updateFiles Function - Optional function that updates package's files as part of its release
      • For example, this could update package.json for an npm release
      • Function signature should match function (params, cb)
        • params Object - Container for release information
          • version String - Semantic version for the current release
          • message String - Subject giving information about release
        • cb Function - Error-first callback to notify FoundryReleaseBase of when task is complete
          • Function signature will be function (err) where err is either an Error or null
          • Upon non-error callback, we will exit with a 0 exit code
          • Upon error callback, we will throw the Error which leads to a non-zero exit code
    • updateFilesDescription String - Optional description to use for update-files command in --help
    • commit Function - Optional function that saves changes to files as part of its release
      • For example, this could run git commit for a git release
      • Function signature will be the same as updateFiles
    • commitDescription String - Optional description to use for commit command in --help
    • register Function - Optional function that register package to its repository as part of its release
      • For example, this could run bower register for a bower release
      • Function signature will be the same as updateFiles
    • registerDescription String - Optional description to use for register command in --help
    • publish Function - Optional function that publish package to its repository as part of its release
      • For example, this could run npm publish for an npm release
      • Function signature will be the same as updateFiles
    • publishDescription String - Optional description to use for publish command in --help

foundryReleaseBase.*

FoundryReleaseBase inherits from Command from commander.js. As a result, we support all of the methods provided by commander.js. This include .version(), .parse(). Please see commander.js' documentation for more information.

// Add support for running `--version` on CLI
var pkg = require('./package.json');
myReleaseCommand.version(pkg.version);

// Interpret CLI argument
myReleaseCommand.parse(process.argv);

Documentation: https://github.com/tj/commander.js

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint via npm run lint and test via npm test.

Donating

Support this project and others by twolfson via gratipay.

Support via Gratipay

Unlicense

As of Sep 26 2015, Todd Wolfson has released this repository and its contents to the public domain.

It has been released under the UNLICENSE.