CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-sveltejs--kit

Web framework for Svelte with SSR, file-based routing, load functions, form actions, and API endpoints

Pending
Overview
Eval results
Files

nodejs-polyfills.mddocs/reference/

Node.js Polyfills

Install Web API polyfills for Node.js environments.

Capabilities

Install Polyfills

/**
 * Install Web API polyfills as globals in Node.js
 * Adds: crypto, File
 * @returns void
 */
function installPolyfills(): void;

Usage:

import { installPolyfills } from '@sveltejs/kit/node/polyfills';

// Call before using Web APIs in Node.js
installPolyfills();

// Now these APIs are available as globals
const file = new File(['content'], 'filename.txt');
crypto.randomUUID();

Notes

  • Import from @sveltejs/kit/node/polyfills
  • Call once at application startup
  • Makes Web APIs available as globals in Node.js
  • Polyfills include:
    • crypto: Web Crypto API
    • File: File API
  • Note: FormData, Headers, Request, and Response are NOT polyfilled by this function - they are available natively in Node.js 18+
  • Required for some adapters (e.g., adapter-node) when using File or crypto APIs
  • Node.js 18+ includes most Web APIs natively

Install with Tessl CLI

npx tessl i tessl/npm-sveltejs--kit

docs

index.md

tile.json