Copy-on-write file cloning for Node.js, powered by NAPI-RS and built upon reflink-copy. This package supports a variety of platforms, including ARM and x86 architectures.
- Linux
- MacOS
- Windows (Server 2012+ and Windows Dev Drives)
Just install @reflink/reflink using your favorite package manager:
pnpm add @reflink/reflinkThe package provides both synchronous and asynchronous methods to clone files.
First, import the package:
import { reflinkFileSync, reflinkFile } from '@reflink/reflink';reflinkFileSync('source.txt', 'destination.txt');await reflinkFile('source.txt', 'destination.txt');This package is tested using vitest. You can run the tests locally using:
pnpm install
pnpm build
pnpm test