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-common-build-tasks

v1.0.0

Published

You can found in this library some utilities and tasks that can be shared between multiple gulp's build processes.

Downloads

13

Readme

gulp-common-build-tasks

NPM Version Download Month

You can found in this library some utilities and tasks that can be shared between multiple gulp's build processes.

Install

npm install gulp-common-build-tasks

Usage

var common = require('gulp-common-build-tasks');

common.tasks

This is a wrapper over gulp that gives more functionnalities to it.

Tasks group

var common = require('gulp-common-build-tasks');

var tasks = common.tasks();

module.exports = tasks;

Namespaced tasks group

Namespaced tasks groups will prefix every subtasks under this namespace.

Example: A task named .test under the namespace application will create a gulp task named namespace.test.

When a group is created

var common = require('gulp-common-build-tasks');

var tasks = common.tasks('namespace');

module.exports = tasks;

Later

tasks.setNamespace('namespace');

Task

tasks.create(taskName, dependencies?, gulpFunction?)

tasks.create('.aTask', ['.anotherTask'], function(gulp, config) {
    [...]
});

Task name

If a task name is prefixed with a dot ., like .aTask, it will create a relative task name based on the namespace.

If the dot . is not present, it will be considered as a root task name.

This is also real when working with dependencies.

Import a tasks group

tasks.import(require('./anotherTasks'));

Conditionally apply a dependency or an import

If you wrap the dependency name or the require() with a function you can create tasks based on the result of this function.

Dependencies

function someFeatureEnabled(taskName) {
    return function(config) {
        return config.isSomeFeatureEnabled ? taskName : false;
    };
}

tasks.create('.aTask', [someFeatureEnabled('.anotherTask')]);

Import

function someFeatureEnabled(importedTasks) {
    return function(config) {
        return config.isSomeFeatureEnabled ? importedTasks : false;
    };
}

tasks.import(someFeatureEnabled(require('.anotherTask')));

common.scripts

A tasks group that provide two gulp task:

  • .jshint
  • .jscs

So you just need to import it in your tasks group with tasks.import(common.scripts).

common.config

An utility that fills a config with default values like:

  • projectDirectory: Finds the current project directory if not already defined
  • jshintEnabled: Checks if the project has a .jshintrc file.
  • jscsEnabled: Checks if the project has a .jscsrc file.

Creator

Jimmy Fortin