{"id":27786303,"url":"https://github.com/clever/unix-sort","last_synced_at":"2026-03-13T14:32:21.560Z","repository":{"id":12308491,"uuid":"14941168","full_name":"Clever/unix-sort","owner":"Clever","description":"Sort large streams of JSON objects using the unix sort command.","archived":false,"fork":false,"pushed_at":"2024-09-23T15:35:02.000Z","size":29,"stargazers_count":12,"open_issues_count":3,"forks_count":2,"subscribers_count":65,"default_branch":"master","last_synced_at":"2025-06-24T21:46:23.173Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Clever.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-12-05T01:48:14.000Z","updated_at":"2024-09-23T15:35:06.000Z","dependencies_parsed_at":"2025-04-30T16:00:50.412Z","dependency_job_id":"2d7cd9e0-b09e-4c92-82f1-f043d0be213d","html_url":"https://github.com/Clever/unix-sort","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Clever/unix-sort","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clever%2Funix-sort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clever%2Funix-sort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clever%2Funix-sort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clever%2Funix-sort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Clever","download_url":"https://codeload.github.com/Clever/unix-sort/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clever%2Funix-sort/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266720011,"owners_count":23973876,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-04-30T15:59:17.324Z","updated_at":"2026-03-13T14:32:21.508Z","avatar_url":"https://github.com/Clever.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unix-sort\n\nSort streams of JSON objects using the unix sort command.\nThis allows sorting of very large data sets in a stream interface that Node normally can't handle due to memory constraints.\n\n## Install\n\n```\nnpm install unix-sort\n```\n\n## Usage\n\n`unix-sort` expects that you are streaming it JavaScript objects and takes a single argument:\nan array of all the keys you want to sort by, in order.\nIt assumes that all of the keys have a string value.\n\n## Examples\n\n*NOTE: The implementation of ArrayStream is left as an exercise to the reader*\n\n```javascript\nvar unix_sort = require('unix-sort');\n\nvar array = ['a', 'e', 'b', 'd', 'e', 'c'];\nvar objects = array.map(function (el) {return {item: el}});\n\nvar readable = new ArrayStream(objects);\nreadable.pipe(unix_sort(['item'])); // 'a', 'b', 'c', 'd', 'e', 'e'\n```\n\nNow for one a bit more complex:\n\n```javascript\nvar dogs = [\n    {\n        name: 'Toto',\n        owner: 'Dorothy'\n    },\n    {\n        name: 'Lassie',\n        owner: 'Alex',\n        notes: \"Owned by Timmy's brother after he died in the well\"\n    },\n    {\n        name: 'Lassie',\n        owner: 'Timmy'\n    },\n    {\n        name: 'Old Yeller',\n        owner: 'Travis Coates'\n    },\n    {\n        name: 'Balto',\n        owner: 'Gunnar Kaasen'\n    }\n];\n\nvar readable = new ArrayStream(dogs);\nreadable.pipe(unix_sort(['name', 'owner']));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclever%2Funix-sort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclever%2Funix-sort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclever%2Funix-sort/lists"}