link-unlink

Link and unlink with saving and restoring the previous file or directory

MIT 47 个版本
安装
npm install link-unlink
yarn add link-unlink
pnpm add link-unlink
bun add link-unlink
README

Link and unlink with saving and restoring the previous file or directory

import { link, unlink } from 'link-unlink';

// if '/path/to/link' exists, it is moved to '/path/to/link.abcde1234' and regardless '/path/to/file_or_folder' -> '/path/to/link'
await link('/path/to/file_or_folder', '/path/to/link'); 

// if '/path/to/link.abcde1234' exists, it is restored to '/path/to/link' otherwise it will be removed
await unlink('/path/to/link'); 

Documentation

API Docs

版本列表
1.1.1 2026-05-26
1.1.0 2025-12-18
1.0.12 2025-12-12
1.0.11 2025-12-12
1.0.10 2025-12-04
1.0.9 2025-12-04
1.0.8 2025-12-04
1.0.7 2025-12-04
1.0.6 2025-12-04
1.0.5 2025-11-06
1.0.4 2025-10-21
1.0.3 2025-10-21
1.0.2 2025-07-08
1.0.1 2025-06-29
0.1.32 2025-06-21
0.1.31 2025-06-20
0.1.30 2025-06-18
0.1.29 2025-06-14
0.1.28 2025-05-24
0.1.27 2025-05-20
0.1.26 2025-05-19
0.1.25 2025-05-18
0.1.24 2025-01-24
0.1.23 2025-01-24
0.1.22 2025-01-23
0.1.21 2025-01-23
0.1.20 2025-01-23
0.1.19 2025-01-23
0.1.18 2025-01-18
0.1.17 2025-01-15
0.1.16 2025-01-15
0.1.15 2025-01-14
0.1.14 2025-01-14
0.1.13 2025-01-14
0.1.12 2025-01-12
0.1.11 2025-01-04
0.1.10 2025-01-04
0.1.9 2025-01-04
0.1.8 2025-01-04
0.1.7 2025-01-04
0.1.6 2025-01-04
0.1.5 2024-12-28
0.1.4 2024-12-28
0.1.3 2024-12-28
0.1.2 2024-12-27
0.1.1 2024-12-27
0.1.0 2024-12-27