How to use ncp

Comprehensive ncp code examples:

How to use ncp.ncp:

147
148
149
150
151
152
153
154
155

function appendFiles () {
  if (!opts.append) return
  return Promise.all(
    (Array.isArray(opts.append) ? opts.append : [opts.append]).map(dir => new Promise((resolve, reject) => {
      ncp(dir, path.join(opts.cache, path.basename(dir)), (err) => err ? reject(err) : resolve())
    }))
  )
}