Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
grunt-develop
Advanced tools
Run a Node.js application for development, with support for auto-reload.
Run a Node.js application for development, with support for auto-reload.
This project has a lot of active contributors and users. Please submit a test along with any changes made. Thanks!
$ npm install grunt-develop
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']);
};
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']
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.
Copyright (c) 2013, Edward Hotchkiss.
FAQs
Run a Node.js application for development, with support for auto-reload.
We found that grunt-develop demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.