Skip to content
This repository was archived by the owner on Aug 4, 2022. It is now read-only.

Latest commit

History

History
73 lines (48 loc) 路 1.09 KB

File metadata and controls

73 lines (48 loc) 路 1.09 KB
description The RmDir object helps you create your own custom unlink method.

RmDir Methods

馃摌 Usage

Invoke it and chain the methods:

new srm.RmDir()
  .random()
  .rmDir()

{% hint style="danger" %} Unless you know what you鈥檙e doing, always end with .rmDir(). {% endhint %}

log()

  • No arguments

Help to construct the tree of erased directories.

then(fun)

  • fun: (p: string, uuid: string) => Promise<string>

Your custom function to apply on the directory.

new srm.RmDir()
  .then(function (p) {
    return new Promise((resolve, reject) => {
      if (p === '/d/code/')
        reject(new Error())
      else
        resolve(p)
    })
  })
  .rmdir()

rename()

  • No arguments.

Rename the directory to a random string of length 12.

rmdir()

  • No arguments.

The last function to be executed: remove the directory.

Required, invalid standard if omitted.

compile

Use this to compile the standard without rmDir.

Useful for preview and testing uses.

Used in rmdir().

new RmDir()
  .log()
  .compile