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

leak

v0.1.2

Published

Leak helps release semantically-versioned node packages from git branches.

Downloads

6

Readme

leak

Leak helps release semantically-versioned node packages from git branches.

Status: Leak is unstable and should be used at your own risk.

Install

Install leak with npm.

npm install -g leak

Leak can now be run as a command

$ leak --help

  Usage: leak [options]

  Options:

    -h, --help                        output usage information
    -V, --version                     output the version number
    -S, --start [name]                Start working on a branch, synced with origin, and properly versioned
    -C, --commit [message]            Commit progress on this branch
    -R, --release [type]              Cut a version (of a type like minor or patch), push to master, and close this branch
    --clean [do_clean]                Clean the feature branch and tags after release? Default [true]
    --clean-remote [do_clean_remote]  Clean the remote feature branch and tags after release? Default [true]
    --npm-publish [do_npm_publish]    Publish npm module on release? By default, publish if package.json private === false
    --main-branch [main_branch]       Specify the 'master' branch which gets released to. Default ['master']
    --remote [remote]                 Specify the remote repo to use. 'false' for no remote actions. Default ['origin']

Setup

Other than the following restrictions, leak should work fine with existing repositories and node modules.

The package.json file must be present at the top-level of the repo and be valid JSON. The version value must be a proper semantic version.

Commands

Leak has 3 main actions: Start, Commit, and Release.

Leak will run 'Commit' (-C) by default if nothing is provided.

Commit can be combined with start or release, because a commit always happens to change the version. When starting or releasing, the commit flag is used to override the message.

-S --start [branch]

"Switch to a new or existing branch"

Start Behavior

  • tries to checkout $branch. if it already exists and is checked out:
    • try to run git pull origin $branch. if the branch does not exist remotely:
      • continue as if the branch had been just created (see below)
  • if the branch doesnt already exist:
    • creates a new branch named $branch off of the current git repo
    • set to track $branch on origin. if branch is successfully tracked:
      • git pull
    • if branch cannot track remote because no remote branch:
      • updates version for the branch in package.json to match X.X.X-$branch.X
      • stages and commits package.json
      • publishes the new branch to origin

Start Options

  • -S --start [branch_name] - Specify the name for the branch

-C --commit [message]

"Commit progress on the current branch."

Commit Behavior

  • notices the current $repo & $branch
  • git pull origin $branch
  • increments the prerelease $version in `package.json'
  • stages package.json
  • commits all staged changes with the $message provided
  • tags the commit with the new version
  • pushes commits and tags to origin $branch

Commit Options

  • -C --commit [message] - Set the commit message

-R --release [type]

"Release the currently-staged branch to remote master and npm, then wipe the branch and old tags"

Release Behavior

  • notices the current $repo & $branch
  • git pull origin $branch
  • if branch is not master:
    • git pull origin master
    • checkout master to make sure working copy doesn't conflict
    • checkout $branch again
  • increments the $version by $type in `package.json'
  • stages package.json
  • commits all staged changes with the $message provided, otherwise 'release $type $version'
  • tag the commit with the new version
  • pushes commits on $branch and the tag to origin
  • if $branch is not master:
    • push $branch to origin master
    • checkout master, pull origin master
    • if cleaning is enabled:
      • remove all local tags which match: X.X.X-$branch.X
      • remove the local $branch
      • if remote cleaning is enabled:
        • remove all remote tags which match: X.X.X-$branch.X
        • remove the remote $branch
  • if private === false in package.json or if npm is enabled
    • npm publish

Release Options

  • -R --release [type] - Specify the type of the release
  • -C --commit [message] - Override the commit message for the release
  • --clean [do_clean] - If set to false, no cleaning will be done
  • --clean-remote [do_clean_remote] - If set to false, nothing remote will be cleaned
  • --npm-publish [do_npm_publish]
    • publish to npm if true
    • if set to false, npm will not publish
    • by default, publish if private is false in package.json