Created
September 7, 2016 08:17
-
-
Save paolochiodi/748cb3b5db27b7588c14f9866bca02da to your computer and use it in GitHub Desktop.
Seneca3 problem with decorate in plugins and chained configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
var plugin = require('./plugin'); | |
require('seneca')({ | |
tag: 'repl', | |
log: 'silent', | |
legacy: { logging: false }, | |
debug: {short_logs:true} | |
}) | |
.use(plugin) | |
.testDecoration() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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