0.0.17 • Published 11 months ago

@brimdata/zed-wasm v0.0.17

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

zed-wasm

The Zed command line tools built for WebAssembly.

View the interactive demo

Zed is a suite of technologies for managing, storing, and processing data. It's a superset of schema-defined tables, and unstructured documents; an emerging concept we call super-structured data.

The storage layer, type system, query language, and zq command-line utility are just a few of the tools Zed offers to the data community.

This package brings Zed into your browser.

Example

<script type="module">
  import { zq } from 'https://cdn.jsdelivr.net/npm/@brimdata/zed-wasm/index.js';

  const result = await zq({
    input: '1 2 3',
    program: 'this + 1',
  });

  console.log(result);
  /* (3) [Int64, Int64, Int64]
        0 : Int64 {value: '2', type: TypeOfInt64}
        1 : Int64 {value: '3', type: TypeOfInt64}
        2 : Int64 {value: '4', type: TypeOfInt64} */
</script>

Installation

The easiest way to work with the published version of zed-wasm is to use a CDN like JsDelivr. Use the URL below inside of a script tag with the type property set to "module".

const { zq } = await import('https://cdn.jsdelivr.net/npm/@brimdata/zed-wasm/index.js');

API

Only the zq function is exposed at the moment. It takes an options object and returns an array of Zed Value Objects.

function zq(options: {
  input?: string | File | Blob | ReadableStream | any[];
  program?: string;
  inputFormat?: InputFormat; // Defaults to auto
  outputFormat?: "js" | "zed" // Defaults to js
}): Promise<any[]>;

type InputFormat =
  | 'auto'
  | 'arrows'
  | 'csv'
  | 'json'
  | 'line'
  | 'zeek'
  | 'zjson'
  | 'zng'
  | 'zson';

Running Browser Tests

Tests are written with Mocha. To run them:

yarn nx test-browser zed-wasm

When you make changes, run yarn nx build zed-wasm, then reload the page.

0.0.17

11 months ago

0.0.14

1 year ago

0.0.15

1 year ago

0.0.16

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2-beta.1

1 year ago

0.0.1

1 year ago