lib/index.js
function fetchConfig(filename){
  var data;

  filename = path.resolve(filename);

  try {
    data = fs.readFileSync(filename, 'utf-8');
  } catch(e) {
    console.error('Config read error: ' + e);
    process.exit(2);
  }

  try {
    data = JSON.parse(data);
  } catch(e) {
    console.error('Config parse error: ' + e);
    process.exit(2);
  }

  return {
    filename: filename,
    path: path.dirname(filename),
    data: data
  };
}
function fetchConfig(filename){
  var data;

  filename = path.resolve(filename);

  try {
    data = fs.readFileSync(filename, 'utf-8');
  } catch(e) {
    console.error('Config read error: ' + e);
    process.exit(2);
  }

  try {
    data = JSON.parse(data);
  } catch(e) {
    console.error('Config parse error: ' + e);
    process.exit(2);
  }

  return {
    filename: filename,
    path: path.dirname(filename),
    data: data
  };
}
function fetchConfig ( filename ) { var data ; filename = path . resolve ( filename ) ; try { data = fs . readFileSync ( filename , 'utf-8' ) ; } catch ( e ) { console . error ( 'Config read error: ' + e ) ; process . exit ( 2 ) ; } try { data = JSON . parse ( data ) ; } catch ( e ) { console . error ( 'Config parse error: ' + e ) ; process . exit ( 2 ) ; } return { filename : filename , path : path . dirname ( filename ) , data : data } ; }
project config
project config