discontinuedPackage stdweb has been discontinued and replaced by webfetch.

Web-standard APIs

stdweb is a standard Web APIs compatibility library, its purpose is to eliminate Dart-specific syntax.

Why do you need stdweb?

If you have experience with JavaScript applications on the web, Node.js, Bun.js or Deno runtimes, then stdweb will feel familiar to you. You no longer need to learn Dart's various API implementations in depth, you can start using Dart directly from the APIs we are familiar with!

How to use stdweb?

stdweb is a Dart package, you can use it in your project by adding the following dependencies to your pubspec.yaml file:

dependencies:
  stdweb: latest

Web APIs compatibility

HTTP

API Status
fetch ✅
Headers ✅
Request ✅
Response ✅
FormData ✅

URLs

API Status
URL ✅
URLSearchParams ✅

File

API Status
Blob ✅
File ✅

JSON

API Status
JSON ✅

Encoding and decoding

API Status
encodeURIComponent ✅
decodeURIComponent ✅
encodeURI ✅
decodeURI ✅
atob ❌
btoa ❌
TextEncoder ❌
TextDecoder ❌

Timeout and interval

API Status
setTimeout ❌
clearTimeout ❌
setInterval ❌
clearInterval ❌

Crypto

API Status
crypto ❌
SubtleCrypto ❌
CryptoKey ❌

Debugging

API Status
console ❌
performance ❌

User interaction

API Status
alert ❌
confirm ❌
prompt ❌

TODO

  • User interaction
  • Crypto
  • Debugging
  • Timeout and interval
  • Encoding and decoding
    • atob
    • btoa
    • TextEncoder
    • TextDecoder

Libraries

stdweb