1.3.4 • Published 3 days ago

mtgql v1.3.4

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
3 days ago

mtgql-js

magic: the gathering query language library, javascript edition

Installation

npm install --save mtgql

Usage

import { QueryRunner, Card, DataProvider, MemoryDataProvider } from "mtgql";

// often loaded from scryfall bulk data 
const cards: Card[] = [...];

const dataProvider: DataProvider = new MemoryDataProvider({
    cubes: [...],
    otags: [...],
    atags: [...],
    blocks: [...],
});

const queryRunner = new QueryRunner({ corpus: cards, dataProvider });

const result = await queryRunner.search("t:creature c:ur")
result
    .map((cards: EnrichedCard[]) => {
        // use cards as you see fit
    })
    .mapErr((err) => {
        // handle search errors
    })

Development

git clone git@github.com:dsoskey/mtgql-js.git
cd mtgql-js
# see package.json for build subcommands
npm run build
1.3.4

3 days ago

1.3.3

5 days ago

1.3.2

10 days ago

1.3.1

1 month ago

1.3.0

1 month ago

1.2.3

1 month ago

1.2.2

1 month ago

1.2.1

1 month ago

1.2.0

2 months ago

1.1.2

2 months ago

1.1.1

2 months ago

1.1.0

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago