typescript-file-downloader-module

Add or repair a Node.js TypeScript file downloader module with safe path and protocol controls.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/cromesdk/ai-skills --skill typescript-file-downloader-module
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-file-downloader-module
Source: https://github.com/cromesdk/ai-skills/tree/main/skills/typescript/typescript-file-downloader-module
Command: npx skills add https://github.com/cromesdk/ai-skills --skill typescript-file-downloader-module

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the need for a robust and secure way to download files within Node.js applications, ensuring data integrity, preventing security vulnerabilities, and providing clear success or failure states.

Core Features & Use Cases

  • Secure File Downloads: Implements safe path handling and protocol validation (HTTP/HTTPS only).
  • Deterministic Results: Returns structured DownloadResult objects for both success and failure, including error codes and metadata.
  • Use Case: Integrate this module into your backend service to reliably download user-uploaded assets, external API data, or software updates, while ensuring no path traversal or unsupported protocols are used.

Quick Start

Use the typescript-file-downloader-module skill to add a downloader service to your Node TypeScript app.

Frequently Asked Questions about typescript-file-downloader-module

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I securely download files in Node.js and TypeScript?

To securely download files in Node.js, use a TypeScript module that enforces HTTP/HTTPS protocol validation and safe path handling, returning a deterministic DownloadResult to prevent path traversal vulnerabilities.

How do I handle file download errors in a NestJS application without throwing exceptions?

Handling file download errors in NestJS requires a non-throwing error mapping approach that catches failures and returns structured DownloadResult objects with specific error codes and metadata for deterministic state management.

How does streaming disk writes work for file downloads in TypeScript?

Streaming disk writes for TypeScript file downloads transfer data directly to the filesystem in chunks, ensuring data integrity and low memory consumption while appending required Referer and User-Agent headers to the request.

Can I use cookies and custom headers for file downloads in a Node.js module?

Yes, a Node.js file downloader module can include optional cookie normalization and require specific Referer and User-Agent headers to authenticate and successfully fetch protected external resources.

What is the best way to normalize cookies for secure file downloads in Node.js?

The best way to normalize cookies for secure file downloads is using a TypeScript module that processes optional cookie headers alongside required User-Agent and Referer controls, ensuring valid external API requests.

Why do my TypeScript file downloads fail due to path traversal protections?

File downloads fail due to path traversal protections when the downloader module enforces strict safe path controls and protocol validation, actively blocking unsupported protocols and unauthorized filesystem access.