0.0.3 • Published 4 years ago
@originforest/bp-common v0.0.3
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