{"id":18658057,"url":"https://github.com/m-avagyan/js-queries","last_synced_at":"2025-11-05T22:30:27.069Z","repository":{"id":64567380,"uuid":"576643413","full_name":"m-avagyan/js-queries","owner":"m-avagyan","description":"Queries for JavaScript Array manipulations.","archived":false,"fork":false,"pushed_at":"2023-10-15T09:23:26.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-27T17:17:47.527Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m-avagyan.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}},"created_at":"2022-12-10T14:07:06.000Z","updated_at":"2022-12-10T16:29:22.000Z","dependencies_parsed_at":"2024-11-07T07:44:36.172Z","dependency_job_id":null,"html_url":"https://github.com/m-avagyan/js-queries","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-avagyan%2Fjs-queries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-avagyan%2Fjs-queries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-avagyan%2Fjs-queries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-avagyan%2Fjs-queries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m-avagyan","download_url":"https://codeload.github.com/m-avagyan/js-queries/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239475961,"owners_count":19645041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-07T07:31:18.495Z","updated_at":"2025-11-05T22:30:27.025Z","avatar_url":"https://github.com/m-avagyan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# js-queries\n\nQueries for JavaScript Array manipulations.\n\n## Installation\n\n```bash\nnpm install js-queries --save\n```\n\nor\n\n```bash\nyarn add js-queries\n```\n\n## Usage\n\n- `find` - find an object from array\n\n```javascript\nimport jsq from \"js-queries\";\n// or\nimport { find } from \"js-queries\";\n\n// array -\u003e { [key: string]: any }[]\n// params -\u003e { [key: string]: any }\n\n// jsq.find(array, params)\n\nconst cars = [\n  { id: 1, color: \"black\" },\n  { id: 2, color: \"white\" },\n  { id: 3, color: \"red\" },\n];\n\nconst car = jsq.find(cars, { id: 2 }); // { id: 2, color: 'white' }\n```\n\n- `filter` - filter array of object with object property\n\n```javascript\nimport jsq from \"js-queries\";\n// or\nimport { filter } from \"js-queries\";\n\n// array -\u003e { [key: string]: any }[]\n// params -\u003e { [key: string]: any }\n\n// jsq.find(array, params)\n\nconst cars = [\n  { id: 1, color: \"black\" },\n  { id: 2, color: \"white\" },\n  { id: 3, color: \"red\" },\n];\n\nconst filteredCars = jsq.filter(cars, { id: 2 }); // // [{ id: 1, color: 'black' }, { id: 3, color: 'red' }]\n```\n\n- `unique` - remove duplicated elements from array\n\n```javascript\nimport jsq from \"js-queries\";\n// or\nimport { unique } from \"js-queries\";\n\n// array -\u003e any[]\n\n// jsq.unique(array)\n\nconst cars = [\n  { id: 1, color: \"black\" },\n  { id: 1, color: \"black\" },\n  { id: 2, color: \"red\" },\n];\n\nconst filteredCars = jsq.unique(cars); // [{ id: 1, color: 'black' }, { id: 2, color: 'red' }]\n```\n\n- `sort` - sort array of object with object property\n\n```javascript\nimport jsq from \"js-queries\";\n// or\nimport { sort } from \"js-queries\";\n\n// array -\u003e { [key: string]: any }[]\n// options -\u003e { key: string, orientation: 'bts' | 'stb' }\n\n// * orientation can be only 'bts' (big to small) or 'stb' (small to big) -\u003e default 'stb'\n\n// jsq.sort(array, options)\n\nconst cars = [\n  { id: 1, color: \"black\" },\n  { id: 2, color: \"white\" },\n  { id: 3, color: \"red\" },\n];\n\nconst sortedCars = jsq.sort(cars, { key: \"id\", orientation: \"bts\" }); // [{ id: 3, color: 'red' }, { id: 2, color: 'white' }, { id: 1, color: 'black' }]\n```\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n## Author\n\n**Martik Avagyan**\n\n- Website: [martikavagyan.com](https://martikavagyan.com)\n- Twitter: [@martikavagyan](https://twitter.com/martikavagyan)\n- GitHub: [@m-avagyan](https://github.com/m-avagyan)\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-avagyan%2Fjs-queries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm-avagyan%2Fjs-queries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-avagyan%2Fjs-queries/lists"}