open-index/open-npm huggingface dataset:
npm package: @surrealdb/ql-wasm
Description: WebAssembly utility functions for SurrealQL
Author: Tobie Morgan Hitchcock
Latest version: 0.3.1

# @surrealdb/wasm

WebAssembly utility functions for SurrealQL.

[![](https://img.shields.io/badge/status-beta-ff00bb.svg?style=flat-square)](https://github.com/surrealdb/surrealql.wasm)
[![](https://img.shields.io/badge/license-Apache_License_2.0-00bfff.svg?style=flat-square)](https://github.com/surrealdb/surrealql.wasm)
[![](https://img.shields.io/npm/v/surrealql.wasm?style=flat-square)](https://www.npmjs.com/package/surrealql.wasm)

## Importing the module

A few code snippets to showcase various ways of importing the library.

```js
import { SurrealQL, Value } from '@surrealdb/ql-wasm';
```

### Via UNPKG
```js
import { SurrealQL, Value } from 'https://unpkg.com/@surrealdb/ql-wasm/dist/surrealql/index.js';
```

## Example usage

```js
import { SurrealQL, Value } from '@surrealdb/ql-wasm';

// Creating a SurrealQL Value
const value = Value.from_string("{ id: \"person:tobie\" }");
const value = Value.from_json({ id: "person:tobie" });
const value = Value.from_cbor(/* Uint8Array */);

// Formatting a value
value.format();
value.format(true); // Pretty
value.json();
value.json(true); // Pretty

// Converting a value to CBOR, represented as a Uint8Array
value.to_cbor();

// Formatting queries
SurrealQL.format("SELECT * FROM person");

// Validating queries or values
SurrealQL.validate("SELECT * FROM person");
SurrealQL.validate_where("something = true");
SurrealQL.validate_value("[1, 2, 3]");
SurrealQL.validate_thing("person:tobie");
SurrealQL.validate_idiom("person:tobie->likes[WHERE something]");
SurrealQL.validate_subquery("SELECT * FROM person");

// Extracting tables from a kind
SurrealQL.extract_tables_from_kind("record<person>");
// ["person"]
SurrealQL.extract_tables_from_kind("record<a | b | c>");
// ["a", "b", "c"]
```
npm package: @surrealdb/ui
Description: The SurrealDB UI Kit defines the design system and UI primitives for use throughout all frontend projects at SurrealDB.
Latest version: 1.0.100

# @surrealdb/ui

The SurrealDB UI Kit defines the design system and UI primitives for use throughout all frontend projects at SurrealDB.

## Getting Started

To install dependencies:

```bash
bun install
```

Start the Storybook development server:

```bash
bun run storybook:dev
```

## Icon tool

The icon tool is used to convert the SVG icons to a format that can be used in the UI Kit.

### Requirements
- Install [picosvg](https://github.com/googlefonts/picosvg)
- Export an SVG zip and locate it in the root of the project.

```bash
bun run icons
```

This will generate the `src/constants/icons.ts` file.

## Notes

### Optimise pictos
```
mkdir -p out                   
for f in *.png; do 
  magick "$f" \             
    -resize 500x500 \
    -background none \   
    -gravity center \                                    
    -extent 500x500 \
    "out/${f%.*}.webp"
done
```