# immutable-instance-id

> Generate random-unique-id once per process instance

Latest version **0.6.0** (published 2023-12-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install immutable-instance-id
pnpm add immutable-instance-id
yarn add immutable-instance-id
bun add immutable-instance-id
```

## 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.6.0 |
| Published | 2023-12-15 |
| First published | 2016-10-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ersun Warncke |
| Maintainers | ersun.warncke |

## Links

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

## Dependencies (2)

- [if-defined](https://npm.io/package/if-defined.md) 1.0.18
- [random-unique-id](https://npm.io/package/random-unique-id.md) 2.1.0

## Recent versions

- 0.6.0 (latest) — 2023-12-15
- 0.5.0 — 2021-04-03
- 0.4.1 — 2018-11-18
- 0.4.0 — 2018-11-11
- 0.3.18 — 2018-01-15
- 0.3.17 — 2018-01-15
- 0.3.16 — 2017-12-20
- 0.3.15 — 2017-12-18
- 0.3.14 — 2017-12-01
- 0.3.13 — 2017-11-13
- 0.3.12 — 2017-10-12
- 0.3.11 — 2017-10-11
- 0.3.10 — 2017-10-06
- 0.3.9 — 2017-10-06
- 0.3.8 — 2017-10-04
- … 41 more at https://npm.io/package/immutable-instance-id/versions

## README

# immutable-instance-id

    const instanceId = require('immutable-instance-id')

    /* {
     *     id: 'af7f52d9d8f7dcfb8fda5cb15814ef61',
     *     timestamp: '2017-09-01 12:36:11.032569'
     * }
     */

Generate a random id once per process using the
[Random Unique Id](https://www.npmjs.com/package/random-unique-id) module.

Instance Id is an object with a property `id` which is a 128 bit (32 char)
lower case hex string and a property `timestamp` with is a string indicating
the time that the id was generated in MySQL compatible microsecond format.

The Instance Id is stored in `global.__immutable_instance_id__` and will not
change even if the module file is executed multiple times.

Immutable Instance Id integrates with the
[Immutable App](https://www.npmjs.com/package/immutable-app) ecosystem to
provide unique ids that are used for logging, debugging and testing.

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