@nuofe/ndk-runtime-config
TypeScript icon, indicating that this package has built-in type declarations

8.2.2 • Public • Published

NDK Runtime Config

NPM version Downloads

Runtime Config.

Install

yarn add @nuofe/ndk-runtime-config

Usage

Get runtime config, may be return empty object.

import ndkRuntimeConfig from '@nuofe/ndk-runtime-config';

const { userInfo } = ndkRuntimeConfig.get<{ userInfo: string }>();

if (userInfo) {
  // do something
}

Init runtime config, if userInfo is undefined, it will be generate via @nuofe/ndk-user.

import ndkRuntimeConfig from '@nuofe/ndk-runtime-config';

const { userInfo } = await ndkRuntimeConfig.init(options);

Set runtime config.

import ndkRuntimeConfig from '@nuofe/ndk-runtime-config';

ndkRuntimeConfig.set({ key: 'value' });

Package Sidebar

Install

npm i @nuofe/ndk-runtime-config

Weekly Downloads

2

Version

8.2.2

License

MIT

Unpacked Size

8.25 kB

Total Files

13

Last publish

Collaborators

  • xunyu
  • nuonuofe
  • zoeblow