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

herunt

v0.1.0

Published

A Grunt multitask plugin for deploying Node.JS apps to Heroku

Downloads

6

Readme

Herunt: A Grunt multitask plugin for deploying Node.JS apps to Heroku

David. Watching Your Dependencies.


You can use Herunt to automate both setting up and deploying a Node.JS app to Heroku from your Grunt-based build process.

Herunt takes the view that since the code you're deploying to Heroku is probably in some way derived (optimised, concatenated, compiled, whatever) it probably doesn't make much sense to be committing it to your main source code repo. So the idea with Herunt's approach is that once you have your app nicely built and ready for deployment it should be committed to a separate repo the sole purpose of which is to store the compiled app package and push it to Heroku.

Herunt will automate:

  • Set up the deployment Git repo if required on first run
  • Create a brand new Heroku app if required, or work with an existing app
  • Copy, add and commit your built app files into the repo
  • Add/set env config vars on the Heroku app
  • Deploy the app to Heroku

Installation

Install the plugin alongside the rest of your Grunt build process files:

$ npm install herunt --save-dev

And then reference it in your Gruntfile.js:

grunt.loadNpmTasks("herunt");

Prerequisites

This plugin requires Grunt ~0.4.1.

The Heroku Toolbelt CLI tool needs to be installed, available in your PATH and authenticated. Version >=2.39.2 is required.

You need a modern version of Git >=1.8 installed and available in your PATH too.

Herunt has been tested on OSX only. It'll probably work on various flavours of *nix, but Windows not so much.

Configuration

Example configuration for the herunt task, with a target called deploy:

grunt.initConfig({
    herunt: {
        deploy: {
            app: "dist",
            herokuRepo: "heroku-app",
            name: "sleepy-anchorage-3191",
            region: "eu",
            config: {
                NODE_ENV: "production",
                DB_USER: "foo",
                DB_PASS: "bar",
                API_KEY: "baz"
            },
            exclude: ["scss,"*.foo"]
        }
    }
});

Explanation of options:

app This is the path (relative to the Gruntfile.js) that contains your derived app ready to be deployed to Heroku. This isn't the Heroku-enabled Git repo. By the time Herunt gets to looking at this folder it should have been populated by your build process with the compiled, compressed and concatendated files that comprise your production-ready app.

herokuRepo This is the desired location of the Heroku Git repo, i.e. the repo which simply stores and pushes the derived app. If this folder doesn't exist Herunt will create it and set up the repo automatically. If you intend to keep this repo inside the work tree of your main project repo you must add its containing folder to .gitignore or else bad things will happen.

name Optional. The name of the Heroku app. This field is optional since Herunt will create a new app on Heroku if you don't specify it. Either the named app, or the automatically created app will be picked up on subsequent runs.

region Optional. Defaults to US, but feel free to use the value eu to target the new Heroku Europe cluster.

config Optional. Hash of name/value pairs for any env vars you want to set on the Heroku app.

exclude Optional. Array of exclude patterns to use when Herunt copies the contents of the app folder into the herokuRepo. Herunt automatically excludes the following:

".DS_Store","node_modules",".git",".gitignore",".nodemonignore","npm-debug.log"