Skip to content

Instantly share code, notes, and snippets.

@jtrussell
Last active December 25, 2015 23:48
Show Gist options
  • Save jtrussell/7059144 to your computer and use it in GitHub Desktop.
Save jtrussell/7059144 to your computer and use it in GitHub Desktop.
Gruntfile and package.json boilerplate for new node modules.
/*global module:false*/
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'gruntfile.js'
},
lib_test: {
src: ['lib/**/*.js', 'test/**/*.js']
}
},
simplemocha: {
files: ['test/**/*_test.js']
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
lib_test: {
files: '<%= jshint.lib_test.src %>',
tasks: ['jshint:lib_test', 'test']
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-simple-mocha');
grunt.registerTask('test', ['simplemocha']);
grunt.registerTask('default', ['jshint', 'test']);
};
{
"name": "node-module",
"version": "0.0.0",
"description": "Does node stuff",
"main": "lib/index.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "grunt test"
},
"repository": {
"type": "git",
"url": "git://github.com/jtrussell/node-module.git"
},
"keywords": [],
"author": "jtrussell",
"license": "MIT",
"bugs": {
"url": "https://github.com/jtrussell/node-module/issues"
},
"devDependencies": {
"grunt-simple-mocha": "~0.4.0",
"grunt-contrib-jshint": "~0.6.4",
"grunt": "~0.4.1",
"grunt-contrib-watch": "~0.5.3",
"chai": "~1.8.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment