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

v0.4.0

Published

Run a Node.js application for development, with support for auto-reload.

Downloads

2,245

Readme

grunt-develop Build Status

Run a Node.js application for development, with support for auto-reload.

Notes:

  • Requires Grunt >= 0.4.1 && Node.js >= 0.10.0
  • ~~Does not provide a file-watch, grunt-contrib-watch is helpful here~~
  • No need to modify/export your server or alter your applications code
  • ~~Non-blocking (the task completes immediately and the application will un in the background);~~ Run as last task
  • ~~Reloads cleanly the application when the task is called again, allowing for auto-reload.~~

Contributing

This project has a lot of active contributors and users. Please submit a test along with any changes made. Thanks!

Install

$ npm install grunt-develop

Basic Gruntfile.js Example

module.exports = function(grunt) {

  grunt.initConfig({
    develop: {
      server: {
        file: 'app.js',
        nodeArgs: ['--debug'],            // optional
        args: ['appArg1', 'appArg2']      // optional
        env: { NODE_ENV: 'development'}      // optional
      }
    }
  });

  grunt.loadNpmTasks('grunt-develop');

  grunt.registerTask('default', ['develop']);

};

Coffeescript App Example

You may also have develop automatically restart coffeescript based node applications by using the cmd option. This option allows the user to specify which command/executable to use when restarting the server.

module.exports = (grunt) ->

  grunt.initConfig
    develop:
      server:
        file: 'app.coffee'
        cmd: 'coffee'

  grunt.loadNpmTasks 'grunt-develop'

  grunt.registerTask 'default', ['develop']

A more complex Gruntfile.js

To support auto-reload on changes, for example:

module.exports = function(grunt) {

  grunt.initConfig({
    watch: {
      js: {
        files: [
          'app.js',
          'routes/**/*.js',
          'lib/*.js'
        ],
        tasks: ['develop'],
        options: { nospawn: true }
      }
    },
    develop: {
      server: {
        file: 'app.js'
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-develop');

  grunt.registerTask('default', ['develop']);

};

The nospawn is required to keep the grunt context in which grunt-develop is running your application.

Then you can run grunt as the following and get automatic restart of the application on file changes:

$ grunt

You may add any other task in the watch, like JS linting, asset compiling, etc. and customize the watch to your needs. See grunt-contrib-watch.

License (MIT)

Copyright (c) 2013, Edward Hotchkiss.

Author: Edward Hotchkiss

Bitdeli Badge