Skip to content

dw1284/electron-node-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

electron-node-config

Introduction

This module is identical to node-config except that it works in the Electron environment.

Whenever your app gets packaged into an Electron executable, this module will still work as expected.

Even if you archive your app into app.asar, this module will still work as expected.

Installation

$ npm install electron-node-config
$ mkdir config
$ vi config/default.json

Usage

Assuming the following default.json:

{
  "Customer": {
    "dbConfig": {
      "host": "prod-db-server"
    },
    "credit": {
      "initialDays": 30
    }
  }
}

Pull the config into your code:

let config = require('electron-node-config');
let dbConfig = config.get('Customer.dbConfig');

console.log(config.Customer.credit.initialDays);
console.log(dbConfig.host);

License

May be freely distributed under the MIT license.

About

Configuration control for electron based node applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published