Skip to content

Instantly share code, notes, and snippets.

Last active Oct 26, 2018
What would you like to do?
BakeryJS Example Component (wordcount)
const {boxFactory} = require('bakeryjs');
module.exports = boxFactory(
// name
// metadata
provides: ['words'],
requires: ['text'],
emits: [],
aggregates: false,
// body
function(serviceProvider, message) {
const wordsCount = message.text.split(/\W+/).length;
return {words: wordsCount};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment