One of the first commands you learn when experimenting with a command line is
rm, Utility for deleting files and directories. Deletion is a core user interface operation of the computer, but operating systems use the “garbage” paradigm, in which files are stored before they are actually deleted. with the
rm Utility, however, files are deleted immediately and permanently.
// Install with `yarn add trash` // Move a file to trash const trash = require('trash'); await trash('bug-report.jpg');
There are also a
trash-cli Package for using the command line utility:
yarn add trash-cli # Usage trash unicorn.png rainbow.png trash '*.png' '!unicorn.png'
rm Can be really hard so there is a
trash The utility is helpful in providing users with a file deletion paradigm that they are used to.
Page Visibility API
One event that has always been missing in a document is a signal for the time when the user is looking at a given tab, or another tab. When does the user turn off our site to look at something else? When are they coming back?