# @compassdigital/id

> Compass Digital IDs

Latest version **3.8.0** (published 2023-03-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @compassdigital/id
pnpm add @compassdigital/id
yarn add @compassdigital/id
bun add @compassdigital/id
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.8.0 |
| Published | 2023-03-08 |
| First published | 2017-09-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 26.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jonathan Keebler |
| Maintainers | luke-chisholm-compass, lalitya.bijjam, petrusdemelo, robalonzi, aarusharora, hiteshi.patel, gagandeepk, gaurangcompass, sitharam_t, sitharams_t, drashti_patel, mbkhan1995, ds-brian, rajanikandepucdl, svietz, vivien.igweze, shivani-aggarwal, darren.rahnemoon.cdl, sanjay_tech, brahmrshi_tech, tfox121, rachitaj, matthewclair, qihangsong, collinstonefromcompass, hermsidhu, ananthu.cdl, ospozito, cdl-samir-thaker, jitesh.tfpl, dhruv.seth, ricardodesimas, sbeaury-cdl, zach-cdl, jrodri, svtokarevsv, danialhasan, astrit-cdl, keyur-cdl, roya-cdl, jpdemiranda, toronto.devops, brahmrshiraval, coreycosman, pberoy, andrei-cdl, alberttir, umeshprasad, kieranshb, eirabie, coreycosman.cdl, marlondc, bcardoso, eiston-cdl, icholy, brunnodatum |

## Links

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

## Dependencies (1)

- [hashids](https://npm.io/package/hashids.md) ^2.2.1

## Recent versions

- 3.8.0 (latest) — 2023-03-08
- 3.7.1 — 2023-02-22
- 3.7.0 — 2023-02-22
- 3.6.0 — 2022-01-13
- 3.5.0 — 2021-12-16
- 3.4.2 — 2021-12-02
- 3.4.1 — 2021-10-06
- 3.4.0 — 2021-09-15
- 3.3.0 — 2021-07-23
- 3.2.0 — 2021-07-20
- 3.1.5 — 2020-10-08
- 3.1.4 — 2020-08-12
- 3.1.3 — 2020-08-12
- 3.1.2 — 2020-08-11
- 3.1.1 — 2020-02-29
- … 15 more at https://npm.io/package/@compassdigital/id/versions

## README

# Compass Digital ID

Creates ids for use in the Compass Digital platform. Decodes ids to reveal the meta-data within.

## Requirements
- node.js 6+

## Installation
```sh
npm install @compassdigital/id
```

## Usage

```js
const ID = require("@compassdigital/id");

// or use ES6 module import syntax
import ID from "@compassdigital/id";

var new_id = ID({
    service: "menu",
    provider: "Acme XYX",
    type: "item",
    id: "abc1234"
});
// lBprpeED47ILDZBwAYB4iwy0D8Ne55INALa576e9iKX4

var decoded = ID(new_id);
/*
{ 
    service: 'menu',
    provider: 'Acme XYX',
    type: 'item',
    id: 'abc1234' 
}
*/

// Convenience method
new_id = ID("menu", "Acme XYX", "item", "abc1234");
// lBprpeED47ILDZBwAYB4iwy0D8Ne55INALa576e9iKX4

```

## Testing

```sh
npm install mocha -g # if you don't have it installed already
npm test
```

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