var fs = require('fs');

function Index(){
	'use strict'
	
	this.createIndex = function(filePath){
		fs.readFile(filePath , function doneReading(err, fileContents){
			
			console.log(fileContents.toString());
		})
	}
}

var indexObj =new Index();
indexObj.createIndex('../books.json');

//var fs = require('fs');

function Index(){
	'use strict'
	this.fileContents = {};
	this.createIndex = function(filePath){
		// var results = fs.readFile(filePath , 'utf8', function doneReading(err, fileContents){
		// console.log(fileContents.split(' '));
		// })
		this.fileContents = require(filePath);
		return JSON.stringfy(this.fileContents);
	}

	this.getIndex = function(){
		console.log(this.fileContents);
		
	}
}

var indexObj =new Index();
indexObj.createIndex('../books.json');
indexObj.getIndex();

Change create index method