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

cake-gulp4

v4.0.0-alpha.2

Published

Use all those wonderful gulp plugins from your Cakefile

Downloads

8

Readme

cake-gulp

Stuff your face with all those wonderful Gulp plugins from your Cakefile!

WARNING: This is a preview release. This branch uses tempgulp4 as Gulp 4 has not yet officially released at the time of this writing.

cake-gulp integrates cake's descriptive build task system and commandline argument parsing into gulp tasks, allowing for clean descriptive task management.

cake-gulp also includes some common gulp plugins that relate directly to coffeescript, file management, or vynil/stream management but do not directly impose any framework or specific build paradigm on you. These plugins are useful for general filesystem manipulation, flow control of streams, information and logging, or incremental builds. These plugins where chosen because of their general usefulness in just about any build process regardless of what you are doing, things that are used so often they are practically a part of Gulp.

Example:

Image of the below example Cakefile

# This Cakefile incrementally transpiles .coffee files
#  to one combined minified javascript file with sourcemaps
# `npm install -save-dev cake-gulp`
# `cake build`
# `cake -w build` for watching incremental builds

pack = require './package.json'
gulp = require 'cake-gulp'
distDirectory = "#{__dirname}/dist"

task 'build:clean', 'Cleans all generated or temporary files.', ->
  gulp.delete distDirectory

coffeeSources = ["#{__dirname}/src/**/*.coffee"]
task 'build:coffee', 'Transpiles .coffee → .js with sourcemaps', ->
  gulp.src coffeeSources
    .pipe gulp.cached()
    .pipe gulp.size title: 'coffee', showFiles: yes
    .pipe gulp.sourcemaps.init()
      .pipe gulp.coffee()
      .pipe gulp.remember()
      .pipe gulp.concat "#{pack.name}.min.js"
      .pipe gulp.uglify()
    .pipe gulp.sourcemaps.write '.'
    .pipe gulp.size title: 'coffee → javascript', showFiles: yes, gzip: yes
    .pipe gulp.duration 'coffee'
    .pipe gulp.dest distDirectory
    .pipe gulp.gzip()
    .pipe gulp.dest distDirectory

option '-w', '--watch', 'Watch for file changes for build tasks.'
task 'build', 'Build all the things! -w to watch for changes.',
  gulp.series 'build:clean', 'build:coffee', (callback) ->
    # `gulp.options` is from cake's option parsing of commandline options
    if gulp.options.watch
      gulp.log "#{gulp.colors.cyan 'watching'} #{coffeeSources}"
      gulp.watch coffeeSources, gulp.series 'build:coffee'
    callback()

Globals from cake

  • task("name", "description", (callback) -> ) task has been modified to accept both a string name and a string description, but other then adding the description, task is no different from undertaker task which is what Gulp4 uses for it's task manager. async-done is used for the callback function, and it is also fairly common to pass gulp.series or gulp.parallel in instead of a (callback) -> function to execute tasks in a series, or at the same time. cake's options object that would usually get passed in is now global.options or gulp.options and is only available inside a task function.
  • invoke(name) runs a single task (by name string only) currently. This only invokes cake tasks and currently will not work if you use gulp.task
  • option("-a", "--argument [ARG]", "description") is useful for commandline parsing and is cake's option function.
  • global.options or gulp.options is where you access your commandline arguments. Because Gulp/Undertaker does not handle commandline options, these are not passed in to task functions like in cake. Keep in mind that options is still only available after a task function is invoked.

Gulp Plugins and Utilities

cake-gulp comes with some common generic gulp plugins that should be useful in just about any build process. All gulp plugins are bound to the gulp object.

Coffeescript and Sourcemaps

File Manipulation

Incrimental Builds

Stream Flow Control

Utility and Logging

License

Public Domain (Unlicense)

cake-gulp