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-cozy

v0.0.0

Published

Manage your gulp tasks in a cozier way

Downloads

12

Readme

gulp-cozy

Manage your gulp tasks in a cozier way.

npm version Build Status

Rationale

Ever found yourself digging into a gigantic monstrous Gulpfile with hundreds of functions and tasks scattered all around? Well I did and I can tell you it's not a great feeling...

This small module attempts to help with keeping yourself cozier (and happier!) when working with Gulp. In a way it tries to bring a bit of the Node philosophy (also known as "The Node way") into your Gulpfile.

Gulp-cozy in fact offers a very easy way to separate all your Gulp tasks into small modules organized inside a dedicated folder. Gulp-cozy will take care to load all the modules and to register them as Gulp tasks. With this approach you will end up with several small modules that serve one specific purpose (a task), which in turn result easier to maintain and to reason about.

Installation

npm install --save-dev gulp-cozy

Usage

Inside your Gulpfile:

#Gulpfile.js

var gulp = require('gulp');
var cozy = require('gulp-cozy');
cozy(gulp);

Then you need to create a gulp folder inside the root of your project. You will add all your tasks inside this folder. Every tasks is a file which name will represent the name of the gulp task. For example we can add the build-css task by creating the build-css.js file as follows:

#gulp/build-css.js

var concat = require('gulp-concat');
var minifyCss = require('gulp-minify-css');

module.exports = function(gulp) {
  return function() {
    return gulp.src([
      './node_modules/bootstrap/dist/css/bootstrap.css'
    ])
      .pipe(concat('all.css'))
      .pipe(minifyCss({compatibility: 'ie8'}))
      .pipe(gulp.dest('./assets/'))
    ;
  }
}

Notice that the module exports a function that receives the current instance of Gulp as argument. This function is a factory for the real Gulp task logic so it should return a function which, will be executed when calling the build-css task with:

gulp build-css

You can also create a module to call a series tasks as in the following example.

#gulp/build.js

module.exports = ['clean', 'build-css', 'build-js', 'compress', 'upload'];

In this case the module needs to export just a plain array containing the names of the tasks to be invoked when running:

gulp build

Tests

npm test

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code. The project is currently using XO for styleguide and style checks run with the regular test suite.

You can report issues or suggest improvements on Github.