index.js
function write(destination, data, callback) {
	// Create directories if needs be
	mkdirp(path.dirname(destination), null, (err, made) => {
		if (err) {
			console.error(err);
		} else {
			fs.writeFile(destination, data, (err) => {
				if (err) {
					console.error(err);
				}
				if (typeof(callback) == 'function') {
					callback(destination, data);
				}
			});
		}
	});
	return destination;
}
function write(destination, data, callback) {
	// Create directories if needs be
	mkdirp(path.dirname(destination), null, (err, made) => {
		if (err) {
			console.error(err);
		} else {
			fs.writeFile(destination, data, (err) => {
				if (err) {
					console.error(err);
				}
				if (typeof(callback) == 'function') {
					callback(destination, data);
				}
			});
		}
	});
	return destination;
}
Writes a string in a file.

@param {String} destination
@param {String} data to be written
@param {Function} callback
@return {?} callback result