0.0.3 • Published 4 years ago

@originforest/bp-common v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Common library in bpfaas

Setup

npm i @originforest/bp-common

set config in tsconfig.json

"experimentalDecorators": true,
"emitDecoratorMetadata": true,

Distributed identity

use api

import {identity} from '@originforest/bp-common'

// a unique id.
let id = identity.nextId();

// test id.
if (!identity.isValidId(id)) {
}

// id length.
identity.idLength == 32

use decorator

import {Identity} from '@originforest/bp-common'

class Demo {
  @Identity
  id: string;
}

// a unique id.
new Demo().id
0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago