lib/actions/convert-data-url.js
function readFile(fileName) {
	if (/^https?:/.test(fileName)) {
		return readFileFromURL(fileName);
	}

	return new Promise((resolve, reject) => {
		fs.readFile(fileName, (err, content) => err ? reject(err) : resolve(content));
	});
}
function readFile(fileName) {
	if (/^https?:/.test(fileName)) {
		return readFileFromURL(fileName);
	}

	return new Promise((resolve, reject) => {
		fs.readFile(fileName, (err, content) => err ? reject(err) : resolve(content));
	});
}
function readFile ( fileName ) { if ( / ^https?: / . test ( fileName ) ) { return readFileFromURL ( fileName ) ; } return new Promise ( ( resolve , reject ) => { fs . readFile ( fileName , ( err , content ) => err ? reject ( err ) : resolve ( content ) ) ; } ) ; }
Reads contents of given file path or URL as buffer
@param  {String} fileName File path or URL
@return {Promise}
Reads contents of given file path or URL as buffer