Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →In Node.js 24, check the campaign asset against your organization’s applicable retention policy before calling unlink or rm. The policy decision determines whether deletion is allowed; the filesystem API only performs the removal. It does not set a retention period, establish legal compliance, or create a policy approval.
Run the retention decision before any filesystem call
- Load the asset record. Retrieve the campaign asset and the metadata your authoritative retention policy needs to assess it.
- Evaluate the policy. Apply the relevant retention rule and check any hold or approval state. The policy, not Node.js, defines which fields matter and what values permit deletion.
- Stop unless deletion is affirmatively allowed. If the decision blocks deletion, is uncertain, or lacks required approval, do not call
unlinkorrm. Record the decision and reason in your application’s audit mechanism. - Authorize the target and scope. Resolve the path from trusted asset metadata. Decide whether the permitted target is one file or symbolic link, or an explicitly authorized directory tree. Do not broaden a single-asset decision into recursive directory deletion.
- Remove the authorized target and handle the result. Choose the API for the target type, handle filesystem errors, and record the deletion result in your own audit mechanism.
The policy evaluation, asset data model, path authorization, error handling, and audit storage are application responsibilities. Node.js does not implement them for a campaign cleanup job.
Choose unlink or rm by target and scope
| API | What it removes | When to use it |
|---|---|---|
unlink |
A file or symbolic link; it does not remove a directory. | For an authorized individual file or symbolic link. |
rm |
Files and directories. | For an authorized file or directory. Set recursive: true only when the approved scope is a directory tree. |
For recursive directory removal, use fs.rm or fsPromises.rm. The Node.js documentation marks recursive fs.rmdir behavior as deprecated and recommends fs.rm.
Understand the rm options before setting them
The official Node.js v24.20.0 filesystem documentation describes fsPromises.rm(path[, options]) as removing files and directories; it fulfills with undefined on success. Its defaults are:
#1 Best Overall
- Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
recursive: false: recursive removal is off unless requested.force: false: a missing-path error is not suppressed unless requested.maxRetries: 0: no retries are configured by default.retryDelay: 100: the delay in milliseconds between retries when retries apply.
maxRetries and retryDelay apply only when recursive is true. In recursive mode, configured retries cover the documented error classes EBUSY, EMFILE, ENFILE, ENOTEMPTY, and EPERM. Choose retry behavior for operational reasons; retries do not establish that an asset is eligible for deletion.
Likewise, force: true changes missing-path error handling. It is not a retention check and should not be used to conceal uncertainty about whether the right asset was selected.
Rank #2
- Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Illustrative async implementation
import { rm, unlink } from 'node:fs/promises';
async function deleteEligibleAsset(asset, policy, { directory = false } = {}) {
// Implement this using the organization's authoritative retention policy.
// Account for applicable holds and approvals before any removal call.
const decision = await policy.evaluate(asset);
if (!decision.allowed) {
return { deleted: false, reason: decision.reason };
}
// The authorized scope must match the selected operation.
if (directory) {
await rm(asset.path, { recursive: true });
} else {
await unlink(asset.path);
}
return { deleted: true };
}
This example shows sequencing, not a complete production design. policy.evaluate, the asset schema, path validation, exception handling, and audit logging must be implemented by your application. If your job should treat a missing path as success or retry recursive removal, make that choice explicitly in the rm options; neither setting replaces the retention gate.
Quick Recap
Best Value
- [Upgraded Version] - This external hard drive features a mirrored logo stripe combined with a striped anti-slip design, and the rounded corners of the casing make it easier to grip. The stripes also have a heat dissipation function, ensuring stable and fast data transfer.
- 【Ultra-thin and quiet】 - The motherboard adopts JMicron 578 noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
- 【Ultra-Fast Data Transfers】 - Pairing this external hard drive with JMicron 578 solution USB 3.0 and USB 2.0 interfaces enables blazing-fast data transfer. It boasts theoretical read speeds of up to 125MB/s and write speeds of up to 103MB/s.
- 【Plug and Play】 - With no software to install, just plug it in and the drive is ready to use.The hard disk chip is wrapped with an aluminum anti-interference layer to increase heat dissipation and protect data.
- 【What You Get】 - 1 x Portable Hard Drive, 1 x USB 3.0 Cable, 1 x User Manual, Gift-type shell packaging ,Three-year manufacturer's warranty and free technical support services.
Rank #4
- Easily store and access 4TB of content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Rank #3
- Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

