Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Latest commit 547fc97 Jul 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
.gitignore
README.md
package.json

README.md

GROQ-JS

GROQ-JS is a (work-in-progress) JavaScript implementation of GROQ which follows the official specification.

import {parse, evaluate} from 'groq-js'

let input = '*[_type == "user"]{name}'

// Returns an ESTree-inspired syntax tree
let tree = parse(input)

let documents = [
  {_type: "user", name: "Michael"},
  {_type: "company", name: "Bluth Company"}
]

// Evaluate a tree against a set of documents
let result = await evaluate(tree, {documents})

Table of contents:

Installation

GROQ-JS is currently not yet released on NPM.com, but you can install the development version from Git:

# NPM
npm i git+https://git@github.com/sanity-io/groq-js.git

# Yarn
yarn add git+https://git@github.com/sanity-io/groq-js.git

Versioning

GROQ-JS is currently not released.

License

MIT © Sanity.io

You can’t perform that action at this time.