Copier
A service to copy items.
Static Method Summary
Static Public Methods | ||
public static |
Copy a list of items between an |
|
public static |
Copy a single file from one location to another. |
|
public static |
Copy a Node module. |
|
public static |
findMissingItems(items: Array): Promise<Array, Error> Given a list of items, find if any of them doesn't exist. |
|
public static |
pathExists(item: string): Promise<Object, Error> Check if an item exists. |
Static Public Methods
public static copy(origin: string, target: string, items: Array): Promise<Array, Error> source
Copy a list of items between an origin
directory and a target
directory.
Params:
Name | Type | Attribute | Description |
origin | string | The path to the origin directory. |
|
target | string | The path to the target directory. |
|
items | Array | The list of items to copy. Each item can be a |
public static copyFile(from: string, to: string): Promise<Object, Object> source
Copy a single file from one location to another.
public static copyModule(from: string, to: string): Promise<Object, Object> source
Copy a Node module. The reason this is different from copyFile
is because instead of copying
the entire module, we first read all the files on its directory, remove its modules and the
lock files and then copy all the rest.
public static findMissingItems(items: Array): Promise<Array, Error> source
Given a list of items, find if any of them doesn't exist.
Params:
Name | Type | Attribute | Description |
items | Array | A list of paths. |