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

lazy-gulp

v1.0.3

Published

A declarative way of defining gulp tasks

Downloads

2

Readme

#Description

A small abstraction which provides a more declarative way of defining gulp tasks.

#Concept

A common pattern found in gulp files is to create separate build and watch tasks for each type of file being processed. This requires one to independently maintain each of these tasks and can be cumbersome as the number of tasks increases. Ultimately however the end goal is (usually) to apply the same set of transformations to specific file sets with minor variations in the pattern of execution.

This module attempts to abstract the execution of file transformations away from the description of those transformations. It does this by allowing one to define desired transformations as a series of rules and then facilitating the generation of certain types of tasks using said rules. A rule is simply a series of functions which generate vinyl transform streams (which is what most gulp modules expose).

Goals:

  • Reduce the amount of boilerplate code (gulp.src, gulp.dest)
  • Provide a centralized location to define file transformations
  • Maintain the intuitive nature of pipeling typically employed in gulp tasks

#Usage

  • A ruleset is simply an array of objects each of which contains the following attributes:

  • files: A glob.src compatible glob expression which describes the files being transformed

  • description: An array of functions each of which generates a vinyl transform stream. These are used to process the files defined by the files attribute.

  • opts: An object which affects various properties of the transform process

    • base: The base used to derive relative paths of the files described by 'files'

    • dest: The destination within the target folder (this will be prepended to the relative path)

    • recompileAll: A boolean value used by the watch generator which indicates whether or not all files matching the glob expression should be recompiled whenever one of them changes.

A ruleset can then be passed into the compile functions exposed by the module to generate certain tasks. The compile functions has the following signature

lg.compile(rulset, dest, type, opts)

where

  • ruleset is the ruleset to be processed as described above
  • dest is the desired output location
  • type is the kind of task being generated (currently only watch and build are supported)
  • opts is identical to the option object described above but applies to all rules within the ruleset provided that those rules don't explicitly define those options (i.e it can be considered a default option set).

#Example

#FAQS

  • What sort of tomfoolery be this?
    • I wish I had an answer for answer this :/

#Comments? Questions? Abuse?