Displaying 1 to 20 from 65 results

trash - Move files and folders to the trash

  •    Javascript

Works on macOS, Linux, and Windows.In contrast to fs.unlink, del, and rimraf which permanently delete files, this only moves them to the trash, which is much safer and reversible.

del - Delete files and directories

  •    Javascript

Similar to rimraf, but with a Promise API and support for multiple files and globbing. It also protects you against deleting the current working directory and above.Support this project and improve your JavaScript skills with this great ES6 course by Wes Bos. Try his free JavaScript 30 course for a taste of what to expect. You might also like his React and Sublime course.

trash-cli - Move files and folders to the trash

  •    Javascript

Works on macOS, Linux, and Windows.In contrast to rm which is dangerous and permanently delete files, this only moves them to the trash, which is much safer and reversible. I would also recommend reading my guide on safeguarding rm.

tinydir - Lightweight, portable and easy to integrate C directory and file reader

  •    C

Lightweight, portable and easy to integrate C directory and file reader. TinyDir wraps dirent for POSIX and FindFirstFile for Windows. Windows unicode is supported by defining UNICODE and _UNICODE before including tinydir.h.




temp-dir - Get the real path of the system temp directory

  •    Javascript

The os.tmpdir() built-in doesn't return the real path. That can cause problems when the returned path is a symlink, which is the case on macOS. Use this module to get the resolved path.

tempy - Get a random temporary file or directory path

  •    Javascript

Get a temporary file path you can write to.You usually won't need either the extension or name option. Specify them only when actually needed.


user-home - Get the path to the user home directory

  •    Javascript

Returns null in the unlikely scenario that the home directory can't be found.This module was made long before os-homedir. When Node.js decided to add a native method for getting the user's home directory, I made a polyfill matching its API and decided to depend on it here, so not to have duplicate code. The main reason this one is still around is that lots of modules depend on it and I see no reason to inconvenience dependents by deprecating this. This one also gets the home directory on startup and returns a string rather than exposing a method, so it's faster, and I prefer this API. Modules are cheap in Node.js, so doesn't matter. Use whichever you prefer. I'm going to continue using this one.

passwd-user - Get the passwd user entry from a username or uid

  •    Javascript

Works on macOS and Linux. See user-info if you need cross-platform support.Accepts a username or uid number. Defaults to the current user (process.getuid()).

path-type - Check if a path is a file, directory, or symlink

  •    Javascript

Returns a Promise for a boolean of whether the path is the checked type.Returns a boolean of whether the path is the checked type.

pwuid - getpwuid() Node.js binding - returns username, name, home directory, shell, gid from uid

  •    C++

If you're creating a reusable module you should probably use passwd-user instead, as it shells out rather than using a native binding.getpwuid() is a POSIX function and won't work on Windows.

xdg-basedir - Get XDG Base Directory paths

  •    Javascript

The properties .data, .config, .cache, .runtime will return null in the uncommon case that both the XDG environment variable is not set and the users home directory can't be found. You need to handle this case. A common solution is to fall back to a temp directory.Directory for user specific data files.

require-glob - Requires multiple modules using glob patterns and combines them into a nested object.

  •    Javascript

Requires multiple modules using glob patterns and combines them into a nested object.Returns a promise that resolves to an object containing the required contents of matching globbed files.