how to get javascript trash the return value? i need to confirm the operation is success or not related to this trash function:
const trash = require('trash');
(async () => {
await trash(['*.png', '!rainbow.png']);
})();
i've trying this:
(async () => {
await trash(filename).then( function(val) {
console.log(val)
})
})()
[UPDATE]
also this:
trash(filename).then(value => {
console.log(value)
})
i dont know how to get return value from this function. reference: sindresorhus/trash
from youtube.com i found video about using trash
https://www.youtube.com/watch?v=P2N7mpZ3v1Q
but still not answering my question. the question is updated. please help me.