Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

egg-koid

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-koid

k-ordered, conflict-free ids generator in a distributed environment for egg.js and midway.js

  • 5.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

egg-koid

GitHub tag License ci codecov Conventional Commits lerna

Installation

npm i egg-koid

Configuration

Enable Plugin

Edit ${app_root}/src/config/plugin.ts:

export const koid = {
  enable: true,
  package: 'egg-koid',
}

Add Configurations

/* location: ${app_root}/src/config/config.${env}.ts */

import { KoidEggConfig, genConfigRandom } from 'egg-koid'

export const koid: KoidEggConfig = {
  client: {
    debug: false,
    koidConfig: genConfigRandom(), // value or void 0
  },
}
// OR
export const koid: KoidEggConfig = {
  client: {
    debug: false,
    koidConfig: {
      dataCenter: 0,
      worker: 1,
    }
  },
}

Usage

import { Plugin, Provide } from '@midwayjs/decorator'
import type { Koid } from 'egg-koid'  // note: import **type**

@Provide()
export class UserService {

  @Plugin() readonly koid: Koid

}

License

MIT

Languages

Keywords

FAQs

Package last updated on 13 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc