# dataset

> Shim for DOM dataset

Latest version **0.3.2** (published 2017-02-20) · MIT license · 0 weekly downloads

## Install

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

## 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.3.2 |
| Published | 2017-02-20 |
| First published | 2012-04-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Damian Krzeminski |
| Maintainers | tbranyen, tootallnate, pirxpilot |
| Keywords | dom, dataset |

## Links

- npm: https://www.npmjs.com/package/dataset
- Repository: https://github.com/pirxpilot/dataset
- Issues: https://github.com/pirxpilot/dataset/issues
- npm.io page: https://npm.io/package/dataset

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.3.2 (latest) — 2017-02-20
- 0.3.1 — 2015-04-13
- 0.3.0 — 2014-10-21
- 0.0.0 — 2012-04-03

## README

# dataset

  Shim for DOM dataset

## Installation

    $ npm install dataset

## API

  To set `data-xxx` attribute on `node` to 5:

  	dataset(node, 'xxx', 5);

  To retrieve `data-xxx` attribute value:

    dataset(node, 'xxx');

  To remove `data-xxx` attribute:

    dataset(node).del('xxx');

  You can chain your `sets`:

  	dataset(node)
  		.set('xxx', 5)
  		.set('foo', 'bongo');

# Caveats
  
  - You might not need it: dataset is [supported by all modern browsers][caniuse]
  - Do **not** use on SVG/MathML elements: most browsers only support `dataset` property on HTML elements and - for performance reasons - this shim only checks for `dataset` support once per load using `document.head` element to verify the support.

## License

  MIT

[caniuse]: http://caniuse.com/#search=dataset

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