Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

events

$ curl 'https://api.github.com/user/repos?page=2&per_page=100'
Comment

events

import { EventEmitter } from "node:events";
/**
 * add "type":"module" in package.json
 */

class MyEmitter extends EventEmitter {}

const myEvent = new MyEmitter();

myEvent.on("event", () => {
  console.log("an event occurred!");
});

myEvent.emit("event");
Comment

PREVIOUS NEXT
Code Example
Javascript :: Iterating or loop through the elements of an array is with a for loop (for): 
Javascript :: mergesort 
Javascript :: launch json file for rust 
Javascript :: sequelize compare dates in two columns 
Javascript :: how to add a property to a class in javascript 
Javascript :: how to use ejs with client side ejs 
Javascript :: JS how to access a class propert 
Javascript :: sequelize change item 
Javascript :: chrome-aws-lambda 
Javascript :: template literals in js 
Javascript :: some in js 
Javascript :: query selector js 
Javascript :: sort array 
Javascript :: dom methods 
Javascript :: js use await in synchronous method 
Javascript :: what is process.env.NODE_ENV 
Javascript :: node md5 decrypt 
Javascript :: promise in js 
Javascript :: base64 
Javascript :: database for javascript 
Javascript :: how we can set react select required 
Javascript :: what does find return javascript 
Javascript :: Sha256 decrypt javascript 
Javascript :: joi.validate 
Javascript :: console.log is not a function 
Javascript :: react-datepicker 
Javascript :: array concat 
Javascript :: callback in javascript 
Javascript :: new function javascript 
Javascript :: class component params in react 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =