@nielse63/trash
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

@nielse63/trash

Move files to trash (instead of rm -rf)

npm (scoped) npm GitHub issues by-label

Installation

npm install --save @nielse63/trash

Usage

CLI

$ trash --help

Usage: trash [options] <arguments>

Move files to trash (instead of rm -rf)

Arguments:
  ...

Options:
  -V, --version  output the version number
  -h, --help     display help for command

API

import trash from '@nielse63/trash';

const results = await trash(['file.md', 'directory'], {
  cwd: process.cwd(),
  trash: path.join(os.homedir(), '.Trash'),
});

// results:
// [
//   {
//     "old": "/path/to/file.md",
//     "new": "/Users/username/.Trash/file_1691311838573_dUGBD6dd.md"
//   },
//   {
//     "old": "/path/to/directory",
//     "new": "/Users/username/.Trash/directory_1691311838573_nsRcsJWf"
//   }
// ]

Package Sidebar

Install

npm i @nielse63/trash

Weekly Downloads

0

Version

1.1.2

License

MIT

Unpacked Size

10.4 kB

Total Files

7

Last publish

Collaborators

  • nielse63