imdone-echo-plugin
Advanced tools
Comparing version 0.0.2 to 0.0.3
21
index.js
@@ -1,2 +0,3 @@ | ||
var path = require('path'); | ||
var path = require('path'), | ||
util = require('util'); | ||
@@ -12,4 +13,10 @@ module.exports = function(config, repo) { | ||
var log = require('debug')(this.config.name || 'imdone-echo-plugin'); | ||
var name = this.config.name || "imdone-echo"; | ||
var log = function() { | ||
var args = Array.prototype.slice.call(arguments); | ||
args[0] = name + ": " + args[0]; | ||
util.debug(util.format.apply(util, args)); | ||
} | ||
log("Logging events for: %s", repo.getId()); | ||
@@ -20,19 +27,19 @@ | ||
this.repo.on('task.found', function(task) { | ||
log('%s: %j', 'task.found', task, {}); | ||
log('%s: %j', 'task.found', task); | ||
}); | ||
this.repo.on('list.found', function(list) { | ||
log('%s: %j', 'list.found', list.toConfig(), {}); | ||
log('%s: %j', 'list.found', list.toConfig()); | ||
}); | ||
this.repo.on('file.update', function(data) { | ||
log('%s: %j', 'file.update', data, {}); | ||
log('%s: %j', 'file.update', data); | ||
}); | ||
this.repo.on('file.delete', function(data) { | ||
log('%s: %j', 'file.delete', data, {}); | ||
log('%s: %j', 'file.delete', data); | ||
}); | ||
this.repo.on('file.processed', function(data) { | ||
log('%s: %j', 'file.processed', data, {}); | ||
log('%s: %j', 'file.processed', data); | ||
}); | ||
@@ -39,0 +46,0 @@ |
{ | ||
"name": "imdone-echo-plugin", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A sample iMDone plugin that logs to the console with debug", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
imdone-echo-plugin | ||
================== | ||
Example plugin for iMDone that logs to the console using debug | ||
Example plugin for iMDone that logs to the console | ||
@@ -14,4 +14,3 @@ Getting started with iMDone plugins | ||
2. `cd /my/project/folder` One that already has a `.imdone/config` or create it. | ||
3. `export DEBUG=imdone:echo` | ||
4. `imdone -o` | ||
3. `imdone -o` | ||
@@ -18,0 +17,0 @@ ### Plugin interface |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5455
51
56