# vinm-nodejs-emitter

> Node.js emitter for Vinm CLI.

Latest version **2.0.0** (published 2020-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install vinm-nodejs-emitter
pnpm add vinm-nodejs-emitter
yarn add vinm-nodejs-emitter
bun add vinm-nodejs-emitter
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2020-04-15 |
| First published | 2019-10-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | maoosi |
| Maintainers | maoosi |

## Links

- npm: https://www.npmjs.com/package/vinm-nodejs-emitter
- npm.io page: https://npm.io/package/vinm-nodejs-emitter

## Recent versions

- 2.0.0 (latest) — 2020-04-15
- 1.0.0 — 2019-10-26

## README

# Vīnm Node.js Emitter

> Node.js emitter for Vinm CLI.

🚸 Extend the [Vinm CLI](https://gitlab.com/vinm/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

```sh
# With npm
npm i vinm-nodejs-emitter

# OR With yarn
yarn add vinm-nodejs-emitter
```


## 🚀 Usage

Considering the below Node.js script `myscript.js`:

```javascript
module.exports.getSecret = () => {
    const vinmEmit = require('vinm-nodejs-emitter')()
    vinmEmit('mysecret', '123456')
}
```

Here's how we would access the `mysecret` var from `vinm.yml`:

```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](https://gitlab.com/maoosi).<br />
This project is [MIT](./LICENSE) licensed.

---
_Source: https://npm.io/package/vinm-nodejs-emitter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
