vinm-nodejs-emitter
v2.0.0
Published
Node.js emitter for Vinm CLI.
Downloads
7
Readme
Vīnm Node.js Emitter
Node.js emitter for Vinm CLI.
🚸 Extend the Vinm CLI
When executing a Node.js script using Vinm CLI, vinm-emitter provide the ability to emit variables back to the execution pipeline so that it can be used in all the following tasks.
📦 Installation
# With npm
npm i vinm-nodejs-emitter
# OR With yarn
yarn add vinm-nodejs-emitter
🚀 Usage
Considering the below Node.js script myscript.js
:
module.exports.getSecret = () => {
const vinmEmit = require('vinm-nodejs-emitter')()
vinmEmit('mysecret', '123456')
}
Here's how we would access the mysecret
var from vinm.yml
:
tasks:
get-mysecret:
shell: >-
node -e "require(\"./myscript.js\").getSecret()"
print-mysecret:
shell: >-
echo "$vinm.mysecret"
🤝 Contributing
Contributions, issues and feature requests are welcome.