library/index.js
function(hoast, filePath, content) {
	return new Promise(function(resolve, reject) {
		hoast.helpers.createDirectory(path.dirname(filePath))
			.then(function() {
				fs.writeFile(filePath, JSON.stringify(content), `utf8`, function(error) {
					if (error) {
						return reject(error);
					}
					resolve();
				});
			})
			.catch(function(error) {
				reject(error);
			});
	});
}
function(hoast, filePath, content) {
	return new Promise(function(resolve, reject) {
		hoast.helpers.createDirectory(path.dirname(filePath))
			.then(function() {
				fs.writeFile(filePath, JSON.stringify(content), `utf8`, function(error) {
					if (error) {
						return reject(error);
					}
					resolve();
				});
			})
			.catch(function(error) {
				reject(error);
			});
	});
}
function ( hoast , filePath , content ) { return new Promise ( function ( resolve , reject ) { hoast . helpers . createDirectory ( path . dirname ( filePath ) ) . then ( function ( ) { fs . writeFile ( filePath , JSON . stringify ( content ) , ` ` , function ( error ) { if ( error ) { return reject ( error ) ; } resolve ( ) ; } ) ; } ) . catch ( function ( error ) { reject ( error ) ; } ) ; } ) ; }
Writes JS object to storage.
@param {Object} hoast hoast instance.
@param {String} filePath File path.
@param {Object} content Object to write to storage.
Writes JS object to storage .