{"id":22480357,"url":"https://github.com/planemad/lookup-csv","last_synced_at":"2025-03-27T18:41:42.610Z","repository":{"id":143887544,"uuid":"185059550","full_name":"planemad/lookup-csv","owner":"planemad","description":"A node module to quickly search and lookup rows from a csv file","archived":false,"fork":false,"pushed_at":"2020-02-13T19:18:21.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-02T05:32:10.487Z","etag":null,"topics":["csv","csv-json","lookup","lookup-rows"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/planemad.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":"2019-05-05T17:05:30.000Z","updated_at":"2020-02-13T19:19:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"ec9ddb35-915b-4488-9474-610246fb7c91","html_url":"https://github.com/planemad/lookup-csv","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/planemad%2Flookup-csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planemad%2Flookup-csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planemad%2Flookup-csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planemad%2Flookup-csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/planemad","download_url":"https://codeload.github.com/planemad/lookup-csv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245904882,"owners_count":20691687,"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":["csv","csv-json","lookup","lookup-rows"],"created_at":"2024-12-06T15:24:09.752Z","updated_at":"2025-03-27T18:41:42.604Z","avatar_url":"https://github.com/planemad.png","language":"JavaScript","readme":"# lookup-csv\nA node module to quickly search and lookup rows from a CSV file using a JSON API.\n\nAn input CSV file is converted to an array of JSON objects using [treeize](https://www.npmjs.com/package/treeize). This is used to build a lookup table by specifying a coumn name as an index using [hasharray](https://www.npmjs.com/package/hasharray).\n\n### Installation\n\nInstall module `npm i lookup-csv`\n\n### Simple usage\n\nFor a given data.csv, ensure the first row contains the column names. Adding a `.` delimiter in the column names will nest the property in the JSON result\n\n```csv\nanimal,type,sound.type,sound.pitch\ncow,mammal,moo-moo,low\nswiss cow,mammal,moo-moo,low\ncrow,bird,kaa-kaa,high\ndonkey,mammal,yee-haw,low\n```\n\n**Search a single column**\n\n```js\nconst lookupCSV = require('lookup-csv');\n\n// Create a lookup table using lookup column name to use from the csv data\nconst lookupTable = lookupCSV('./path/to/data.csv', 'animal')\n\n// Get rows matching lookup value\nmatchingRows = lookupTable.get('cow')\n// {\n//     animal: 'cow',\n//     type: 'mammal',\n//     sound: {\n//          type: 'moo-moo',\n//          pitch: 'low'\n//     }\n// }\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanemad%2Flookup-csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplanemad%2Flookup-csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanemad%2Flookup-csv/lists"}