homeconfjs

0.1.2 • Public • Published

HomeConf

npm npm

Global config files for cli apps helper


Table of Contents

Installation

npm install --save homeconfjs

Usage

The file will be created automatically, named packageName.json at the path homeConf.path that may varies depending on the current OS.

const HomeConf = require('homeconfjs');
const homeConf = new HomeConf(); // Default: {}

Or

const HomeConf = require('homeconfjs');
const homeConf = new HomeConf({defaultObject}); // Specify the default object

Or

const HomeConf = require('homeconfjs');
const homeConf = new HomeConf(`${__dirname}/default.json`); // Use the file as default

API

config

Get the actual config object.

homeConf.config

path

Get the path of the config file

homeConf.path

get('objectPath')

Get a value by its object path.

homeConf.get('user.name')

set('objectPath', value)

Set and save a value by its object path.

homeConf.get('user.name', 'Anas')

License

This project is under the MIT license.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    1
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i homeconfjs

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

4.59 kB

Total Files

5

Last publish

Collaborators

  • faressoft