# dummie

> Create a dummy object that does nothing.

Latest version **0.0.1** (published 2019-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install dummie
pnpm add dummie
yarn add dummie
bun add dummie
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2019-02-21 |
| First published | 2019-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 62.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kevin "Kassimo" Qian |
| Maintainers | kevinkassimo |

## Links

- npm: https://www.npmjs.com/package/dummie
- npm.io page: https://npm.io/package/dummie

## Recent versions

- 0.0.1 (latest) — 2019-02-21

## README

# `dummie`: Create a dummy that does nothing

`dummie()` creates a simple object that does literally __nothing__. It silently consumes all the get/set/has/delete/call etc. operations and never fails. It also works for nested properties/methods.

`dummie` requires `Proxy` available to work.

(This package is mostly as a toy to me as I play around with `Proxy` features. Be careful if you want to use it for any mocking purposes, as it was not intended for them, though it might help at times.)

## Example

```js
// Suppose you've downloaded some scripts for browsers but run in node
const dummie = require('dummie');

// Add these.
const document = dummie();
const window = dummie();
const XMLHttpRequest = dummie();

// All of the following operations would do nothing
// But none of them would throw error.
window.onload = () => "blah";
window.addEventListener("on input", () => {});

const el = document.getElementById("id");
el.innerText = "BOOM";
el.appendChild(document.createElement("p"));

function reqListener () {
  console.log(this.responseText);
}
var xhr = new XMLHttpRequest();
xhr.addEventListener("load", reqListener);
xhr.open("GET", "http://www.example.com");
xhr.send();
```

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