https://github.com/pnpm/reflink
https://github.com/pnpm/reflink
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pnpm/reflink
- Owner: pnpm
- Created: 2023-10-01T16:37:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-05T12:35:25.000Z (7 months ago)
- Last Synced: 2025-04-10T02:40:58.212Z (3 months ago)
- Language: JavaScript
- Size: 1020 KB
- Stars: 25
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @reflink/reflink
[](https://www.npmjs.com/package/@reflink/reflink)
[](https://github.com/pnpm/reflink/actions)Copy-on-write file cloning for Node.js, powered by NAPI-RS and built upon [reflink-copy](https://github.com/cargo-bins/reflink-copy). This package supports a variety of platforms, including ARM and x86 architectures.
### Supported Platforms
- Linux
- MacOS
- Windows (Server 2012+ and Windows Dev Drives)## Installation
Just install `@reflink/reflink` using your favorite package manager:
```bash
pnpm add @reflink/reflink
```## Usage
The package provides both synchronous and asynchronous methods to clone files.
### TypeScript Usage
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');
```## Testing
This package is tested using `vitest`. You can run the tests locally using:
```bash
pnpm install
pnpm build
pnpm test
```