I'm currently attempting to port some old CoffeeScript code over (old project) to native NodeJS; I'm struggling to understand what exactly this is doing? or the equivalent in Node?
builder.macro_extensions = [
'iced'
'nsi'
'txt'
]
await exec """
find #{temp} | grep #{(_.map @macro_extensions, (x) -> "-e '\\.#{x}'").join ' '}
""", {silent:on}, defer e,r
if e then return cb e
If anyone could point me in the right direction, that'd be perfect!
Assuming
execreturns a promise, the code passes 2 arguments to theexecfunction, waits for the returned promise to be fulfilled, and sets the variablerto the resolved value.If anything goes wrong (ie. the promise gets rejected), it sets the variable
eto the rejection reason of that promise.The JS equivalent of that code would be: