Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <h1>Streaming JSON</h1>
  <p>
    This demo downloads a streaming JSON file,
    which is just JSON objects separated by newlines.
    When combined with streaming, you can deal with objects
    as they arrive, rather than waiting on the whole response.
  </p>
  <p>
    This uses the fetch API, which is supported in
    Chrome &amp; Firefox, but only Chrome supports
    streams right now.
  </p>
  <button class="stream">Stream it</button>
  <button class="fetch-then-process">Fetch then process it</button>
  <button class="fetch-regular-json">Fetch regular JSON</button>
  <div class="output"></div>
  <h2>Articles on streams</h2>
  <ul>
    <li><a href="https://jakearchibald.com/2016/streams-ftw/">Intro to web streams</a></li>
    <li><a href="https://jakearchibald.com/2016/streaming-template-literals/">Streaming template literals</a></li>
  </ul>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
jakearchibaldpro
0viewers