0.1.3 • Published 1 year ago

@mateonunez/lyra-schema-resolver v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

🪄 Lyra schema resolver

Create your Lyra schema following the official specification.

Tests

Installation

You can install the package using npm, yarn or pnpm:

npm i @mateonunez/lyra-schema-resolver
yarn add @mateonunez/lyra-schema-resolver
pnpm add @mateonunez/lyra-schema-resolver

Usage

import { create, insert, search } from '@lyrasearch/lyra';
import resolveSchema from '.';
import * as fs from 'fs';

// You can parse data from any source, but we'll use a local file for this example
const data = JSON.parse(fs.readFileSync('./package.json').toString());
const schema = resolveSchema(data);
const db = create({ schema })

insert(db, data);

const results = search(db, {
  term: 'lyra'
});

console.log(results)

License

MIT