Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/pastedeno/src/mod.ts>Scraper#on

Universal Pastebin client for Deno/Node
Latest
method Scraper.prototype.on
import { Scraper } from "https://deno.land/x/pastedeno@0.6.2/src/mod.ts";

Adds an event listener.

Examples

Example 1

scraper.on("scrape", (data) => {
  console.table(data);
});

Parameters

eventName: "start"

{EventType} The name of the event to listen for.

handler: () => void

{Function} The function to call when the event is fired.

Parameters

eventName: "stop"
handler: () => void

Parameters

eventName: "error"
handler: (error: Error) => void

Parameters

eventName: "scrape"
handler: (data: ScrapePaste[]) => void

Parameters

eventName: "new"
handler: (data: ScrapePaste) => void