nconf-lite/lib/nconf/stores/literal.js

29 lines
619 B
JavaScript
Raw Normal View History

/*
* literal.js: Simple literal Object store for nconf.
*
* (C) 2011, Nodejitsu Inc.
*
*/
2012-04-14 19:28:55 +00:00
var util = require('util'),
Memory = require('./memory').Memory
var Literal = exports.Literal = function Literal (options) {
Memory.call(this, options);
2012-04-14 19:28:55 +00:00
options = options || {}
this.type = 'literal';
this.readOnly = true;
this.store = options.store || options;
};
// Inherit from Memory store.
util.inherits(Literal, Memory);
//
// ### function loadSync (callback)
// Returns the data stored in `this.store` synchronously.
//
Literal.prototype.loadSync = function () {
return this.store;
};