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-artisan

v1.5.8

Published

gulp artisan

Downloads

21

Readme

What is gulp artisan?

Gulp artisan is a tool which can optimize website based on json configration files

What can gulp artisan do?

  • Images Compress images using gifsicle/mozjpeg/pngquant/svgo
  • Sprites Generate Sprites
  • CSS Minify css
  • JS Minify js
  • Console Collect console warnings/errors in chrome
  • Network Collect network performance inforamtion in chrome

Install on Mac

//environment requirements
chrome
//install node
https://nodejs.org
//install gulp
npm install --global gulp
//install gulp artisan
npm install --global gulp-artisan

Install on Linux

//environment requirements
glibc>=2.14
nasm
chrome [https://www.itzgeek.com/how-tos/linux/centos-how-tos/install-google-chrome-37-on-centos-7-rhel-7.html]
//install node
https://nodejs.org/en/download/
please install node using non-root user
//install gulp
npm install --global gulp
//install gulp artisan
npm install --global gulp-artisan
//modify ~/.bashrc using non-root user
export PATH=$PATH:~/node-v8.11.2-linux-x64/bin
export GULP_ARTISAN_PACKAGE_PATH=~/node-v8.11.2-linux-x64/lib/node_modules/gulp-artisan

Command

gulp-artisan  
--run compress //compress images
--run atlas //generate sprites
--run minify_css //minify css
--run minify_js //minify js
--run console //collect console warnings/errors in chrome
--run network //collect network performance inforamtion in chrome
--config xxxx.json //specify json
--cwd //change directory

Default configuration file

sample compress_images.json
path: images/** //recursive directory
path: !images/a.png //ignore file
gifsicle: [https://www.npmjs.com/package/imagemin-gifsicle]
mozjpeg: [https://www.npmjs.com/package/imagemin-mozjpeg]
pngquant: [https://www.npmjs.com/package/imagemin-pngquant]
svgo: [https://www.npmjs.com/package/imagemin-svgo]
{
    "images1": {
        "input" : "images2/*",
        "output": "dist/images2"
    }
}
{
    "images1": {
        "input"   : "images2/*",
        "output"  : "dist/images2",
        "enabled" : false,
        "gifsicle": {
            "interlaced": true
        },
        "mozjpeg" : {
            "quality": 90
        },
        "pngquant": {
            "quality": "60-80"
        },
        "svgo"    : {
            "plugins": [
                {
                    "removeViewBox": false
                }
            ]
        }
    }
}
sample atlas_sprites.json
image_path_prefix: image path prefix in generated css file
{
    "buttons1": {
        "input"       : "buttons1/*",
        "output_image": "src/image",
        "output_css"  : "src/css",
        "image_name"  : "atlas_buttons1.png",
        "css_name"    : "atlas_buttons1.css"
    },
    "buttons2": {
        "input"            : "buttons1/*",
        "output_image"     : "src/image",
        "output_css"       : "src/css",
        "image_name"       : "atlas_buttons1.png",
        "css_name"         : "atlas_buttons1.css"
        "image_path_prefix": "../buttons1/"
    }
}
sample minify_css.json
{
    "css1": {
        "input" : "css1/*",
        "output": "css1-minify"
    },
    "css2": {
        "input" : "css2/*",
        "output": "css2-minify",
        "concat": "css2.min.css"
    },
    "css3": {
        "input" : ["css3/a.css","css3/b.css"],
        "output": "css3-minify",
        "concat": "css3.min.css"
    }
}
sample minify_js.json
{
    "js1": {
        "input" : "js1/*",
        "output": "js1-minify"
    },
    "js2": {
        "input" : "js2/*",
        "output": "js2-minify",
        "concat": "js2.min.js"
    },
    "js3": {
        "input" : ["js3/a.js","js3/b.js"],
        "output": "js3-minify",
        "concat": "js3.min.js"
    }
}
sample console.json
{
    "narutoen"  : [
        "http://naruto.oasgames.com/en/articlelist/news",
        "http://naruto.oasgames.com/en/strategy/gameStrategy"
    ],
    "tr"        : [
        "https://tr.oasgames.com"
    ],
    "user_agent": "iphone"
}
sample network.json
{
    "narutoen"  : [
        "https://naruto.oasgames.com/en/"
    ],
    "oasgames"  : [
        "https://oasgames.com/pc/zh/home.html"
    ],
    "size"      : 500,
    "time"      : 1.5,
    "user_agent": "iphone"
}

License

MIT License