vinm-nodejs-emitter

2.0.0 • Public • Published

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.

📝 License

Copyright © 2020 maoosi.
This project is MIT licensed.

Readme

Keywords

none

Package Sidebar

Install

npm i vinm-nodejs-emitter

Weekly Downloads

2

Version

2.0.0

License

MIT

Unpacked Size

2.97 kB

Total Files

5

Last publish

Collaborators

  • maoosi