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.
Getting Started
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;
The "wow" task
Overview
In your project's Gruntfile, add a section named wow
to the data object passed into grunt.initConfig()
.
grunt;
grunt;
Options
options.source
required
Type: Array
or String
Default value: null
Either a simple array of strings or a path to a text file.
options.delimiter
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.
options.cache
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.
Placeholders (pseudo templates)
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.
Usage Ideas
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.
Contributing
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.
Inspiration
Inspired by:
Release History
- 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)