npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

trash-back

v1.1.1

Published

A MacOS solution to Trash using the "Put Back" functionality to put all items inside Trash automatically.

Readme

Trash Back

When you delete a file in MacOS, its original locations is stored in the .DsStore hidden files in case you want to restore it. Recent versions of macOS have the ability to put stuff in your Trash back where it came from, lickety-split, and it’s way faster than dragging and dropping. So as you know, if you click on the trash icon in your Dock, you will see the items you have, well, trashed. Right-click or Control-click on any file (or hold down Command to click and select multiple items, then Control-click), and you will see the Put Back option. The only problem is that it let us do it for only one item at the time. Motivated by this issues and thanks to Giacomo Balli, we created this repository to help you.

The Issue

To undrstand the issue we are talking about just follow the next figures.

  1. Open the Trash.
  1. Right-click on any file, and you’ll see the Put Back option.
  1. Do this for each file you have.

As you can see you have the tremendeus tedeus solutions of clicking Put Back each time you want to put back a file. However, there is a smarter solution for it. Follow the next steps of this README file.

The Solution

The solutions is an AppleScript that puts back all items in the Trash. Just open "AppleScript Editor" and copy/paste the lines below, then run the script as many times as needed. If you have any doubts of how to do it, just follow the Scripting with AppleScript guide.

tell application "System Events"
  tell process "Finder"
    repeat 100 times
      tell application "Finder" to open trash
      tell application "Finder" to activate
      key code 126
      key down command
      key code 51
      key up command
      delay 0.2 -- adjust delay as needed
    end repeat
  end tell
end tell

Usage

AppleScript is a language used to automate the actions of the Macintosh Operating System (MacOS) and many of its applications. The purpose of this repository is to automate sevreal actions of Trash management to put back several items. For that, the computer reads the sequential instructions contained our scripts, and then communicates those instructions to targeted the MacOS Finder. The targeted Trash items are read from the communicated instructions, and then perform the actions of putting back the items.

Clone

Start by cloning the repository to your local machine so you may begin use our solution. This local copy is called your local repository.

git clone [email protected]:opprDev/trash-back.git
cd trash-back

Install

Make sure you have Node.js and npm installed. The npm can install packages in local or global mode. In local mode it installs the package in a node_modules folder in your parent working directory. This location is owned by the current user.

npm install

Run

You have several ways to run the scripts in your local machine. This repository explains how to run locally installed solutions of this repository. The running instructions are as follows.

Node

The famous npm is most commonly used for managing Node.js modules, but it works for AppleScript too when combined with some libraries. If you have some question about how to start via npm start just follow the Documentation and we hope it will help you.

  1. Globally install the trash-back package:
npm install -g trash-back
  1. Clone the repository:
[email protected]:opprDev/trash-back.git
  1. Go inside the folder:
cd trash-back
  1. Locally install the trash-back package:
npm install
  1. Run the following command as a means to symlink a package folder:
npm link
  1. Run the main command:
trash-back

Terminal

Running AppleScript greatly increases what you can do remotely from the command line, and enables a lot of cool tricks that are hard to do otherwise. While you can run whole scripts in the command line, this way of running is only about running can also log into a remote computer (using ssh) and run the AppleScript on that computer, via the osascript command. The osascript command can also run any other Open Scripting Architecture language using the -l modifier.

osascript scripts/trash-back.scpt

AppleScript Editor

The "user friendly" way to do this task. If you have any doubts just follow The Ultimate Beginner's Guide To AppleScript information.

  1. Open the AppleScript Editor;
  1. Copy-paste the code inside the Editor and press Run;

About

This repository was first created by Francisco Maria Calisto (FMCalisto) using the basics of the AppleScripts from Giacomo Balli. At the end we used a npm solution called node-osascript, a node solution from Fabrice Weinberg (FWeinb).

Authors

Acknowledgements