[](https://www.npmjs.com/package/@reflink/reflink) [](https://github.com/pnpm/reflink/actions)
npm install @reflink/reflink

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.
Just install @reflink/reflink using your favorite package manager:
``bash`
pnpm add @reflink/reflink
The package provides both synchronous and asynchronous methods to clone files.
First, import the package:
`typescript`
import { reflinkFileSync, reflinkFile } from '@reflink/reflink';
#### Synchronous Method
`typescript`
reflinkFileSync('source.txt', 'destination.txt');
#### Asynchronous Method
`typescript`
await reflinkFile('source.txt', 'destination.txt');
This package is tested using vitest. You can run the tests locally using:
`bash``
pnpm install
pnpm build
pnpm test