@cutticat/safe-cp
v1.0.0
Published
CuttiCat utility to copy files without overwriting existing targets
Maintainers
Readme
@cutticat/safe-cp
Safe file copy for Node.js: copy a file and skip when the target already exists (unless --force).
Useful for quick-start scripts (.env.example → .env) and other bootstrap flows.
Installation
pnpm add @cutticat/safe-cpCLI
safe-cp <source> <target>
safe-cp .env.example .env
safe-cp .env.example .env --forceVia pnpm in a project that lists the package as a dependency:
pnpm exec safe-cp .env.example .envAPI
import { safeCopyFile } from "@cutticat/safe-cp"
const result = await safeCopyFile({
source: ".env.example",
target: ".env",
cwd: process.cwd(),
force: false,
})
if (result.status === "copied") {
console.log(`Copied to ${result.target}`)
}Documentation
Requirements
- Node.js >= 22.0.0
- pnpm >= 10.17.0
