scoperjs
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

scoper

JS lib for resolving scope values by merging a specific scope with a default scope.

For example, if you have the following configuration:

{
    default: {
        num_instances: 2,
        color: "white"
    },
    prd: {
        num_instances: 10
    }
}

If you query for configs for "prd" it will return

{
    num_instances: 10,
    color: "white"
}

How to use

pnpm install scoper
import { Scoper } from 'scoperjs';

const scoper = Scoper.create<{ test: string }>({ test: 'abc' });
scoper.
const res = scoper.getValue('test');
// res == 'abc'

Prepare dev env

nvm use 18
corepack enable
pnpm install

Readme

Keywords

none

Package Sidebar

Install

npm i scoperjs

Weekly Downloads

9

Version

1.0.1

License

MIT

Unpacked Size

24.4 kB

Total Files

6

Last publish

Collaborators

  • flaviostutz