Home Manual Reference Source
public class | source

Cleaner

A simple class with only one static method that removes items from directories.

Static Method Summary

Static Public Methods
public static

clean(directory: string, files: Array, removeOthers: boolean): Promise<undefined, Error>

Remove items that match a glob pattern from a given directory.

Static Public Methods

public static clean(directory: string, files: Array, removeOthers: boolean): Promise<undefined, Error> source

Remove items that match a glob pattern from a given directory.

Params:

NameTypeAttributeDescription
directory string

The path to the target directory.

files Array

The list of files/folders to remove.

removeOthers boolean
  • optional
  • default: false

If true, it will remove everything but the specified files.

Return:

Promise<undefined, Error>