JSON compression in the browser, with gzip and the Compression Streams API.

This page summarizes the projects mentioned and recommended in the original post on /r/javascript

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • download-node-nightly-executable

    Download node nightly executable

  • I use DecompressionStream() to decompress the Node.js nightly release before extracting only the node executable from the tar archive https://github.com/guest271314/download-node-nightly-executable/blob/main/index.html.

  • js-untar

    Library for reading tar files in the browser.

  • let [node_nightly_build] = await ( await fetch('https://nodejs.org/download/nightly/index.json') ).json(); let { version, files } = node_nightly_build; let node_nightly_url = `https://nodejs.org/download/nightly/${version}/node-${version}-${osArch}.tar.gz`; let url = `${cors_api_url}${node_nightly_url}`; console.log(`Fetching ${node_nightly_url}`); const request = (await fetch(url)).body.pipeThrough( new DecompressionStream('gzip') ); // Download gzipped tar file and get ArrayBuffer const buffer = await new Response(request).arrayBuffer(); // Decompress gzip using pako // Get ArrayBuffer from the Uint8Array pako returns // const decompressed = await pako.inflate(buffer); // Untar, js-untar returns a list of files // (See https://github.com/InvokIT/js-untar#file-object for details) const untarFileStream = new UntarFileStream(buffer); while (untarFileStream.hasNext()) { file = untarFileStream.next(); if (/\/bin\/node$/.test(file.name)) { break; } } writable = await fileSystemHandle.createWritable(); writer = writable.getWriter(); await writer.write(file.buffer); await writer.close(); new Notification('Download complete.', { body: `Successfully downloaded node executable ${version}` }); } catch (e) { console.log(e); } finally { console.log('Done'); }

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts