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

grunt-beanstalk-api

v1.1.1

Published

Simple beanstalk api interface

Downloads

8

Readme

##Grunt Beanstalk API Build Status

A Grunt task that allows you to pull individual files, from a specific revision in a Beanstalk repo.

A great use-case for this would be the sharing of common SASS files across multiple projects for the same client. For example, here at JH, we would often be creating a Magento Store for a client that also includes a Wordpress blog. We can use the CSS from the main Magento website for the base styling, but should we want to add any Wordpress specific style we might need access to some $vars that are set in the main project. This presents the need to programmatically include sometimes only a single file from another project (without having to clone the entire repo) - this is where our new plugin can help.

How to use.

In this example, change any occurrence of your-org with your actual Beanstalk sub-domain

  1. First, log into your Beanstalk account and create an access token at https://your-org.beanstalkapp.com/access_tokens
  2. Create a creds.json file containing your orgname, username + access token.
{
  "orgname": "your-org",
  "username": "awesome-user",
  "token": "beb9189992a55fcb129b156cdb6ae819acccb42d9f88ef8f2e"
}
  1. Add the following configuration to your Gruntfile.js
/**
 * Gruntfile.js configuration
 */

beanstalk: {
    options: {
        creds: require('./creds.json')
    },
    sync: {
        method:   'file',
        repo:     'some-repo',
        path:     [
            'public/assets/scss/core.scss',
            'public/assets/scss/modules/_mixins.scss'
        ],
        revision: '1.0.0',
        outDir:   './'
    }
}
  1. Run grunt beanstalk:sync to have your files pulled from beanstalk and written into the directory of your choice.

Options

  • method - Currently we only support fetching files (as this was our immediate use-case)
  • repo - A repository ID, can be either the short-name or an actual numeric ID
  • path - A single file, or an array of file paths relating to the remote repo.
  • revision - Specify any git revision identifier, can be a commit hash or tag name
  • outDir - Where the files should be written locally.
  • transformPath - If you need to modify the file path before it's written to your project, you can provide a function. For example, to strip public from the start of all paths before they are written, you can provide a callback such as:
beanstalk: {
    options: {
        creds: require('./creds.json')
    },
    sync: {
        method:   'file',
        repo:     'some-repo',
        path:     [
            'public/assets/scss/core.scss',
            'public/assets/scss/modules/_mixins.scss'
        ],
        revision: '1.0.0',
        outDir:   './',
        transformPath: function(path) {
            return path.split("/").slice(1).join("/");
        }
    }
}