├── .gitignore ├── lib └── grunt-node-example.js ├── grunt.js ├── package.json ├── test └── grunt-node-example_test.js ├── LICENSE-MIT └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | -------------------------------------------------------------------------------- /lib/grunt-node-example.js: -------------------------------------------------------------------------------- 1 | /* 2 | * grunt-node-example 3 | * https://github.com/cowboy/grunt-node-example 4 | * 5 | * Copyright (c) 2012 "Cowboy" Ben Alman 6 | * Licensed under the MIT license. 7 | */ 8 | 9 | exports.awesome = function() { 10 | return 'awesome'; 11 | }; 12 | -------------------------------------------------------------------------------- /grunt.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | 3 | // Project configuration. 4 | grunt.initConfig({ 5 | pkg: '', 6 | test: { 7 | files: ['test/**/*.js'] 8 | }, 9 | lint: { 10 | files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js'] 11 | }, 12 | watch: { 13 | files: '', 14 | tasks: 'default' 15 | }, 16 | jshint: { 17 | options: { 18 | curly: true, 19 | eqeqeq: true, 20 | immed: true, 21 | latedef: true, 22 | newcap: true, 23 | noarg: true, 24 | sub: true, 25 | undef: true, 26 | boss: true, 27 | eqnull: true, 28 | node: true 29 | }, 30 | globals: { 31 | exports: true 32 | } 33 | } 34 | }); 35 | 36 | // Default task. 37 | grunt.registerTask('default', 'lint test'); 38 | 39 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "grunt-node-example", 3 | "description": "This is example output generated by the \"grunt init:node\" task.", 4 | "version": "0.1.0", 5 | "homepage": "https://github.com/cowboy/grunt-node-example", 6 | "author": { 7 | "name": "\"Cowboy\" Ben Alman", 8 | "url": "http://benalman.com/" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com/cowboy/grunt-node-example.git" 13 | }, 14 | "bugs": { 15 | "url": "https://github.com/cowboy/grunt-node-example/issues" 16 | }, 17 | "licenses": [ 18 | { 19 | "type": "MIT", 20 | "url": "https://github.com/cowboy/grunt-node-example/blob/master/LICENSE-MIT" 21 | } 22 | ], 23 | "main": "lib/grunt-node-example", 24 | "engines": { 25 | "node": "~0.6.14" 26 | }, 27 | "scripts": { 28 | "test": "grunt test" 29 | }, 30 | "dependencies": {}, 31 | "devDependencies": { 32 | "grunt": "~0.3.8" 33 | }, 34 | "keywords": [] 35 | } -------------------------------------------------------------------------------- /test/grunt-node-example_test.js: -------------------------------------------------------------------------------- 1 | var grunt_node_example = require('../lib/grunt-node-example.js'); 2 | 3 | /* 4 | ======== A Handy Little Nodeunit Reference ======== 5 | https://github.com/caolan/nodeunit 6 | 7 | Test methods: 8 | test.expect(numAssertions) 9 | test.done() 10 | Test assertions: 11 | test.ok(value, [message]) 12 | test.equal(actual, expected, [message]) 13 | test.notEqual(actual, expected, [message]) 14 | test.deepEqual(actual, expected, [message]) 15 | test.notDeepEqual(actual, expected, [message]) 16 | test.strictEqual(actual, expected, [message]) 17 | test.notStrictEqual(actual, expected, [message]) 18 | test.throws(block, [error], [message]) 19 | test.doesNotThrow(block, [error], [message]) 20 | test.ifError(value) 21 | */ 22 | 23 | exports['awesome'] = { 24 | setUp: function(done) { 25 | // setup here 26 | done(); 27 | }, 28 | 'no args': function(test) { 29 | test.expect(1); 30 | // tests here 31 | test.equal(grunt_node_example.awesome(), 'awesome', 'should be awesome.'); 32 | test.done(); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 "Cowboy" Ben Alman 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Grunt "init:node" example 2 | 3 | This is example output generated by the "grunt init:node" task. 4 | 5 | _Note: this repository was generated dynamically using grunt v0.3.8. Instead of 6 | reporting issues here, please report any issues with this repository as 7 | [grunt issues][issues]. Instead of watching or forking this repository, 8 | watch [grunt][grunt] and use the grunt [init task][init]._ 9 | 10 | ## Project Creation Transcript 11 | The following is a transcript of the session in which this project and 12 | repository were created. This is not actually a part of the [grunt][grunt] 13 | "init:node" template, this session transcript was added afterwards. The 14 | text after the `$` are the commands that were executed, and everything else is 15 | program output. If you want to see the repository exactly as it was created by 16 | grunt, view [the previous commit][prev]. 17 | 18 | Want to learn more? Check [grunt][grunt] out. 19 | 20 | [grunt]: https://github.com/cowboy/grunt 21 | [issues]: https://github.com/cowboy/grunt/issues 22 | [init]: https://github.com/cowboy/grunt/blob/master/docs/task_init.md 23 | [expect]: https://github.com/cowboy/grunt/blob/master/dev/init.exp 24 | [prev]: https://github.com/cowboy/grunt-node-example/tree/HEAD~1 25 | 26 | Note that this entire build process is automated by a rather complex [expect 27 | script][expect], which is used to automate grunt in order to facilitate the 28 | creation of this and other [init task][init] example repositories. 29 | 30 | ``` 31 | $ mkdir grunt-node-example && cd grunt-node-example 32 | 33 | $ git init 34 | git remote add origin git@github.com:cowboy/grunt-node-example.git 35 | Initialized empty Git repository in /private/tmp/grunt-node-example/.git/ 36 | 37 | $ git remote add origin git@github.com:cowboy/grunt-node-example.git 38 | 39 | $ grunt init:node 40 | Running "init:node" (init) task 41 | This task will create one or more files in the current directory, based on the 42 | environment and the answers to a few questions. Note that answering "?" to any 43 | question will show question-specific help and answering "none" to most questions 44 | will leave its value blank. 45 | 46 | "node" template notes: 47 | Project name shouldn't contain "node" or "js" and should be a unique ID not 48 | already in use at search.npmjs.org. 49 | 50 | Please answer the following: 51 | [?] Project name (grunt-node-example) 52 | [?] Description (The best project ever.) This is example output generated by the "grunt init:node" task. 53 | [?] Version (0.1.0) 54 | [?] Project git repository (git://github.com/cowboy/grunt-node-example.git) 55 | [?] Project homepage (https://github.com/cowboy/grunt-node-example) 56 | [?] Project issues tracker (https://github.com/cowboy/grunt-node-example/issues) 57 | [?] Licenses (MIT) 58 | [?] Author name ("Cowboy" Ben Alman) 59 | [?] Author email (none) 60 | [?] Author url (http://benalman.com/) 61 | [?] What versions of node does it run on? (~0.6.14) 62 | [?] Main module/entry point (lib/grunt-node-example) 63 | [?] Npm test command (grunt test) 64 | [?] Do you need to make any changes to the above before continuing? (y/N) 65 | 66 | Writing .gitignore...OK 67 | Writing grunt.js...OK 68 | Writing lib/grunt-node-example.js...OK 69 | Writing README.md...OK 70 | Writing test/grunt-node-example_test.js...OK 71 | Writing LICENSE-MIT...OK 72 | 73 | Initialized from template "node". 74 | 75 | Done, without errors. 76 | 77 | $ tree 78 | . 79 | ├── LICENSE-MIT 80 | ├── README.md 81 | ├── grunt.js 82 | ├── lib 83 | │   └── grunt-node-example.js 84 | ├── package.json 85 | └── test 86 | └── grunt-node-example_test.js 87 | 88 | 2 directories, 6 files 89 | 90 | $ grunt 91 | Running "lint:files" (lint) task 92 | Lint free. 93 | 94 | Running "test:files" (test) task 95 | Testing grunt-node-example_test.js.OK 96 | >> 1 assertions passed (1ms) 97 | 98 | Done, without errors. 99 | 100 | $ tree 101 | . 102 | ├── LICENSE-MIT 103 | ├── README.md 104 | ├── grunt.js 105 | ├── lib 106 | │   └── grunt-node-example.js 107 | ├── package.json 108 | └── test 109 | └── grunt-node-example_test.js 110 | 111 | 2 directories, 6 files 112 | 113 | $ git add . 114 | 115 | $ git commit -m 'Committing example "grunt init:node" task output.' 116 | [master (root-commit) 723087a] Committing example "grunt init:node" task output. 117 | 7 files changed, 169 insertions(+), 0 deletions(-) 118 | create mode 100644 .gitignore 119 | create mode 100644 LICENSE-MIT 120 | create mode 100644 README.md 121 | create mode 100644 grunt.js 122 | create mode 100644 lib/grunt-node-example.js 123 | create mode 100644 package.json 124 | create mode 100644 test/grunt-node-example_test.js 125 | 126 | ``` 127 | 128 | ## License 129 | Copyright (c) 2012 "Cowboy" Ben Alman 130 | Licensed under the MIT license. 131 | --------------------------------------------------------------------------------