requirejs-config-file ![Build Status](https://travis-ci.org/webforge-labs/requirejs-config-file.svg?branch=master)
![NPM](https://nodei.co/npm/requirejs-config-file.png?downloads=true)
A small api to read and write your requirejs config file
installation
npm install requirejs-config-file
usage
require the constructor
var ConfigFile = require('requirejs-config-file').ConfigFile;
read
var configFile = new ConfigFile('path/to/some/requirejs-config.js'));
var config = configFile.read();
console.log(config);
modify (read and write)
var configFile = new ConfigFile('path/to/some/requirejs-config.js'));
var config = configFile.read();
config.baseUrl = '/new';
configFile.write();
create
var configFile = new ConfigFile('path/to/new-config.js'));
configFile.createIfNotExists();
configFile.write();
create or modify
var configFile = new ConfigFile('path/to/new-config.js'));
configFile.createIfNotExists();
configFile.read();
config.baseUrl = '/new';
configFile.write();