{"_id":"@auphof/uql","name":"@auphof/uql","dist-tags":{"latest":"0.0.30"},"versions":{"0.0.30":{"name":"@auphof/uql","version":"0.0.30","description":"UQL - Unstructured Query Language - modified for multiline jsonata","author":{"name":"Sriramajeyam Sugumaran"},"license":"Apache-2.0","main":"dist/index.js","scripts":{"spellcheck":"cspell -c cspell.config.json \"**/*.{ts,tsx,js,go,md,mdx,yml,yaml,json,scss,css}\"","lint":"yarn spellcheck","compile":"nearleyc src/grammar/grammar.ne -o src/grammar/grammar.ts && tsc","test":"yarn lint && yarn compile && jest","build":"rm -rf dist && yarn test --coverage"},"keywords":[],"bugs":{"url":"https://github.com/yesoreyeram/uql/issues"},"homepage":"https://github.com/yesoreyeram/uql#readme","dependencies":{"csv-parse":"4.12.0","dayjs":"^1.10.7","fast-xml-parser":"^4.0.0-beta.8","js-yaml":"^4.1.0","jsonata":"^1.8.6","lodash":"^4.17.21","moo":"^0.5.1","nearley":"^2.20.1","xml2js":"0.4.23"},"devDependencies":{"@types/jest":"^27.0.3","@types/js-yaml":"^4.0.5","@types/lodash":"^4.14.177","@types/moo":"^0.5.5","@types/nearley":"^2.11.2","@types/xml2js":"^0.4.9","cspell":"^5.19.7","jest":"^27.4.3","ts-jest":"^27.0.7","typescript":"^4.5.2"},"types":"./dist/index.d.ts","gitHead":"fd50159e2370cf93b7386979201c692d5f60c38a","_id":"@auphof/uql@0.0.30","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-KVyKkJk1GIPXEsegVERArRDZkXea+WqhAe9I5bcGZWqbzm3GGy1U+6Js9Lc4LV2gdPlyJX+ocVgR5CtJ+ygBJw==","shasum":"11b30eca1710862396917a843c2b112964f1b16a","tarball":"https://registry.npmjs.org/@auphof/uql/-/uql-0.0.30.tgz","fileCount":72,"unpackedSize":150484,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFx/lxzI8N77RBoJdqGhqZtcMMToS+Ns8tB9I1GSlR2LAiBYJSoXVw4YnoXJsbCKv45H857PDMwE+ze+mNBM85YWbg=="}]},"_npmUser":{"name":"auphof","email":"auphof@gmail.com"},"directories":{},"maintainers":[{"name":"auphof","email":"auphof@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uql_0.0.30_1692686206737_0.20362214944728363"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-22T06:36:46.664Z","0.0.30":"2023-08-22T06:36:46.892Z","modified":"2023-08-22T06:36:47.158Z"},"maintainers":[{"name":"auphof","email":"auphof@gmail.com"}],"description":"UQL - Unstructured Query Language - modified for multiline jsonata","homepage":"https://github.com/yesoreyeram/uql#readme","keywords":[],"author":{"name":"Sriramajeyam Sugumaran"},"bugs":{"url":"https://github.com/yesoreyeram/uql/issues"},"license":"Apache-2.0","readme":"# UQL - Unstructured Query Language\n\nUnstructured query language (UQL) - It is a query language to query the JSON like data in Javascript. Inspired by azure Kusto query language (KQL).\n\n## Installation\n\nInstall the UQL from npm/yarn\n\n```sh\nnpm install uql\n## or\nyarn add uql\n```\n\nThen in your code use this as follows\n\n```ts\nimport { uql } from \"uql\";\nconst users = [\n  { name: \"foo\", age: 2, location: \"uk\" },\n  { name: \"bar\", age: 3, location: \"usa\" },\n];\nconst query = `order by \"name\" asc | project \"name\", \"location\"`;\nuql(query, { data: users })\n  .then((res) => console.log(res))\n  .catch((ex) => console.error(ex));\n//\n// Output\n//\n// [ { name: 'bar', location: 'usa' }, { name: 'foo', location: 'uk' } ]\n```\n\n## Commands\n\n### ping\n\nA very simple `ping` query will respond you with `pong`.\n\n### echo\n\nA very simple `echo` query will echo what you said. Example: A query `echo \"hello world\"` will print `hello world`.\n\n### count\n\nAs the name suggests, `count` query will give you the length of an array. For example, the input `[{},{}]` and then the query `count` will respond with `2`\n\n### limit\n\nThe `limit` query, return up to the specified number of rows in an array like object. For example, the input `[1,2,3]` and then the query `limit 2` will respond with `[1,2]`\n\nlimit query expects one mandatory argument which have to be a number\n\n### order by\n\nThe `order by` query, sorts the items in the array into order by one or more columns. For example: `order by \"name\" asc` will order the input array by a field \"name\".\n\nNote: field name should be referred by single quote and the order must be one of \"asc\" or \"desc\"\n\n### project\n\nThe `project` query, limits the field you want to return from the array of objects.\n\nExample:\n\nWith `[ { name: \"foo\", age: 1, country: \"uk\" }, { name: \"bar\", age :2, country: \"usa\" }]`, the query `project \"name\", \"age\"` will only return name and age properties of each element.\n\nNote: field name should be referred by single quote.\n\n### project-away\n\nThe `project-away` query is opposite of `project` query. It omits the specified properties.\n\nExample:\n\nWith `[ { name: \"foo\", age: 1, country: \"uk\" }, { name: \"bar\", age :2, country: \"usa\" }]`, the query `project-away \"country\", \"age\"` will only return name property of each element.\n\nNote: field name should be referred by single quote.\n","readmeFilename":"README.md"}