Skip to content

Replacements for cpx

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 --watch

Node API replacement:

ts
const cpx = require('cpx') 
const cpx = require('cpx2') 

cpx.copy('src/**/*.js', 'dist', (err) => {
  if (err) throw err
})

Released under the MIT License. (ffa30c16)