# eventtarget-manager

> An event Manager.

Latest version **1.0.3** (published 2019-07-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install eventtarget-manager
pnpm add eventtarget-manager
yarn add eventtarget-manager
bun add eventtarget-manager
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-07-25 |
| First published | 2019-07-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | markstien |
| Maintainers | markstien |
| Keywords | An, event, Manager. |

## Links

- npm: https://www.npmjs.com/package/eventtarget-manager
- Repository: https://github.com/Marksteinsong/EventTarget
- Homepage: https://github.com/Marksteinsong/EventTarget#readme
- Issues: https://github.com/Marksteinsong/EventTarget/issues
- npm.io page: https://npm.io/package/eventtarget-manager

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2019-07-25
- 1.0.2 — 2019-07-25
- 1.0.1 — 2019-07-25
- 1.0.0 — 2019-07-25

## README

# EventTarget
An event Manager.

###Installing

1.```npm install eventtarget-manager --save```

or

2.```<script src="EventTarget.js"></script>```


###Usage(run in node)

example 1——you can add any function on the same event and transfer an object with.

```flow js
    const EventTarget=require('eventtarget-manager');
    const target=new EventTarget();
    target.addEvents("message",function (e) {
        setTimeout(function () {
            console.log(e.message);
        },3000)
    });
    target.addEvents("message",function (e) {
        setTimeout(function () {
            console.log(e.message);
        },3000)
    });
    target.trig({type:"message",message:"This is the thing in 3s to show."});
```


example 2——remove  an event
```flow js
const EventTarget=require('eventtarget-manager');
const target=new EventTarget();
target.addEvents("fly",function () {
       console.log("This was removed and could never be showed.");
    });
    target.removeEvents("fly");
    target.trig({type: "fly"});
```

example 3——remove a function in the event without any **influence** to the functions in **the same event**
```flow js
const EventTarget=require('eventtarget-manager');
const target=new EventTarget();
const handler1=function () {
        console.log("This was removed and could never be showed.");
    };
    const handler2=function(){
        console.log("something from handler2.");
    };
    target.addEvents("close",handler1);
    target.addEvents("close",handler2);
    target.removeEvents("close",handler1);
    target.trig({type: "close"});   

```
   

###[example](index.html)

###LICENSE

MIT

---
_Source: https://npm.io/package/eventtarget-manager · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
