shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
writeFile
Type:Function
Status:stable
Since:1.0.0
Platform:node
@blackbyte.sugar.node.fs
Write a file. If don’t exist, will be created as well as the directory structure if needed… ( (async)
Params
- path*-String
The file path to write
- data*-String
The data to write in the file
- options{}Object
Options are what you’d pass to [fs.writeFile()](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback)
Return
- -Promise
A promise that will be resolved when the writeFile is completed
Example
import { writeFile } from '@blackbyte/sugar/fs';
writeFile('my/cool/file.txt', 'Hello World').then(() => {
// do something on complete...
});Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space