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

connectholland-gulp-tasks

v4.1.0

Published

A collection of tasks to load by gulp

Downloads

30

Readme

Gulp tasks

A collection of configurable tasks that can be used to generate most of the necessary frontend assets like css, javascript, fonticons and more…

Install with npm

npm install connectholland-gulp-tasks --save-dev

gulpfile.js

'use strict';

var gulp = require('gulp');
var taskLoader = require('gulp-simple-task-loader');
var config = require('./config.json');

// Load the tasks usingthe taskloader
taskLoader({
    taskDirectory: 'node_modules/connectholland-gulp-tasks/tasks',
    config: config
}, gulp);

Configuration

config.json

{
    "default_tasks": [
        "sass",
        "javascript"
    ],
    "install_tasks": ["icons"],
    "production": true,
    "sass": {
        "src": [
            "style/*.scss"
        ],
        "dest": "web/assets/css",
        "watch": [
            "style/**/*.scss"
        ],
        "includePaths": [
            "node_modules/normalize-scss"
        ],
        "autoprefix": [
            "last 2 versions"
        ]
    },
    "javascript": {
        "items": [
            {
                "src": [
                    "node_modules/jquery/dist/jquery.min.js",
                    "node_modules/jquery-noconflict/index.js"],
                "outputname": "body.min.js",
                "dest": "web/assets/javascript/"
            }
        ],
        "watch": [
            "javascript/**/*.js"
        ]
    },
    "icons": {
        "src": [
            "icons/*.svg"
        ],
        "dest": "web/assets/fonts/",
        "webpath": "/assets/fonts/"
    }
}

This is a basic configuration that can be used as an example to get started on setting this up for your own project

default_tasks

The tasks that will be run if you type gulp or gulp watch

install_tasks

The tasks that will be run if you type gulp install

production

if set to true all outputed files are optimized for production when running gulp. this setting is overwritten to false if you run gulp watch

tasks

all the settings for other tasks like sass, javascript & icons are defined below.

Sass task

Add the following to the config.json

"sass": {
        "src": [
            "style/**/*.scss"
        ],
        "dest": "../../web/assets/css",
        "watch": [
            "style/**/*.scss"
        ],
        "includePaths": [
            "node_modules/compass-mixins/lib",
            "node_modules/connectholland-sass-mixins/",
            "node_modules/node.normalize.scss"
        ],
        "autoprefix": [
            "last 2 versions",
            "IE >= 8"
        ]
    }

###scss-lint To disable linting or to use a custom config file, you can add a linting object

"sass": {
        "linting": {
            "enabled": false,
            "configfile": ".scss-lint.yml"
        }
    }

Javascript task

To use the EcmaScript 2015 (ES6) transpiling or to enable the javascript linter, you must enable it in the config file

Example configuration:

    "javascript": {
        "items": [
            {
                "src": [
                    "javascript/app.js"
                ],
                "outputname": "app.js",
                "dest": "../../web/assets/javascript/",
                "options": {},
                "es2015": true,
                "lint": true
            }
        ],
    }

Inline images task

With the task inline-images you can create a 'sprite' of inline css images. The task generates an scss file with the inline-image($name) mixin and .inline-image-* css classes.

Example configuration of config.json:

    "inline-images": {
        "src": [
            "images/icons2x/*"
        ]
    }

icons task

With the icons tasks it's possible to convert a set of svg's to a font family. The result is a folder with fonts and an scss file with variables and mixins that can be used to use it in your project.

Example configuration:

"icons": {
        "src": [
            "icons/*.svg"
        ],
        "formats": ["ttf", "eot", "woff", "svg", "woff2"], 
        "dest": "web/assets/fonts/",
        "webpath": "/assets/fonts/"
    },
  • src the path to the source svg's.
  • formats (not required) but can be used to overwrite the font types that are generated (ttf, eot, woff, svg, woff2 is the default).
  • dest the path on the disk where the font will be placed
  • webpath the path used by the browser to request the fonts