Skip to content

Commit

Permalink
Make util API self-documenting in sample couchtato.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ronjouch committed Jan 12, 2016
1 parent 03a3acc commit 242e8e3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions examples/couchtato.js
Expand Up @@ -2,6 +2,24 @@ exports.conf = {
"tasks": {
"all_docs": function (util, doc) {
util.log(doc);

// That 'util' in function (util, doc) is a utility variable,
// it provides you with the following convenient functions:

// save the document back to the database
// util.save(doc)

// remove the document from the database
// util.remove(doc)

// increment a counter associated with a particular key
// all counters will be displayed in the summary report
// util.count('somekey')

// log a message to both the console and to couchtato.log file
// if you only want to display a message on the console,
// simply use good old console.log(message)
// util.log(message)
}
}
};

0 comments on commit 242e8e3

Please sign in to comment.