UNPKG

msync

Version:

Easily manage building and syncing multiple node-modules in a flexibly defined workspace.

17 lines (16 loc) 396 B
import { fs } from './libs'; export async function tryDelete(path, options = {}) { const retry = options.retry === undefined ? 3 : options.retry; let count = 0; do { count++; try { await fs.remove(path); } catch (error) { if (count >= retry) { throw error; } } } while (count < retry); }