function writeFile( file, data ) {
	var fpath;
	var ext;
	var f;

	ext = extname( file );
	f = file.substring( 0, file.length-ext.length );
	f += '.json';
	fpath = join( dataDir, f );

	debug( 'Writing data to file: %s', f );
	writeFileFcn( fpath, data, OPTS, onWriteClbk( f ) );
}
Writes JSON data to file.

@private
@param {string} file - file name
@param {string} data - JSON data to write