# @reflink/reflink

> [![npm version](https://badge.fury.io/js/%40reflink%2Freflink.svg)](https://www.npmjs.com/package/@reflink/reflink) [![Build Status](https://github.com/pnpm/reflink/workflows/CI/badge.svg)](https://github.com/pnpm/reflink/actions)

Latest version **0.1.19** (published 2024-12-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @reflink/reflink
pnpm add @reflink/reflink
yarn add @reflink/reflink
bun add @reflink/reflink
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.19 |
| Published | 2024-12-05 |
| First published | 2023-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 10 |
| Dependencies | 0 |
| Unpacked size | 12.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 27 |
| Maintainers | ialdama |

## Links

- npm: https://www.npmjs.com/package/@reflink/reflink
- Repository: https://github.com/pnpm/reflink
- Homepage: https://github.com/pnpm/reflink#readme
- Issues: https://github.com/pnpm/reflink/issues
- npm.io page: https://npm.io/package/@reflink/reflink

## Recent versions

- 0.1.19 (latest) — 2024-12-05
- 0.1.16-canary.bf50305 (canary) — 2024-11-23
- 0.1.18 — 2024-11-25
- 0.1.17 — 2024-11-23
- 0.1.16 — 2024-01-02
- 0.1.15 — 2023-12-12
- 0.1.15-canary.fdd3c10 — 2023-12-12
- 0.1.14 — 2023-11-13
- 0.1.14-canary.c18f49b — 2023-11-12
- 0.1.14-canary.298490b — 2023-11-07
- 0.1.14-canary.b89d057 — 2023-11-07
- 0.1.13 — 2023-10-30
- 0.1.12 — 2023-10-15
- 0.1.11 — 2023-10-11
- 0.1.10 — 2023-10-10
- … 4 more at https://npm.io/package/@reflink/reflink/versions

## README

# @reflink/reflink

[![npm version](https://badge.fury.io/js/%40reflink%2Freflink.svg)](https://www.npmjs.com/package/@reflink/reflink)
[![Build Status](https://github.com/pnpm/reflink/workflows/CI/badge.svg)](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
```

---
_Source: https://npm.io/package/@reflink/reflink · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
