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 🙏

© 2026 – Pkg Stats / Ryan Hefner

dropper

v1.1.1

Published

Deploy things!

Downloads

22

Readme

dropper

Deploy things!

Wercker npm

Installing

$ npm install -g dropper

Platforms

Dropper is built to be extensible. The first platform supported is OpsWorks, but maybe there are more to come!

Opsworks

Deploy an OpsWorks app:

$ dropper opsworks --stack-id STRING --app-id STRING

Options

  • --access-key-id STRING (required) AWS access key. Can be provided by the AWS_ACCESS_KEY_ID environment variable.
  • --secret-access-key STRING (required) AWS secret key. Can be provided by the AWS_SECRET_ACCESS_KEY environment variable.
  • --stack-id STRING (required) OpsWorks stack ID.
  • --app-id STRING (required) OpsWorks app ID.
  • --region STRING (required) AWS region. Default is us-east-1. Can be provided by the AWS_DEFAULT_REGION environment variable.
  • --revision STRING (optional) A revision, e.g. a git ref or subversion revision number, to deploy.
  • --migrate (optional) Enable migrations.
  • --comment STRING (optional) Comment for the deployment.
  • --wait-for-deploy (optional) Waits for deployments to complete before exiting, and reports the result.

Permissions

It's recommended to create an IAM user with just enough permissions to perform the actions required to deploy an app. following permissions should be enough:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "opsworks:CreateDeployment",
        "opsworks:DescribeApps",
        "opsworks:DescribeDeployments"
      ],
      "Resource": [
        "arn:aws:opsworks:*:*:stack/your-opsworks-stack-id-here/"
      ]
    }
  ]
}

Extending

Platform support is implemented through a Deployer. Each deployer lives in its own module inside lib/deployer/.

Here's a working example:

// In lib/deployer/cloudinator.js
function CloudinatorDeployer(options) {
    this.options = options;
}

CloudinatorDeployer.prototype.cloudinate = function() {
    // The cloud is very unpredictable
    return Math.random() > 0.4;
}

CloudinatorDeployer.prototype.deploy = function() {
    console.log('Cloudinating...');

    if (this.cloudinate()) {
        this.emit('done');
    } else {
        this.emit('error', 'Cloudination failed!');
    }
}

exports = module.exports = CloudinatorDeployer;

// In lib/deployer.js
Deployer.register('cloudinator', require('./deployer/cloudinator'));

Registering

Deployers need to be registered on the main Deployer class:

// In lib/deployer/cloudinator.js
function CloudinatorDeployer(options) {}

exports = module.exports = CloudinatorDeployer;

// In lib/deployer.js, all the way at the bottom
Deployer.register('cloudinator', require('./deployer/cloudinator'));

After registering, you can call dropper cloudinator to use your deployer.

Events

Deployers are event emitters, and dropper handles a few special events:

  • done events signal that a deploy has successfully completed. Every deployer must emit this event when it's done.

  • error events signal a fatal error and cause dropper to exit immediately with a failed status.

    Error events should not be emitted in the constructor, because they won't have a handler registered.

CloudinatorDeployer.prototype.deploy = function() {
    if (this.cloudinate()) {
        this.emit('done');
    } else {
        this.emit('error', 'Cloudination failed!');
    }
}

Command Line Arguments

Deployers are instantiated with an object containing command line arguments. Option names are converted from --lower-case-with-dashes to camelCase.

function CloudinatorDeployer(options) {
    // --fail-loudly
    if (options.failLoudly) {
        this.emit('error', 'BOOM');
    }

    // --deploy-target production
    if (options.deployTarget == 'production') {
        console.warn('omg r u sure');
    }

    // Save the options for later
    this.options = options;
}

Deploying

Each deployer must implement the deploy method, which is called without arguments. The deploy method is the entry point to the deployer, and should emit either a done or an error event.

CloudinatorDeployer.prototype.deploy = function() {
    // Deploy things!
    this.emit('done');
}

Tests

To run the tests:

$ npm install
$ npm test

Contributing

  1. Fork the GitHub repo.
  2. Check out a feature branch, e.g. cool-new-thing.
  3. Write tests! Pull requests won't be accepted without reasonable test coverage.
  4. Write code!
  5. Open a pull request on GitHub.

License

MIT. See LICENSE.