link-unlink
TypeScript icon, indicating that this package has built-in type declarations

0.1.24 • Public • Published

link-unlink

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.24185latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.24185
0.1.231
0.1.222
0.1.211
0.1.201
0.1.192
0.1.182
0.1.172
0.1.162
0.1.151
0.1.142
0.1.131
0.1.121
0.1.112
0.1.101
0.1.91
0.1.81
0.1.72
0.1.61
0.1.51
0.1.41
0.1.31
0.1.21
0.1.11
0.1.01

Package Sidebar

Install

npm i link-unlink

Weekly Downloads

217

Version

0.1.24

License

MIT

Unpacked Size

31.7 kB

Total Files

23

Last publish

Collaborators

  • kmalakoff