node

Guide Node.js TypeScript code to comply with type-stripping constraints.

2|Updated Oct 28, 2022
One-click install
npx skills add https://github.com/jmanuelrosa/dotfiles --skill node-jmanuelrosa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: node
Source: https://github.com/jmanuelrosa/dotfiles/tree/main/roles/ai/files/claude/skills/node
Command: npx skills add https://github.com/jmanuelrosa/dotfiles --skill node-jmanuelrosa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides best-practice guidance for writing Node.js applications in TypeScript using type-stripping techniques to simplify runtime behavior and improve maintainability.

Core Features & Use Cases

  • Enforces TypeScript type-stripping principles (type-only imports, no enums, no namespaces, no constructor parameter properties) to align code with modern Node.js runtimes.
  • Guides on ES Modules usage, explicit file extensions, and JSON imports, with configuration recommendations and real-world examples.
  • Real-world scenarios include migrating a codebase to TypeScript with strict type discipline, building maintainable server code, and ensuring compatibility with Node.js without transpilations.

Quick Start

Run the Node.js app with TypeScript type stripping enabled to see the guidance in action.

Frequently Asked Questions about node

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

FAQPage Schema
How do I use TypeScript type stripping in Node.js without transpilation?

To use TypeScript type stripping in Node.js without transpilation, you must use type-only imports, avoid enums and namespaces, and omit constructor parameter properties so the runtime can safely erase types without a build step.

What is TypeScript type stripping and when do I need it for Node.js?

TypeScript type stripping is a runtime mechanism that erases type annotations without transpiling syntax. You need it when running native TypeScript in Node.js to streamline runtime behavior and improve maintainability without a build step.

Why should I avoid enums and namespaces when writing TypeScript for Node.js?

You should avoid enums and namespaces in Node.js TypeScript because they emit runtime code that cannot be simply stripped. Replacing them with plain objects and type-only imports ensures compliance with type-stripping constraints.

How do I configure ES Modules with explicit file extensions in Node.js TypeScript?

Configuring ES Modules with explicit file extensions in Node.js TypeScript requires adding the .ts or .js extension to import paths and using type-only imports to ensure the module loader resolves dependencies correctly during type stripping.

Does Node.js type stripping support importing JSON files in TypeScript?

Yes, Node.js type stripping supports JSON imports in TypeScript. You can import JSON files directly in your ES Module workflows, and the runtime will resolve them without needing additional transpilation or complex configuration.

What are the limitations of using TypeScript type stripping in Node.js?

Limitations of TypeScript type stripping in Node.js include the inability to use enums, namespaces, and constructor parameter properties, as these features emit runtime code that requires a traditional transpiler rather than simple type erasure.