let fs = require('fs');

function read (file) {
	return new Promise((fulfill, reject) => {
		fs.readFile(file, (err, data) => {
			if(err) reject(err);
			else fulfill(data);
		});
	});
}

function write (file, content) {
	return new Promise((fulfill, reject) => {
		fs.writeFile(file, content, (err, data) => {
			if(err) reject(err);
			else fulfill();
		});
	});
}

exports.read = read;
exports.write = write;