https://github.com/muze-nl/jaqt Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + GitHub Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions By size + Enterprise + Teams + Startups By industry + Healthcare + Financial services + Manufacturing By use case + CI/CD & Automation + DevOps + DevSecOps * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} muze-nl / jaqt Public * Notifications You must be signed in to change notification settings * Fork 5 * Star 115 GraphQL-style Array.select() and Array.where() for javascript License MIT license 115 stars 5 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 2 * Pull requests 0 * Discussions * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Discussions * Actions * Projects * Security * Insights muze-nl/jaqt This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Name Name Last commit message Last commit date Latest commit History 99 Commits docs docs repl repl src src test test .eslintrc.cjs .eslintrc.cjs .gitignore .gitignore LICENSE LICENSE README.md README.md package.json package.json View all files Repository files navigation * README * MIT license GitHub License GitHub package.json version NPM Version npm bundle size jaqt: javascript queries and transformations jaqt (pronounced 'jacket') is a query engine for arrays and objects, inspired by graphql and sql. e.g: Javascript Query Result from(data.people) [ .select({ { metrics: { "metrics": { hair_color: _ "hair_color": "blond" }, }, lastName:_ "lastName": "Skywalker" }) }, { "metrics": { "hair_color": "none" }, "lastName": "Vader" } ] Table of Contents 1. Background 2. Quickstart 3. Usage 4. User Manual 5. Reference 6. Contributions 7. License Background There are many libraries that add a kind of query language to javascript arrays. GraphQL is one of those. But all the libraries I have found add a custom query language. Either by adding specific functions that mimic SQL, or by explicitly defining a query language like GraphQL. In all cases this means that you give up the power of javascript itself and must switch to a different, less capable language. So this library is explicitly not a query language itself, but it uses some javascript trickery to add some syntactic sugar to the native Array.map and Array.filter functions so that you can get most of the ease of use of something like GraphQL, while staying squarely in javascript country. There are no speed improvements or indexes over normal Array.filter and Array.map. Usage The examples below all use the data below: let data = JSON.parse(`[ { name: "John", lastName: "Doe", friends: [ "Jane" ] }, { name: "Jane", lastName: "Doe", friends: [ "John" ] } ]`) And this is how you can use this library: import {from, _} from 'jaqt' from(data) .where({ friends: 'John' }) .select({ name: o => o.name+' '+o.lastName }) Which results in: [ { name: 'Jane Doe'} ] Documentation * The Developers Manual will guide you on how to get started and how to use JAQT. * The Reference explains all the parts in detail. Contributions Contributions are welcome. Please fork the github repository and make your changes there, then open a pull request. If you find any bugs or other issues, please use the github repository Issues. Check if your issue has already been posted before you add a new issue. The github repository is at https://github.com/muze-nl/jaqt License This software is licensed under MIT open source license. See the License file. About GraphQL-style Array.select() and Array.where() for javascript Resources Readme License MIT license Activity Custom properties Stars 115 stars Watchers 2 watching Forks 5 forks Report repository Releases 2 Stable API (groupBy and reduce) Latest Sep 5, 2024 + 1 release Packages 0 No packages published Contributors 2 * @poef poef Auke van Slooten * @Potherca Potherca Ben Peachey Languages * JavaScript 100.0% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.