Install the libary.
npm install tgr-wdn-query-lang
# or
yarn add tgr-wdn-query-lang
Use Query
and Filter
to parse or construct the query. Serialize the query into a string to send over the wire.
import { Query, Filter } from "tgr-wdn-query-lang";
let query = Query.parse("foo=hello");
query.filters.length; // 1
query.addFilter(new Filter("bar", "=", "world"));
query.toString() // "foo=hello bar=world"
# Run the test suites
npm run test
# Build the package
npm run build
As of this writing, we're publishing to https://www.npmjs.com. The API token is stored in tgr-tora.
This will likely change when we implement Horangi's private repository.
# Test & build
rm -Rf lib
npm run build
# Publish
npm config set '//registry.npmjs.org/:_authToken' "*****api-token****"
npm publish
# Unset it, so we don't leave it on the machine
npm config delete '//registry.npmjs.org/:_authToken'