0.0.8 • Published 1 year ago
@w5/onexit v0.0.8
@w5/onexit
#!/usr/bin/env coffee
> @w5/onexit
sleep = (n)=>
new Promise (resolve)=>
setTimeout(
resolve
n
)
return
onexit =>
console.log 'onexit'
await sleep(1000)
console.log 'exit after sleep'
return
output :
onexit
exit after sleep