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:
-
sourceStringthe file to copy, found on the file system
-
destStringthe 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:
-
fileStringthe name of the file to write
-
callbackFunctionthe callback that is called as
callback(contentWriter)
