UNPKG

fslockjs

Version:

Easy to use file system queue with locking and events. Provide Asynchronous utilities for Directories and File

15 lines (13 loc) 287 B
/** * Allow to await the execution of the job * @returns Job **/ async function execution(){ return new Promise((resolve => { if(this.state==='executed') return resolve(this); this.once('executed', ()=>{ return resolve(this); }) })) } export default execution;