open-index/open-npm huggingface dataset:
npm package: @psc-44/event-emitter
Description: Simple event emitter to create custom class events.
Author: Paul Schmidt
Latest version: 1.0.3

# Event Emitter

Simple event emitter to create custom class events.

## Installation
```shell
yarn add @psc-44/event-emitter
```

## Usage
### Class example
```ts
import {EventEmitter} from "@psc-44/event-emitter";

class Modal extends EventEmitter {
    
    open() {
        this.emit("open", {
            // custom data
        });
    }
    
}
```
### Parent example
```ts
const modal = new Modal();
const callback = (data) => console.log("Modal opened", data);

modal.on("open", callback);
modal.open();
// output: Modal opened
// output: {}

modal.off("open", callback);
modal.open();
// output:
```


## Methods
| Method                               | Description                          | Example                                          |
|--------------------------------------|--------------------------------------|--------------------------------------------------|
| `this.on("name", "cb")`              | Listen to an event.                  | `this.on("open", () => console.log("opened"))`   |
| `this.off("name", "cb")`             | Stop listen to an event.             | `this.off("open", () => console.log("opened"))`  |
| `this.emit("name"[, "data"])`        | Emit an event.                       | `this.emit("open", { trigger: triggerElement })` |
| `this.eventExists("name"): boolean`  | Checks if an event exists.           | `this.eventExists("open")`                       |
| `this.clearEvents()`                 | Clear all events.                    | `this.clearEvents()`                             |
| `this.eventsCount(): number`         | Get the number of registered events. | `this.eventsCount`                               |
npm package: @pscale/difx
Description: diff and patch object and array
Author: jesse23
Latest version: 1.0.2

# difx

Diff, preview and apply changes to data structures in O(n) time complexity.

## Usage
```javascript
// high-level API 
const patch = diff(src, tar, opts);
const nodes = view(src, patch, opts);
const final = apply(src, patch, opts);

// low-level API
const patch = diff(src, tar, opts);
const change = preview(src, patch, opts);
const nodes  = viewChange(change, opts);
const final  = applyChange(change);
```