Replacements for cpx
cpx hasn't had a release since 2016 and has bugs and performance issues that are fixed by its replacement
cpx2
cpx is unmaintained. cpx2 is an actively maintained fork that keeps the same CLI bin name (cpx), so it works as a drop-in replacement for CLI usage. For the Node API, switch your import to cpx2.
sh
npm i -D cpx
npm i -D cpx2
# CLI stays the same (bin name is still "cpx")
cpx "src/**/*.{html,png,jpg}" app --watchNode API replacement:
ts
const cpx = require('cpx')
const cpx = require('cpx2')
cpx.copy('src/**/*.js', 'dist', (err) => {
if (err) throw err
})