{"id":20936221,"url":"https://github.com/adzerk/zerkel","last_synced_at":"2026-03-07T18:04:15.598Z","repository":{"id":9197174,"uuid":"11004247","full_name":"adzerk/zerkel","owner":"adzerk","description":"An adzerk-based query-ish language.","archived":false,"fork":false,"pushed_at":"2025-08-25T18:10:58.000Z","size":413,"stargazers_count":14,"open_issues_count":0,"forks_count":3,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-09-27T07:25:34.356Z","etag":null,"topics":["library","management","prod"],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"fisharebest/webtrees","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adzerk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-06-27T18:14:09.000Z","updated_at":"2025-08-25T16:15:59.000Z","dependencies_parsed_at":"2025-05-01T09:27:10.850Z","dependency_job_id":"e27039ef-3aeb-410a-9928-68c3f7dd8446","html_url":"https://github.com/adzerk/zerkel","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/adzerk/zerkel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzerk%2Fzerkel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzerk%2Fzerkel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzerk%2Fzerkel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzerk%2Fzerkel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adzerk","download_url":"https://codeload.github.com/adzerk/zerkel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzerk%2Fzerkel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30225456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T17:00:40.062Z","status":"ssl_error","status_checked_at":"2026-03-07T17:00:39.026Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library","management","prod"],"created_at":"2024-11-18T22:18:24.870Z","updated_at":"2026-03-07T18:04:15.583Z","avatar_url":"https://github.com/adzerk.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zerkel [![Build Status](https://travis-ci.org/adzerk/zerkel.png?branch=master)](https://travis-ci.org/adzerk/zerkel)\n\nThe Adzerk custom targeting query language.\n\n### Language\n\nZerkel provides primitive integer and string literals, identifiers, sets, and a\nselection of boolean operators:\n\n| operator/type     | comment                     | examples   |\n|-------------------|-----------------------------|------------|\n| *integers*        | syntax                      | `42`, `-7` |\n| *strings*         | syntax                      | `\"foo\"`, `\"C:\\\\\\\\Windows\\\\System32\"`, `\"^(foo\\|bar)\\s+\"` |\n| *variables*       | syntax                      | `count`, `_foo_bar`, `$location.postalCode` |\n| **`.`**           | property accessor           | `$location.postalCode`, `foo.bar.baz` |\n| **`[`**, **`]`**  | set construction            | `[42, \"foo\"]` |\n| **`(`**, **`)`**  | expression grouping         | `x \u003c 100 AND (y \u003c 50 OR z \u003c 10)` |\n| **`=`**           | equality                    | `foo = 42` |\n| **`\u003c\u003e`**          | not equal                   | `foo \u003c\u003e \"bar\"` |\n| **`=~`**          | regex match                 | `foo =~ \"^(some\\|regular\\|expression).*$\"` |\n| **`!~`**          | not regex match             | `foo !~ \"^(some\\|regular\\|expression).*$\"` |\n| **`\u003e`**           |                             | `foo \u003e 42` |\n| **`\u003c`**           |                             | `foo \u003c 42` |\n| **`\u003e=`**          |                             | `foo \u003e= 42` |\n| **`\u003c=`**          |                             | `foo \u003c= 42` |\n| **`AND`**         |                             | `foo = 42 AND bar \u003c 100` |\n| **`OR`**          |                             | `foo = 42 OR bar \u003c 100` |\n| **`NOT`**         |                             | `NOT (bar =~ \"^foo\")` |\n| **`LIKE`**        | wildcard match              | `foo LIKE \"ba*\"` |\n| **`CONTAINS`**    | set membership / substring  | `[\"foo\", \"bar\"] CONTAINS \"foo\"`, `\"foobar\" CONTAINS \"foo\"` |\n\nThus, queries may be written like:\n\n```sql\ncount \u003e 43 and (user = \"bob\" or user = \"alice\")\nkeywords contains \"awesome\"\n```\n\nAll operators are available in upper and lowercase forms.\n\n### Demo\n\nCheck out the live [Zerkel scratchpad][demo] demo app and try some zerkel\nqueries in your browser.\n\n### Usage\n\nQueries can executed in coffeescript/javascript using the zerkel module, like so:\n\n```coffeescript\nzerkel = require 'zerkel'\n\nquery = 'count \u003e 43 and (user = \"bob\" or user = \"alice\")'\nmatchFn = zerkel.compile query\nmatchFn {count: 50, user: 'bob'} # true\nmatchFn {count: 12, user: 'alice'} # false\nmatchFn {count: 50, user: 'george'} # false\n```\n\nYou can also access properties on passed in objects, like so:\n\n```coffeescript\nzerkel = require 'zerkel'\n\nquery = 'user.location = \"open field west of a white house\"'\nmatchFn = zerkel.compile query\nmatchFn {user: {name: 'bob', location: 'open field west of a white house'}} # true\nmatchFn {user: {name: 'alice', location: 'middle earth'}} # false\n```\n\n## Clientside\n\nPrecompiled a Zerkel queries can be evaluated in a browser client, as well.\n\nIn NodeJS:\n\n```coffeescript\nzerkel = require 'zerkel'\n\nprecompiled = zerkel.parser.parse 'count \u003e 43 and [\"bob\", \"alice\"] contains user'\n```\n\nIn the client:\n\n```html\n\u003cscript src=\"dist/zerkel-runtime.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nvar precompiled = '...'; // The precompiled query from NodeJS above.\nvar predicateFn = zerkelRuntime.makePredicate(precompiled);\nvar result      = predicateFn({count: 50, user: 'bob'});\n\u003c/script\u003e\n```\n\n\u003e **Note:** The clientside Zerkel runtime does not support gzip.\n\n### Gzip\n\nSet the `parser.MIN_GZIP_SIZE` to a number, and if the length of the compiled\nJavaScript is greater than that it will be gzipped and base64 encoded, with\n`GZ:` prepended. The `zerkel#makePredicate` function will unzip automatically\nas necessary.\n\n```coffeescript\nparser = require 'zerkel-parser'\n\nparser.MIN_GZIP_SIZE = 50\nparser.parse 'foo = 42'              # _helpers['getIn'](_env, 'foo')==42'\nparser.parse '[42, 43] contains foo' # GZ:H4sIAAAAAAAAA9OINjHSMTGOVVODMvQy81JSK/zTNOIzUnMKUouKo9XTU0s889RjNeJT88p0FNTT8vPVNTUV7GwVDDQBm8CsuD8AAAA=\n```\n\n### Development\n\nPrereqs:\n\n`npm install`\n\nTo test:\n\n`make test`\n\nTo package:\n\n`make`\n\n### License\n\nCopyright © 2021 Kevel, Inc.\nDistributed under the [Apache License, Version 2.0][apache].\n\n[apache]: https://www.apache.org/licenses/LICENSE-2.0\n[demo]: https://adzerk.github.io/zerkel/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadzerk%2Fzerkel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadzerk%2Fzerkel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadzerk%2Fzerkel/lists"}