Socket
Socket
Sign inDemoInstall

trash

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trash

Cross-platform command-line app to move files and directories to the trash - A safer alternative to `rm`


Version published
Weekly downloads
71K
increased by1.11%
Maintainers
1
Weekly downloads
 
Created
Source

trash

Cross-platform command-line app to move files and directories to the trash - A safer alternative to rm

Build Status

Works on OS X, Linux and Windows.

CLI

$ npm install --global trash
$ trash --help

Usage
  $ trash <path> [<path> ...]

Example
  $ trash unicorn.png rainbow.png

Globbing support is left up to your shell, but $ trash *.png should expand to the above in most shells.

API

$ npm install --save trash
var trash = require('trash');

trash(['unicorn.png', 'rainbow.png'], function (err) {
	if (err) {
		throw err;
	}

	console.log('done');
});

Info

On OS X AppleScript is used as it's the only way to support built-in features such as Put back.

On Linux trash-cli is used. Requires Python. Help wanted on a Node version.

On Windows cmdutils is used.

License

MIT © Sindre Sorhus

Keywords

FAQs

Package last updated on 14 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc