gruntjs/grunt — pull request #1108 by auscaster (2014-03-31 02:37:14+00:00)
Title: Scripting Grunt-Init #64 via grunt-init: Added nogruntfile option so tas...

Fix for "Scripting Grunt-Init #64" via grunt-init. Grunt can now be used programmatically from JavaScript without the need for a Gruntfile like so:

```
var grunt = require('grunt');

grunt.initConfig({
pkg: {
"name" : "grunt-prog-test",
"version" : "0.0.1",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-concat": "~0.1.3",
"grunt-contrib-cssmin" : "~0.6.1"
}
},
concat: {
css: {
src: [
'src/*.css'
],
dest: 'dist/test.css'
}
},
cssmin: {
css: {
src: 'dist/test.css',
dest: 'dist/test.min.css'
}
}
});

grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');

grunt.tasks([ 'concat:css', 'cssmin:css' ], { verbose: true, nogruntfile: true }, function () {
console.log('done')
});
```