0.7.0 • Published 9 years ago

getset v0.7.0

Weekly downloads
83
License
-
Repository
github
Last release
9 years ago

Getset

An easier way of handling config options for client-side apps. Specially when it comes to changing settings and upgrading.

Usage

var config = require('getset').load('/path/to/config/file');

config.set('foo', 'bar');
config.get('foo'); // 'bar'

config.save(function(err){
  if (!err) console.log('Saved successfully!')
})

Bells & whistles

var config = require('getset');

config.load('/file/that/will/be/read/asynchronously', function(err){

  if (!err) config.update('foo', 'bar'); // will set() and save()

  config.on('changed', function(){
    console.log('Hold on, someone just changed something!')
  })

  config.watch();
})

Features

  • Singleton. Require from anywhere and you'll get the same object.
  • Uses a single, readable .ini file for persistence.
  • Restricts setting key/values to what's already in there.
  • Can sync with updated/new config files without overwriting existing values.
  • Can watch the config file for changes and reload + notify if it happens.
  • Has no dependencies.

Credits

Written by Tomás Pollak.

Copyright

(c) 2012 Fork Ltd. MIT licensed.

0.7.0

9 years ago

0.6.3

10 years ago

0.6.2

10 years ago

0.6.1

10 years ago

0.6.0

10 years ago

0.5.5

11 years ago

0.5.4

11 years ago

0.5.3

11 years ago

0.5.2

11 years ago

0.5.1

11 years ago

0.5.0

11 years ago

0.4.1

11 years ago

0.4.0

11 years ago

0.3.3

11 years ago

0.3.2

11 years ago

0.3.1

11 years ago

0.3.0

11 years ago

0.2.7

11 years ago

0.2.6

11 years ago

0.2.5

12 years ago

0.2.4

12 years ago

0.2.3

12 years ago

0.2.2

12 years ago

0.2.1

12 years ago

0.2.0

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago