1.0.1 • Published 1 year ago

scoperjs v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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
1.0.1

1 year ago

1.0.0

1 year ago

0.0.10

1 year ago

0.0.1

1 year ago