{"id":48199,"library":"iso-web","title":"iso-web","description":"Isomorphic JavaScript library providing cross-platform web API implementations including fetch, EventTarget, AbortSignal, Web Crypto (SubtleCrypto), and DNS-over-HTTPS (DoH). Version 3.1.2, actively maintained. Key differentiators: zero-dependency core, supports both Node.js and browser environments, ships TypeScript types, and includes DoH resolver. Release cadence is irregular but frequent (multiple releases per year).","status":"active","version":"3.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/hugomrdias/iso-repo/tree/master/packages/iso-web","tags":["javascript","web apis","crypto","webcrypto","abortcontroller","abortsignal","doh","dnslink","event-target","typescript"],"install":[{"cmd":"npm install iso-web","lang":"bash","label":"npm"},{"cmd":"yarn add iso-web","lang":"bash","label":"yarn"},{"cmd":"pnpm add iso-web","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Named export, not default. Works in Node.js 18+ without polyfill.","wrong":"import fetch from 'iso-web/fetch'","symbol":"fetch","correct":"import { fetch } from 'iso-web'"},{"note":"ESM-only since v3. Use dynamic import for CJS.","wrong":"const { EventTarget } = require('iso-web')","symbol":"EventTarget","correct":"import { EventTarget } from 'iso-web'"},{"note":"AbortController is not re-exported; use global AbortController.","wrong":"import { AbortController } from 'iso-web'","symbol":"AbortSignal","correct":"import { AbortSignal } from 'iso-web'"},{"note":"Exposes Web Crypto API (SubtleCrypto), not Node's crypto module.","wrong":"import crypto from 'crypto'","symbol":"crypto","correct":"import { crypto } from 'iso-web'"},{"note":"All lowercase export name.","wrong":"import { DOH } from 'iso-web'","symbol":"doh","correct":"import { doh } from 'iso-web'"}],"quickstart":{"code":"import { fetch, crypto, doh, EventTarget } from 'iso-web';\n\n// Fetch example\nasync function getData() {\n  const response = await fetch('https://api.example.com/data');\n  return response.json();\n}\n\n// Crypto example\nasync function hashPassword(password) {\n  const encoder = new TextEncoder();\n  const data = encoder.encode(password);\n  const hash = await crypto.subtle.digest('SHA-256', data);\n  return hash;\n}\n\n// DoH example\nasync function resolveDNS(domain) {\n  const result = await doh.query(domain, 'A');\n  return result.answers;\n}\n\n// EventTarget example\nconst target = new EventTarget();\ntarget.addEventListener('custom', (e) => console.log(e.detail));\ntarget.dispatchEvent(new CustomEvent('custom', { detail: 'hello' }));\n\nconsole.log('All examples work cross-platform');","lang":"typescript","description":"Demonstrates usage of fetch, crypto, doh, and EventTarget exports with type safety."},"warnings":[{"fix":"Use dynamic import() or switch to ESM.","message":"v3 made the package ESM-only; CJS require() will throw.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use global AbortSignal instead; the export may be removed in v4.","message":"AbortSignal export is deprecated in favor of global AbortSignal in Node 15+.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Ensure your page is served over HTTPS or use a secure context.","message":"crypto.subtle is undefined in insecure contexts (HTTP).","severity":"gotcha","affected_versions":"all"},{"fix":"Use a CORS proxy or configure server to allow cross-origin requests.","message":"DoH queries may fail in browser due to CORS restrictions.","severity":"gotcha","affected_versions":"all"},{"fix":"Change 'import iso from 'iso-web'' to 'import { fetch } from 'iso-web''.","message":"v2 to v3 removed default export; all exports are now named.","severity":"breaking","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'3.1.2':28 'abortcontrol':65 'abortsign':17,66 'activ':29 'api':12,62 'browser':41 'cadenc':51 'core':36 'cross':9 'cross-platform':8 'crypto':19,63 'depend':35 'differenti':32 'dns':23 'dns-over-http':22 'dnslink':68 'doh':26,48,67 'environ':42 'event':70 'event-target':69 'eventtarget':16 'fetch':15 'frequent':55 'https':25 'implement':13 'includ':14,47 'irregular':53 'iso':2 'iso-web':1 'isomorph':4 'javascript':5,60 'key':31 'librari':6 'maintain':30 'multipl':56 'node.js':39 'per':58 'platform':10 'provid':7 'releas':50,57 'resolv':49 'ship':43 'subtlecrypto':20 'support':37 'target':71 'type':45 'typescript':44,72 'version':27 'web':3,11,18,61 'webcrypto':64 'year':59 'zero':34 'zero-depend':33","created_at":"2026-06-07T16:55:24.417012+00:00","updated_at":"2026-06-07T16:55:24.417012+00:00","problems":[{"fix":"Set 'moduleResolution' to 'node16' or 'bundler' in tsconfig.json.","cause":"TypeScript may not resolve the package types; check tsconfig 'moduleResolution'.","error":"Cannot find module 'iso-web' or its corresponding type declarations."},{"fix":"Remove the import and use global AbortSignal.","cause":"Using the deprecated AbortSignal export from iso-web in an environment with native AbortSignal.","error":"Unsupported private field on AbortSignal."},{"fix":"Use valid algorithm names like 'SHA-256', 'SHA-384', 'SHA-512'.","cause":"Invalid algorithm name passed to crypto.subtle.digest.","error":"Failed to execute 'digest' on 'SubtleCrypto': Algorithm: Unrecognized name."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/hugomrdias/iso-repo/tree/master/packages/iso-web","github":"https://github.com/hugomrdias/iso-repo/tree/master/packages/iso-web","docs":null,"changelog":null,"pypi":null,"npm":"iso-web","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}