npm.io
0.1.3 • Published 3 years ago

@mateonunez/lyra-schema-resolver

Licence
MIT
Version
0.1.3
Deps
1
Size
34 kB
Vulns
0
Weekly
0
Stars
5
DeprecatedThis package is deprecated

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

Keywords