grunt-wow

Increase developer morale.

grunt-wow

Increase developer morale. Show a random (cheeky|funny|wise|motivational) message in the terminal.

The list of messages to choose from is configurable and can be either a simple array of strings or a local or remote file path. If you are using a file, messages will be split by the delimiter option.

This plugin requires Grunt ~0.4.2

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-wow --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-wow');

In your project's Gruntfile, add a section named wow to the data object passed into grunt.initConfig().

grunt.initConfig({
  wow: {
    your_target: {
      source: ['you are {buzz} amazing.', 'damn! you got {adj} game.', 'better luck next time.']
    },
  },
});
grunt.initConfig({
  wow: {
    your_target: {
      source: 'http://f.cl.ly/items/2F1X430I0v0V0F1q0D1m/sayings.txt'
    },
  },
});

required
Type: Array or String
Default value: null

Either a simple array of strings or a path to a text file.

Type: String
Default value: \n (\r\n on Windows)

The delimiter used to split the source file into an array. The default value is set using grunt.util.linefeed.

Type: Integer or false
Default value: 300

How long should the cache be considered fresh, in seconds. External files get cached so they don't need to be loaded every time grunt-wow runs. Can be set to false to disable the cache entirely. The cache lives next to your Gruntfile in the .grunt directory as suggested by the Grunt team.

When writing your messages, there are a few placeholders you can use: {noun}, {adj}, {buzz}, and {num}. These will be replaced with random data generated by the Faker module. See Overview section above for an example.

Use a published Google Spreadsheet so your entire team can add or remove messages at any time! Use a single column in the spreadsheet then grab the published URL for CSV or TXT format.

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Inspired by:

  • 2013-12-14   v0.1.4
    • add caching functionality so external files don't have to fetched everytime.
    • make delimiter configurable
    • use Grunt.util where helpful
  • 2013-12-13   v0.1.3
    • Add support for random numbers with {num}
    • Allow multiple instances of the same placeholder
  • 2013-12-12   v0.1.2
    • Initial release (npm noob, messed up SEM)