{"id":17061947,"url":"https://github.com/brh55/file-to-objects","last_synced_at":"2026-05-19T03:07:33.140Z","repository":{"id":57235494,"uuid":"79482990","full_name":"brh55/file-to-objects","owner":"brh55","description":":page_facing_up: Parse a field delimited file, line-by-line, and return a JavaScript array containing parsed objects","archived":false,"fork":false,"pushed_at":"2017-01-27T05:34:19.000Z","size":74,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-28T22:50:17.182Z","etag":null,"topics":["delimited-files","parser"],"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/brh55.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}},"created_at":"2017-01-19T18:38:39.000Z","updated_at":"2017-04-12T20:48:53.000Z","dependencies_parsed_at":"2022-08-29T06:32:34.166Z","dependency_job_id":null,"html_url":"https://github.com/brh55/file-to-objects","commit_stats":null,"previous_names":["brh55/file-line-parser"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/brh55/file-to-objects","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brh55%2Ffile-to-objects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brh55%2Ffile-to-objects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brh55%2Ffile-to-objects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brh55%2Ffile-to-objects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brh55","download_url":"https://codeload.github.com/brh55/file-to-objects/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brh55%2Ffile-to-objects/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266738317,"owners_count":23976416,"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":["delimited-files","parser"],"created_at":"2024-10-14T10:48:45.927Z","updated_at":"2026-05-19T03:07:33.073Z","avatar_url":"https://github.com/brh55.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# file-to-objects [![Travis](https://img.shields.io/travis/brh55/file-to-objects.svg?style=flat-square)](https://travis-ci.org/brh55/file-to-objects) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg?style=flat-square)](https://github.com/sindresorhus/xo)\n\n\u003e Parse a property delimited file, line-by-line, and return the line in a JavaScript array in object representation.\n\u003e \n\u003e **fileToObjects(📄) =\u003e [ {}, {}, {} ]**\n\n## Install\n\n`$ npm install --save file-to-objects` **OR** `$ yarn add file-to-objects`\n\n## Usage\n```javascript\n// CATS_DATA.csv:\n// name,breed,age,color\n// Bubbles,Persian,24,honey-brown\n// Garfield,Tabby,33,orange with stripes\nconst fileToObjects = require('file-to-objects');\nconst input = './data/CATS_DATA.csv';\nfileToObjects(input)\n    .then(cats =\u003e {\n        console.log(cats[0])\n        // { name: 'Bubbles', breed: 'Persian', age: '24', color: 'honey-brown' }\n\n        console.log(cats[1])\n        // { name: 'Garfield', breed: 'Tabby', age: '33', color: 'orange with stripes' }\n    });\n```\n\n## API\n### fileToObjects(input[, options])\nReturn a `set` of parsed objects dictacted by sequence of keys\n\n#### input | [`\u003cstring\u003e`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)\nPath to file to be input.\n\n#### options | [`\u003cobject\u003e`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Normal_objects_and_functions)\n\n##### options.keys | [`\u003carray\u003e[\u003cstring\u003e | \u003cint\u003e]`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Indexed_collections_Arrays_and_typed_Arrays)\nAn array of keys to serve as a mapping for objects, this will override any column header to serve as a mapping for object creation.\n\n##### options.delimiter | [`\u003cstring\u003e`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)\nThe delimiter to used for parsing. `Default: \",\"`\n\n##### options.encoding | [`\u003cstring\u003e`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)\nThe encoding for reading the file. `Default: \"utf8\"`\n\n## Related\n:arrows_counterclockwise: [objects-to-file](https://github.com/brh55/objects-to-file) - Create a delimited value, output file from an array of objects.\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrh55%2Ffile-to-objects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrh55%2Ffile-to-objects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrh55%2Ffile-to-objects/lists"}