Skip to content

Implementation of a distributed configuration using Redis

License

Notifications You must be signed in to change notification settings

aranwmurphy/redconfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RedConfig

Implementation of a distributed configuration using Redis, as described here.

Available Scripts

In the project directory, you can run:

npm test

Runs the library test suite, and reports the results of each test.

npm build

Builds the library for production to the lib folder.
It correctly bundles the library in production mode and optimizes the build for the best performance.

npm lint

Lints the project files.

Usage

JavaScript

const Redis = require('ioredis');
const { RedConfig } = require('redconfig');

const client = new Redis();
const rconf = new RedConfig(client, 'config::global');

async function main() {
    let config = await rconf.load();
    // { ... }
    config.level = 'info';
    config = await rconf.save(config);
    console.log(config);
    // { level: 'info', ... }
}

TypeScript

import Redis = require("redis");
import { RedConfig, IRedConfig } from "redconfig";

const client = new Redis();
const rconf = new RedConfig(client, "config::global");

async function main() {
    let config = await rconf.load();
    // { ... }
    config.level = "info";
    config = await rconf.save(config);
    console.log(config);
    // { level: 'info', ... }
}

License

MIT

About

Implementation of a distributed configuration using Redis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published