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

grunt-commands

v0.1.8

Published

Easy way to run shell commands, batch files or executable files in grunt.

Downloads

153

Readme

grunt-commands Build Status

Easy way to run shell commands, batch files or executable files in grunt.

Getting Started

This plugin requires Grunt ~0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-commands --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-commands');

This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that you upgrade.

Command task

Run this task with the grunt commands command.

Task targets, options may be specified according to the grunt Configuring tasks guide.

Options

force

Type: Boolean Default: true

Usage Examples

    watch: {
        // ...
    },

    // this task (grunt-commands)
    commands: {
        options: {force: false},
        target_1: {
            cmd: 'xxx.js', // detected to nodejs
        },
        target_2: {
            cmd: [
                'xxx.sh', // detected to shell
                {
                    cmd: 'xxx.bat', // detected to batch commands
                    force: true
                },
                'cd ./xxx/a' // any commands of OS supports
            ]
        }
    }

    jshint: {
        // ...
    }
  • Use nodejs file as commands
    commands : {

        // Run tests via nodejs
        tests: {
            cmd: './test/tests.js'
        },

        // If file name has space chars
        // you must write it like this.
        // this is usually by Windows users
        test2: {
            cmd: './test/include\\ space.js'
        },
    }
  • Use shell file as commands (Only for Linux/Unix platform)
    commands : {

        // Deploy project via ShellScript
        deploy: {
            cmd  : './test/deploy.sh',
            force: true
        }
    }
  • Use batch commands file (Only for Windows platform).
    commands : {
        // Package to zip file via Windows batch file
        zip: {
            cmd  : './test/zip.bat'
        }
    }
  • Custom commands your OS supports.
    // this task
    commands: {

        someOthorCommands: {
            cmd: [
                // commands one
                {
                    cmd: 'cd tmp && echo "Time `date`" > cmd.log',

                    // if dir `tmp` exists will throw an error,
                    // so set `force: true` to igone the error.
                    force: true
                },

                // commands two
                'cd tmp && echo "Time `date`" > cmd2.log',

                // Rename js file, special the extend name is `.js`
                renameNodejsFile: {
                    cmd  : 'mv ./tmp/nodejs.js ./tmp/nodejs-md.js'
                },

                // Delete shell file, special the extend name is `.sh`
                renameNodejsFile: {
                    cmd  : 'rm ./tmp/shell-md.sh'
                }
            ]
        }
    },

Release History

  • 2014-10-28 v0.1.7
    • Add feture
    • automaticly to detect commands type.
    • Use nodejs.child_process.exec as default executor, Let it support as more command types as OS supports.
    • Bug fixed:
    • #3 Rename from grunt-contrib-commands to grunt-commands.
    • #4 Rewrite commands executor use node.child_process.
    • #5 Change all task name as same of commands.
  • 2013-07-19 v0.1.0 Start up project .

Task submitted by Colin Luo

This file was generated on Fri Jul 19 2013 0:29:15.