One of many first instructions you be taught when experimenting with command line is rm
, the utility for deleting recordsdata and directories. Deletion is a core laptop UI operation however working techniques use a “Trash” paradigm, the place recordsdata are saved earlier than actually deleted. With the rm
utility, nevertheless, recordsdata are instantly, completely deleted.
In the event you’re like me and afraid to automate everlasting file deletion, you possibly can go for a utility named trash
. This good Node.js library strikes recordsdata to the trash as a substitute of on the spot deletion.
// Set up with `yarn add trash` // Transfer a file to trash const trash = require('trash'); await trash('bug-report.jpg');
There’s additionally a trash-cli
bundle for utilizing the utility from command line:
yarn add trash-cli # Utilization trash unicorn.png rainbow.png trash '*.png' '!unicorn.png'
rm
will be actually harsh so having a trash
utility is useful in offering customers a file deletion paradigm that they are used to.
Chris Coyier’s Favourite CodePen Demos
David requested me if I might be up for a visitor put up choosing out a few of my favourite Pens from CodePen. A frightening activity! There are such a lot of! I managed to choose a couple of although which have blown me away over the previous few months. In the event you…
Common Expressions for the Remainder of Us
Ultimately you will run throughout an everyday expression. With their cryptic syntax, complicated documentation and large studying curve, most builders accept copying and pasting them from StackOverflow and hoping they work. However what for those who might decode common expressions and harness their energy? In…
Retrieve Google Analytics Visits and PageViews with PHP
Google Analytics is an impressive web site analytics software that offers you far more details about your web site than you in all probability want. Higher to get greater than you need than not sufficient, proper? Anyhow I examine my web site statistics extra usually than I ought to and…
HTML5 Context Menus
One of many hidden gems throughout the HTML5 spec is context menus. The HTML5 context menu spec permits builders to create customized context menus for given blocks inside easy menu and menuitem parts. The menu data lives proper throughout the web page so…
[ad_2]