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 🙏

© 2025 – Pkg Stats / Ryan Hefner

serverless-gulp

v1.0.10

Published

A thin task wrapper around @goserverless for gulp

Readme

serverless-gulp

A simple wrapper around serverless 1.x that simplifies the creation of gulp tasks. If you like having all your automation tasks for local and CI in one place eg running unit, acceptance and smoke tests, environment or config specific stuff, and deployment of lambdas, etc and love the simplicity that gulp brings, then this module may help you. Some examples of using gulp with serverless spawn a process with options as arguments to serverless. The approach used by this module uses serverless framework as a node module and provides options to it via your gulpfile.

To get started, npm install this module as a dev dependency:

npm install --save-dev serverless-gulp

This module has a dependency on the following modules:

  • serverless 1.x
  • gulp
  • gulp-util for logging

Once installed, unless you need other gulp task modules, you should not really need any other dev dependencies. Copy the gulpfile below to get started and keep developing your services as you would. To get started, use the code below as your initial gulpfile.js. The idea of this module is to keep things simple, so regardless of how the serverless framework evolves, this module will allow you to specify any command and and options within a gulp task as you would on the command line.

const gulp = require('gulp');
const serverlessGulp = require('serverless-gulp');
const util = require('gulp-util');

const paths = {
  serverless: ['./**/serverless.yml', '!node_modules/**/serverless.yml']
};

gulp.task('deploy', () => {
  gulp.src(paths.serverless, { read: false })
      .pipe(serverlessGulp.exec('deploy', { stage: 'dev' }));
});

gulp.task('remove', () => {
  gulp.src(paths.serverless, { read: false })
    .pipe(serverlessGulp.exec('remove', { stage: 'dev' }));
});

The first argument to serverless-gulp is the command you would pass to serverless framework, eg deploy, invoke, etc; the second takes options for the command. So, for the following command line:

serverless invoke --function someFunction --stage en --region eu-west-2

your gulp task would look something like:

gulp.task('invoke', () => {
  gulp.src(paths.serverless, { read: false })
    .pipe(serverlessGulp.exec('invoke', { function: 'someFunction', stage: 'en', region: 'eu-west-1' }));
});

Installing serverless modules

If you are writing your serverless services in nodejs, then you have to install node modules for each service. You can provide a post install hook in your main npm package to install packages for every service as follows:

Include the following gulp task in your gulpfile.js:

gulp.task('setup', () => {
  gulp.src(paths.serverless)
      .pipe(serverlessGulp.install());
})

Include the following post install step in the package.json

{
  "scripts": {
    "postinstall": "gulp setup"
  }
}

Example project

For a working example, or as a quick start project, fork/copy the repo at https://github.com/rhythminme/serverless-gulp-example