@compassdigital/id
TypeScript icon, indicating that this package has built-in type declarations

3.8.0 • Public • Published

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

npm install @compassdigital/id

Usage

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

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

Readme

Keywords

none

Package Sidebar

Install

npm i @compassdigital/id

Weekly Downloads

1,024

Version

3.8.0

License

MIT

Unpacked Size

26.9 kB

Total Files

10

Last publish

Collaborators

  • jorszycompass
  • avanipanchal27
  • samyakk123
  • mythusiva-compassdigital
  • rafael-fml
  • evolchek-cd
  • rsteiner
  • harsh-dev-tech
  • vysakh.prasanth
  • abhi9195
  • ludmilla.sivanathan
  • luke-chisholm-compass
  • petrusdemelo
  • robalonzi
  • aarusharora
  • hiteshi.patel
  • sitharam_t
  • sitharams_t
  • drashti_patel
  • mbkhan1995
  • ds-brian
  • svietz
  • shivani-aggarwal
  • 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
  • eiston-cdl
  • icholy
  • brunnodatum