Writer Class
abstract interface for writing files and assets. The caller is expected to
call done
on the writer after it has finished writing all the required
files. The writer is an event-emitter that emits a done
event when done
is called on it and all files have successfully been written.
Constructor
Writer
()
Methods
copyFile
(
-
source
-
dest
copies a file from source to destination
Parameters:
-
source
Stringthe file to copy, found on the file system
-
dest
Stringthe destination path
done
()
marker method to indicate that the caller is done with this writer object
The writer is expected to emit a done
event only after this method is called
and it is truly done.
writeFile
(
-
file
-
callback
allows writing content to a file using a callback that is passed a content writer
Parameters:
-
file
Stringthe name of the file to write
-
callback
Functionthe callback that is called as
callback(contentWriter)