Methods
-
static _templateData (path) → {Object}
-
Utility method to get a formatted data for templates.
Parameters:
Name Type Description pathString path to the storage key.
Returns:
Object -data to be passed to the templates.
-
static copyDestination (from, to, …args) → {*}
-
Copy file from destination folder to another destination folder. mem-fs-editor method's shortcut, for more information see mem-fs-editor . Shortcut for this.fs.copy(this.destinationPath(from), this.destinationPath(to)).
Parameters:
Name Type Attributes Description fromString absolute file path or relative to destination folder.
toString absolute file path or relative to destination folder.
args* <repeatable>
for more information see mem-fs-editor
-
static copyTemplate (from, to, …args) → {*}
-
Copy file from templates folder to destination folder. mem-fs-editor method's shortcut, for more information see mem-fs-editor . Shortcut for this.fs.copy(this.templatePath(from), this.destinationPath(to))
Parameters:
Name Type Attributes Description fromString absolute file path or relative to templates folder.
toString absolute file path or relative to destination folder.
args* <repeatable>
for more information see mem-fs-editor
-
static copyTemplateAsync (from, to, …args) → {*}
-
Copy file from templates folder to destination folder. mem-fs-editor method's shortcut, for more information see mem-fs-editor . Shortcut for this.fs.copy(this.templatePath(from), this.destinationPath(to))
Parameters:
Name Type Attributes Description fromString absolute file path or relative to templates folder.
toString absolute file path or relative to destination folder.
args* <repeatable>
for more information see mem-fs-editor
-
static deleteDestination (filepath, …args) → {*}
-
Delete file from destination folder mem-fs-editor method's shortcut, for more information see mem-fs-editor . Shortcut for this.fs.delete(this.destinationPath(filepath)).
Parameters:
Name Type Attributes Description filepathString absolute file path or relative to destination folder.
args* <repeatable>
for more information see mem-fs-editor
-
static existsDestination (filepath, …args) → {*}
-
Exists file on destination folder. mem-fs-editor method's shortcut, for more information see mem-fs-editor . Shortcut for this.fs.exists(this.destinationPath(filepath)).
Parameters:
Name Type Attributes Description filepathString absolute file path or relative to destination folder.
args* <repeatable>
for more information see mem-fs-editor
-
static moveDestination (from, to) → {*}
-
Move file from destination folder to another destination folder. mem-fs-editor method's shortcut, for more information see mem-fs-editor . Shortcut for this.fs.move(this.destinationPath(from), this.destinationPath(to)).
Parameters:
Name Type Description fromString absolute file path or relative to destination folder.
toString absolute file path or relative to destination folder.
-
static readDestination (filepath, …args) → {*}
-
Read file from destination folder mem-fs-editor method's shortcut, for more information see mem-fs-editor . Shortcut for this.fs.read(this.destinationPath(filepath)).
Parameters:
Name Type Attributes Description filepathString absolute file path or relative to destination folder.
args* <repeatable>
for more information see mem-fs-editor
-
static readDestinationJSON (filepath, …args) → {*}
-
Read JSON file from destination folder mem-fs-editor method's shortcut, for more information see mem-fs-editor . Shortcut for this.fs.readJSON(this.destinationPath(filepath)).
Parameters:
Name Type Attributes Description filepathString absolute file path or relative to destination folder.
args* <repeatable>
for more information see mem-fs-editor
-
static readTemplate (filepath, …args) → {*}
-
Read file from templates folder. mem-fs-editor method's shortcut, for more information see mem-fs-editor . Shortcut for this.fs.read(this.templatePath(filepath))
Parameters:
Name Type Attributes Description filepathString absolute file path or relative to templates folder.
args* <repeatable>
for more information see mem-fs-editor
-
static renderTemplate (source, destination opt , templateData opt , templateOptions opt , copyOptions opt )
-
Copy a template from templates folder to the destination.
Parameters:
Name Type Attributes Description sourceString | Array template file, absolute or relative to templatePath().
destinationString | Array <optional>
destination, absolute or relative to destinationPath().
templateDataObject <optional>
ejs data
templateOptionsObject <optional>
ejs options
copyOptionsObject <optional>
mem-fs-editor copy options
-
static renderTemplateAsync (source, destination opt , templateData opt , templateOptions opt , copyOptions opt )
-
Copy a template from templates folder to the destination.
Parameters:
Name Type Attributes Description sourceString | Array template file, absolute or relative to templatePath().
destinationString | Array <optional>
destination, absolute or relative to destinationPath().
templateDataObject <optional>
ejs data
templateOptionsObject <optional>
ejs options
copyOptionsObject <optional>
mem-fs-editor copy options
-
static renderTemplates (templates, templateData opt )
-
Copy templates from templates folder to the destination.
Parameters:
Name Type Attributes Description templatesArray template file, absolute or relative to templatePath().
Properties
Name Type Attributes Description whenfunction <optional>
conditional if the template should be written. First argument is the templateData, second is the generator.
sourceString | Array template file, absolute or relative to templatePath().
destinationString | Array <optional>
destination, absolute or relative to destinationPath().
templateOptionsObject <optional>
ejs options
copyOptionsObject <optional>
mem-fs-editor copy options
templateDataObject <optional>
ejs data
-
static renderTemplatesAsync (templates, templateData opt )
-
Copy templates from templates folder to the destination.
Parameters:
Name Type Attributes Description templatesArray template file, absolute or relative to templatePath().
Properties
Name Type Attributes Description whenfunction <optional>
conditional if the template should be written. First argument is the templateData, second is the generator.
sourceString | Array template file, absolute or relative to templatePath().
destinationString | Array <optional>
destination, absolute or relative to destinationPath().
templateOptionsObject <optional>
ejs options
copyOptionsObject <optional>
mem-fs-editor copy options
templateDataObject <optional>
ejs data
-
static writeDestination (filepath, …args) → {*}
-
Write file to destination folder mem-fs-editor method's shortcut, for more information see mem-fs-editor . Shortcut for this.fs.write(this.destinationPath(filepath)).
Parameters:
Name Type Attributes Description filepathString absolute file path or relative to destination folder.
args* <repeatable>
for more information see mem-fs-editor
-
static writeDestinationJSON (filepath, …args) → {*}
-
Write json file to destination folder mem-fs-editor method's shortcut, for more information see mem-fs-editor . Shortcut for this.fs.writeJSON(this.destinationPath(filepath)).
Parameters:
Name Type Attributes Description filepathString absolute file path or relative to destination folder.
args* <repeatable>
for more information see mem-fs-editor