Skip to content

Instantly share code, notes, and snippets.

@paolochiodi
Created September 7, 2016 08:17
Show Gist options
  • Save paolochiodi/748cb3b5db27b7588c14f9866bca02da to your computer and use it in GitHub Desktop.
Save paolochiodi/748cb3b5db27b7588c14f9866bca02da to your computer and use it in GitHub Desktop.
Seneca3 problem with decorate in plugins and chained configuration
'use strict'
var plugin = require('./plugin');
require('seneca')({
tag: 'repl',
log: 'silent',
legacy: { logging: false },
debug: {short_logs:true}
})
.use(plugin)
.testDecoration()
{
"name": "test_seneca",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"seneca": "^3.0.0"
}
}
module.exports = function (options) {
console.log('plugin init');
this.decorate('testDecoration', function () {
console.log('inside the decoration');
});
return {
name: 'test plugin',
options: options
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment