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

gulp-shampoo

v0.0.6

Published

A gulp plugin to retrieve data from Ludomade's Shampoo app.

Downloads

14

Readme

gulp-shampoo

A grunt plugin to retrieve data from Ludomade's Shampoo app.

Getting Started

This plugin requires Gulp ^3.9.1

If you haven't used Gulp before, be sure to check out the Getting Started guide, as it explains how to create a Gulpfile.js. Once you're familiar with that process, you may install this plugin with this command:

npm install gulp-shampoo --save-dev

Once you've got a basic gulpfile setup, add the following task.

var shampoo = require('gulp-shampoo');
gulp.task('shampoo', function(done) {

    shampoo({ //see below for an explanation of each option.
        documentId: "MY-SHAMPOO-DOCUMENT-ID-HERE",
        outputDir: "locales/",
        activeLocales: ["en-US"]
    }, function(err) {
        if (err) {
            return done(err); // return error
        }
        done(); // finished task
    });

});

A note about other gulp async tasks and shampoo

The shampoo task is best setup as a 'synchronous' task - as it's got a few entry prompts in the terminal window. If other asynchronous tasks are started at the same time, the prompts may get lost within the output. For an explanation on how to set this up, see this article.

Options

The first argument of the shampoo function takes an object of options.

options.documentId

Type: String Default value: ``

The document ID which you want to pull data down from. To find your document ID, open your Shampoo document in the browser. The document ID is displayed in the URL, after /#/edit/. For example: /#/edit/{documentId}.

options.activeLocales

Type: Array<String> Default value: ``

Enter an array of strings of locales you wish to pull down. Ie, ['en-US', 'en-GB', 'en-AU']. The locale codes must match the code setup within Shampoo.

options.outputDir

Type: String Default value: locales/

Enter a path relative to the gulpfile which indicates where the data from shampoo will be saved.

First run on a project

Once you've got your gulp file setup and running, run gulp shampoo For the first time, the task will prompt you for a few details.

  1. First it will prompt you with "Please enter your google ClientID.". If you don't know what this is, ask a shampoo admin.
  2. Secondly, it will prompt you with "Please enter your google ClientSecret.". If you don't know what this is, ask a shampoo admin.
  3. Lastly, it will open a browser window with a Google sign-in and authorization request screen. Upon clicking the 'accept' button, it will provide you with a key to save. Copy this key, and paste it into the terminal prompt.
  4. You're done. The credentials used above will get saved down, and remembered next time. If all went well, you should have locales/en-US.json, filled with data.