config-mancer

Configuration file utilities

Node utility intended to work with config files, but it could have other uses. It works with the first object expression it finds.

#API

gets the config as an object along with some other data

gets the config as an object along with an async save callback

returns the config as a write stream (streams2 supported). It will get the config, modify it and save it to filesystem once end() is called.

#Usage

require("config-mancer").modify("scripts/rjs-config.js", function(errconfigsave) {
  config.paths.jquery = "vendor/jquery.js";
  save(config, function(err) {
    // file saved 
  });
});
var config = require("config-mancer").getAsStream("scripts/rjs-config.js")
config.write(["paths.jquery", "vendor/jquery.js"]);
config.on("fileWritten", function(err) {
  // file saved 
});