Skip to content

Instantly share code, notes, and snippets.

@rasolofonirina
Last active March 25, 2022 12:40
Show Gist options
  • Save rasolofonirina/4e562d843a631a2a733d483f67c114c0 to your computer and use it in GitHub Desktop.
Save rasolofonirina/4e562d843a631a2a733d483f67c114c0 to your computer and use it in GitHub Desktop.
Emit event
const EventEmitter = require('events').EventEmitter
const zavatra = new EventEmitter()
zavatra.on('velona', (message) => {
console.log(message)
})
zavatra.emit('velona', 'Io fa velona !')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment