Skip to content

ethereumeg/event-lists

Folders and files

NameName
Last commit message
Last commit date

Latest commit

May 16, 2023
50f0edf Β· May 16, 2023

History

28 Commits
May 14, 2023
May 16, 2023
May 16, 2023
May 14, 2023
May 14, 2023
May 16, 2023
May 16, 2023
May 16, 2023

Repository files navigation

event-lists

πŸ“š The Event Lists specification

Schema

Examples of Event Lists

Name Example
minimal YAML / JSON

Javascript/Typescript module

Deno

Deno example

import Ajv from "https://esm.sh/v114/ajv@8.12.0";
import addFormats from "https://esm.sh/ajv-formats@2.1.1";
import { parse as yamlParse } from "https://deno.land/std@0.187.0/yaml/mod.ts";
import { schema } from "https://deno.land/x/event_lists@0.0.6/mod.ts";

const ajv = new Ajv({ strict: false });
addFormats(ajv);
const validate = ajv.compile(schema);

const LIST_YAML_FILE = "./src/0.1/examples/minimal.yaml";

const list = yamlParse(await Deno.readTextFile(LIST_YAML_FILE));

if (!validate(list)) {
  throw validate.errors;
}

console.log("Event List valid");

License

MIT