actions/fs

Methods

static _templateData (path) → {Object}

Utility method to get a formatted data for templates.

Parameters:
Name Type Description
path String

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
from String

absolute file path or relative to destination folder.

to String

absolute file path or relative to destination folder.

args * <repeatable>

for more information see mem-fs-editor

Returns:
* -

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
from String

absolute file path or relative to templates folder.

to String

absolute file path or relative to destination folder.

args * <repeatable>

for more information see mem-fs-editor

Returns:
* -

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
from String

absolute file path or relative to templates folder.

to String

absolute file path or relative to destination folder.

args * <repeatable>

for more information see mem-fs-editor

Returns:
* -

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
filepath String

absolute file path or relative to destination folder.

args * <repeatable>

for more information see mem-fs-editor

Returns:
* -

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
filepath String

absolute file path or relative to destination folder.

args * <repeatable>

for more information see mem-fs-editor

Returns:
* -

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
from String

absolute file path or relative to destination folder.

to String

absolute file path or relative to destination folder.

Returns:
* -

for more information see mem-fs-editor

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
filepath String

absolute file path or relative to destination folder.

args * <repeatable>

for more information see mem-fs-editor

Returns:
* -

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
filepath String

absolute file path or relative to destination folder.

args * <repeatable>

for more information see mem-fs-editor

Returns:
* -

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
filepath String

absolute file path or relative to templates folder.

args * <repeatable>

for more information see mem-fs-editor

Returns:
* -

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
source String | Array

template file, absolute or relative to templatePath().

destination String | Array <optional>

destination, absolute or relative to destinationPath().

templateData Object <optional>

ejs data

templateOptions Object <optional>

ejs options

copyOptions Object <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
source String | Array

template file, absolute or relative to templatePath().

destination String | Array <optional>

destination, absolute or relative to destinationPath().

templateData Object <optional>

ejs data

templateOptions Object <optional>

ejs options

copyOptions Object <optional>

mem-fs-editor copy options

static renderTemplates (templates, templateData opt )

Copy templates from templates folder to the destination.

Parameters:
Name Type Attributes Description
templates Array

template file, absolute or relative to templatePath().

Properties
Name Type Attributes Description
when function <optional>

conditional if the template should be written. First argument is the templateData, second is the generator.

source String | Array

template file, absolute or relative to templatePath().

destination String | Array <optional>

destination, absolute or relative to destinationPath().

templateOptions Object <optional>

ejs options

copyOptions Object <optional>

mem-fs-editor copy options

templateData Object <optional>

ejs data

static renderTemplatesAsync (templates, templateData opt )

Copy templates from templates folder to the destination.

Parameters:
Name Type Attributes Description
templates Array

template file, absolute or relative to templatePath().

Properties
Name Type Attributes Description
when function <optional>

conditional if the template should be written. First argument is the templateData, second is the generator.

source String | Array

template file, absolute or relative to templatePath().

destination String | Array <optional>

destination, absolute or relative to destinationPath().

templateOptions Object <optional>

ejs options

copyOptions Object <optional>

mem-fs-editor copy options

templateData Object <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
filepath String

absolute file path or relative to destination folder.

args * <repeatable>

for more information see mem-fs-editor

Returns:
* -

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
filepath String

absolute file path or relative to destination folder.

args * <repeatable>

for more information see mem-fs-editor

Returns:
* -

for more information see mem-fs-editor