generator-nodemitter

Nodemitter generator

Usage no npm install needed!

<script type="module">
  import generatorNodemitter from 'https://cdn.skypack.dev/generator-nodemitter';
</script>

README

Nodemiter

steps:

  • install yo generator: npm install -g yo
  • install nodemiter-generator: npm install --save generator-nodemitter

ok!

Now you can be generate yours events

Commands

  • yo nodemitter:event Payment
  • yo nodemitter:listener pay

Examples

  • On Payment.js

class Payment extends EventEmitter {
    pay(data) {
        //your logic
    }
}```

- On pay.js
```new Payment().on('pay', (data) => {
    //your action
})```