command-line-config
Quick and dirty loading/saving of JSON files.
Last updated 8 years ago by tehshrike .
Original npm · Tarball · package.json
$ cnpm install command-line-config 
SYNC missed versions from official npm registry.

Quick and dirty loading/saving of JSON files.

var settings_access = require('command-line-config')

var settings = settings_access.load('./some_file.json')
settings.dumb = false
settings_access.save(settings, './some_file.json')

If you don't specify a path to load, the module assumes the file was passed in via the command-line, like so: node your-script.js config-file.json

var settings = settings_access.load()
settings.wat = "WHERE DID YOU COME FROM"
settings_access.save(settings)

In order to for load() to return synchronously, it calls fs.existsSync(). For this reason, the module should only be useful in command-line scripts.

Written for ISoft Data Systems, licensed WTFPL.

Current Tags

  • 1.4.1                                ...           latest (8 years ago)

6 Versions

  • 1.4.1                                ...           8 years ago
  • 1.4.0                                ...           8 years ago
  • 1.3.0                                ...           8 years ago
  • 1.2.0                                ...           8 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
Downloads
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 1
Last Month 4
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |