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

@ominestre/zugzug

v2.0.2

Published

Gulp Build Workers

Downloads

1

Readme

[DEPRECATED] ZugZug - Gulp Peon Workers!

I haven't worked with Gulp in several years and haven't put any maintenance or thought into this Gulp scaffold.

~~This module is for quickly adding some common Gulp tasks used in web projects. Work, work.~~

Build Status Coverage Status Gitter chat

Installation & Setup

Pre-requirements

  • NodeJS
  • Gulp

Use npm install --save-dev <link-to-this-repo> or npm install --save-dev @ominestre/zugzug to install zugzug as one of your projects development dependencies.

How to use

Each function of ZugZug takes a configuration object with the following properties:

  • source {Array | String} - path to your source files relative to gulpfile.js
  • destination {String} - where to drop the processed files relative to gulpfile.js
  • name {String} - OPTIONAL
    • This is the name of your output file. Not required for images.
    • During minification ".min" will be suffixed onto the name. So if you specify "bundle.js" the final output will be "bundle.min.js".

You will need to create a gulpfile in your primary project directory and pass in the configurations for each task. Here is a sample gulpfile.js using this module with JavaScript and CSS builds:

const gulp = require('gulp');
const build = require('@ominestre/zugzug');

gulp.task('css', () => {
  build.css({
    source: './path/to/css/test.css',
    name: 'work-complete.css',
    destination: './build/more/farms/'
  });
}));

gulp.task('js', () => {
  build.js({
    source: './what/you/want.js',
    destination: './stop/poking/me/'
  });
});

Each task is then invoked from the command line using gulp task-name. See gulpjs.com for more details on the ins and outs of Gulp.

!important Don't use array notation to pass params into the function due to the JavaScript object having a stowaway for webpack.

gulp.task('js', build.javascript[{
  //this is a lazy peon and won't work
}]);

Tasks

CSS

Standalone

The CSS task is included for convenience and legacy support but it is recommended that you adopt SASS instead.

This task features file concatenation of all specified CSS files, auto-prefixing, generates a sourcemap, and minification.

const build = require('@ominestre/zugzug');

build.css({
  source: '/path/to/files/*.css',
  destination: '/path/to/destination/',
  name: 'optional.file.name' //defaults to styles.css if not specified
});

SASS

Does not include minification and concetenation. Chain CSS task after.

This will compile all of your SASS files. It will also run each through an auto-prefixer and generate source maps. For minification it is recommended that you chain the output of this into the CSS task (example below);

const build = require('@ominestre/zugzug');

build.sass({
  source: '/path/main.scss',
  destination: '/path/to/destination/'
}).on('end', () => {
  build.css({
    source: '/path/to/destination/main.scss',
    destination: '/path/to/destination/',
    name: 'sass-demo.css'
  });
})

Images

Standalone

Images uses Gulp Imagemin for compression of PNG, JPG, GIF, and SVG files. It will compress all files specified in source. If you use a wild card it will simply pass through all non-image files to the specified destination.

const build = require('@ominestre/zugzug');

build.images({
  source: '/path/to/images/*.*',
  destination: '/path/to/destination/'
});

JavaScript - Standard

Standalone

With ZugZug, JavaScript handling comes in two flavors. Standard has concatenation of files, babel for ES5 support, sourcemapping, and minification. Webpack is the same as standard with Webpack added for code splitting.

const build = require('@ominestre/zugzug');

build.javascript({
  source: '/path/to/files/*.js',
  destination: '/path/to/destination/',
  name: 'optional.output.name' //uses scripts.js if not specified
});

JavaScript - Webpack

Standalone

The webpack protion of zugzug allows for code splitting of your JavaScript so that you don't end up supporting a monolithic beast script.

To use simply point it to your primary file you wish to bundle like so:

const build = require('@ominestre/zugzug');

build.javascript.webpack({
  source: '/path/to/main-js-file.js',
  destination: '/path/to/destination/',
  name: 'optional.output.name' //uses bundle.js if not specified
});

Zipper

Standalone

Creates a zip file. Or maybe it alerts you when you leave your fly down after taking a whiz.

const build = require('@ominestre/zugzug');

build.zipper({
  source: '/path/to/files/**/*.*',
  destination: '/path/to/destination/',
  name: 'optional.file.name' //defaults to zippity.zip if not specified
})

Mover

Standalone

This is just a simple file mover, equivalent of the mv command.

const build = require('@ominestre/zugzug');

build.mv({
  source: '/path/to/files/*',
  destination: '/path/to/destination/'
});