configuration
Advanced tools
Comparing version 0.0.1 to 0.0.2
12
index.js
@@ -12,10 +12,10 @@ var util = require('util'); | ||
Configuration.prototype.add = function set(key, value) { | ||
Configuration.prototype.set = function set(key, value) { | ||
"use strict"; | ||
if (this.data[key]) { | ||
this.data[key] = value; | ||
this.emit('change', this.data[key]); | ||
this.emit('change', key, this.data[key]); | ||
} else { | ||
this.data[key] = value; | ||
this.emit('add', this.data[key]); | ||
this.emit('set', key, this.data[key]); | ||
} | ||
@@ -32,3 +32,3 @@ }; | ||
if (this.data[key]) { | ||
this.emit('remove', this.data[key]); | ||
this.emit('remove', key, this.data[key]); | ||
delete this.data[key]; | ||
@@ -44,6 +44,6 @@ this.data[key] = null; | ||
Configuration.prototype.set = function setAll(config) { | ||
Configuration.prototype.setAll = function setAll(config) { | ||
"use strict"; | ||
var that = this; | ||
this.emit('set', config); | ||
this.emit('setAll', config); | ||
underscore.each(config, function (value, key) { | ||
@@ -50,0 +50,0 @@ that.add(key, value); |
{ | ||
"author":"Thomas Fritz <fritztho@gmail.com>", | ||
"name":"configuration", | ||
"description":"Basic Low-level Light-Weight Configuration Class extending EventEmitter", | ||
"version":"0.0.1", | ||
"description":"Simple light-weight configuration and setting module extending EventEmitter", | ||
"version":"0.0.2", | ||
"homepage":"https://github.com/thomasfr/node-configuration", | ||
"scripts":{ | ||
"test":"make test" | ||
}, | ||
"repository":{ | ||
"type":"git", | ||
"url":"git://github.com/thomasfr/node-configuration.git" | ||
}, | ||
"dependencies":{ | ||
@@ -13,5 +20,8 @@ "underscore":"latest" | ||
}, | ||
"devDependencies":{}, | ||
"devDependencies":{ | ||
"mocha":"latest", | ||
"should":"latest" | ||
}, | ||
"optionalDependencies":{}, | ||
"keywords":["configuration", "config", "setup", "configure", "settings"] | ||
} |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
6225
6
141
0
2