# ele-id

> create and set element a new unique id, or return the existed id.

Latest version **1.0.2** (published 2022-01-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install ele-id
pnpm add ele-id
yarn add ele-id
bun add ele-id
```

## 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.2 |
| Published | 2022-01-29 |
| First published | 2022-01-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | fwg |
| Maintainers | adf0001 |
| Keywords | element, id |

## Links

- npm: https://www.npmjs.com/package/ele-id
- Repository: https://github.com/adf0001/ele-id
- Homepage: https://github.com/adf0001/ele-id#readme
- Issues: https://github.com/adf0001/ele-id/issues
- npm.io page: https://npm.io/package/ele-id

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2022-01-29
- 1.0.1 — 2022-01-14
- 1.0.0 — 2022-01-14

## README

# ele-id
create and set element a new unique id, or return the existed id.

# Install
```
npm install ele-id
```

# Usage & Api
```javascript

var ele_id = require("ele-id");

document.getElementById('divResult2').innerHTML = '<span>child</span>';

//eleId( [ el [, prefix]] )
showResult('new id= ' + ele_id(document.getElementById('divResult2').firstChild) + ', new id2= ' + ele_id(), 3);

document.getElementById('divResult2').firstChild.id &&
	ele_id(document.getElementById('divResult2')) === 'divResult2' &&
	ele_id("asdfg12345") === "asdfg12345";

//.from(idString)	//just same as document.getElementById()
ele_id.from('divResult') === document.getElementById('divResult') &&
	ele_id.from('divResult8679789678967') === null;

```

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