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-recipe-loader

v0.1.13

Published

Gulp environment with receipe modules autoloading with hooks

Downloads

14

Readme

gulp-recipe-loader Dependency Status

NPM

Automatic gulp recipe loading and task registration

example gulpfile

// deps
var gulp = require('gulp'),
    requireDir = require('require-dir');

// read config files from ./gulp-config directory
var config = requireDir('gulp-config');

// load all recipes
var $ = require('gulp-recipe-loader')(gulp, config);

// mark build task as default
$.gulp.task('default', ['build']);

Sources configuration syntax

First of all, define your defualt base path. It has to be a real path. Default value is '.', but most probably wou will need to change it. All paths are relative to gulpfile location.

sources.defaultBase = 'app/';

There are few ways to define source. The most basic one is just a string with glob path.

sources.css = 'app/styles/*.css';

You can also provide an array of globs or other sources.

sources.bowerScripts = [
    'app/bower_components/*/*.js',
    'app/bower_components/*/{dist,min,release}/*.js',
];

If you need to change the base for specific set of paths, you can use object notation.

sources.specialFiles = {
    files: 'special/**/*', // the 'files' can be any valid source. A glob or array of globs will work.
    base: 'special/'
};

Sources can be easily composited. You can use any valid source inside the other.

sources.devAssets = [
    sources.js,
    sources.css,
    'app/icons/**/icon-*.svg',
    sources.tempFiles
]

Important note: If you nest other sources inside source object, the properties of the outer object will be applied.

sources.myFiles = {
    files: 'defs/scene-*.xml',
    base: 'defs/'
};

// this is BAD
sources.moreFiles = {
    files: [sources.assets, 'more/*.files'],
    base: 'more/'
}

The actual content of sources.moreFiles will be identical to this:

// actual output of that BAD thing
sources.moreFiles = {
    files: ['defs/scene-*.xml', 'more/*.files'],
    base: 'hello/' // note mismatched base for first file definition
}

What you probably wanted to do instead is

// this is GOOD
sources.moreFiles = [
    sources.myFiles, // the base is preserved
    {
        files: 'more/*.files',
        base: 'more/'
    }
]