universal-javascript-runtimes

Configure Nitro to run universal JavaScript across Node.js, edge runtimes, and browsers.

35|5|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/farming-labs/fm-skills --skill universal-javascript-runtimes-farming-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: universal-javascript-runtimes
Source: https://github.com/farming-labs/fm-skills/tree/main/universal-javascript-runtimes
Command: npx skills add https://github.com/farming-labs/fm-skills --skill universal-javascript-runtimes-farming-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Modern JavaScript runs in many environments (Node.js, browsers, edge runtimes) with different APIs. This Skill explains how to write code that works across all targets by using universal runtimes, adapters, and web-standard APIs.

Core Features & Use Cases

  • Universal runtime concepts: web-standard APIs, Nitro, H3, unenv, and adapters that abstract runtime differences.
  • Cross-platform deployment: build and deploy apps to Node.js servers, Cloudflare Workers, Deno, Bun, and Nitro presets.
  • Use Case: Create a single API handler that runs in both a Node server and at the edge without code changes, dramatically reducing platform-specific maintenance.

Quick Start

Start building universal JavaScript by configuring Nitro with a runtime preset, writing H3-based handlers, and verifying the same code path runs on Node.js and edge runtimes.

Frequently Asked Questions about universal-javascript-runtimes

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

FAQPage Schema
How do I run JavaScript code on both Node.js and Cloudflare Workers without changing it?

Use the UnJS toolkit, specifically Nitro and H3, to write universal JavaScript handlers. By configuring Nitro with a specific runtime preset, your single codebase can deploy to both Node.js and edge runtimes without modifications.

What are universal JavaScript runtimes and why do I need them?

Universal JavaScript runtimes solve runtime fragmentation across Node.js, browsers, and edge environments by using adapters and web-standard APIs. They are needed to maintain a single codebase that executes consistently across different deployment targets.

Does my existing Node.js server code work on edge runtimes like Deno and Bun?

Existing Node.js server code does not automatically work on edge runtimes like Deno and Bun. You must adopt web-standard APIs and use unenv polyfills to bridge the differences and make your code universal.

How to configure Nitro presets for cross-platform JavaScript deployment?

Configure Nitro presets for cross-platform deployment by targeting a specific runtime in your Nitro configuration file. This allows your H3 handlers and unenv polyfills to compile correctly for Node.js, Deno, Bun, or Cloudflare Workers.

Can I use H3 handlers to create a single API that runs at the edge and on Node servers?

Yes, you can use H3 handlers to create a single API that runs at the edge and on Node servers. H3 abstracts runtime differences, allowing the same code path to execute across various environments without platform-specific maintenance.

Why does my JavaScript app break when moving from Node.js to an edge runtime?

Your JavaScript app breaks when moving from Node.js to an edge runtime due to differing APIs. You need to implement unenv polyfills and adopt web-standard APIs to abstract these runtime differences and ensure compatibility.

Related Skills