UNPKG

@carlosbajo/roket-micro

Version:

framework para microservicios con google/pubsub

26 lines (25 loc) 625 B
module.exports = function plopFunction(plop) { return { description: 'roket-micro schema generator', prompts: [ { type: 'input', name: 'schema', message: 'name of the schema?', validate: (value) => { if (!(/^$|-/).test(value)) { return true; } return 'invalid format'; } }, ], actions: function res(answer) { const set = []; set.push({ type: 'add', path: `${plop.getPlopfilePath()}/api/schemas/${answer.schema}.js`, templateFile: `${__dirname}/schemas.hbs` }); return set; } }; };