{"id":20797198,"url":"https://github.com/daniguardiola/node-line-by-line","last_synced_at":"2026-04-21T15:35:39.394Z","repository":{"id":85105186,"uuid":"280971915","full_name":"DaniGuardiola/node-line-by-line","owner":"DaniGuardiola","description":"🔬 Experiment: reading files line-by-line in Node.js","archived":false,"fork":false,"pushed_at":"2020-07-20T23:08:43.000Z","size":20867,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T01:49:00.591Z","etag":null,"topics":["experiment","filesystem","javascript","nodejs","streams"],"latest_commit_sha":null,"homepage":"https://daniguardiola.me/blog/reading-a-file-line-by-line-in-node","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DaniGuardiola.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-07-19T23:56:56.000Z","updated_at":"2020-07-20T23:08:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"0fb13727-0dd5-42af-be73-b0aa3763d698","html_url":"https://github.com/DaniGuardiola/node-line-by-line","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DaniGuardiola/node-line-by-line","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaniGuardiola%2Fnode-line-by-line","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaniGuardiola%2Fnode-line-by-line/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaniGuardiola%2Fnode-line-by-line/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaniGuardiola%2Fnode-line-by-line/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DaniGuardiola","download_url":"https://codeload.github.com/DaniGuardiola/node-line-by-line/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaniGuardiola%2Fnode-line-by-line/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32098144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["experiment","filesystem","javascript","nodejs","streams"],"created_at":"2024-11-17T16:32:55.219Z","updated_at":"2026-04-21T15:35:39.376Z","avatar_url":"https://github.com/DaniGuardiola.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node line-by-line experiment\n\nThis is a small experiment with reading files line-by-line in Node.js (JavaScript), in which I compare the speed and memory footprint of different approaches to reading and processing large files line-by-line.\n\nMake sure to read my article about it:\n\n- [Reading a file line-by-line in node](https://daniguardiola.me/blog/reading-a-file-line-by-line-in-node)\n\nThe most relevant code can be found in the [`password_checkers.js`](password_checkers.js) file.\n\n## Setup\n\nYou will need a recent version of Node.js, and bash if you want to run the `run_all.sh` script.\n\nInstall the dependencies:\n\n```bash\ncd /path/to/node-line-by-line\nyarn\n# or npm\nnpm i\n```\n\n## Usage\n\n### Run all tests\n\n```bash\n# with yarn\nyarn all 'password'\n# with npm\nnpm run all 'password'\n# directly with bash\n./run_all.sh 'password'\n```\n\n### Run a specific test\n\n```bash\n# with yarn\nyarn whole_file 'password'\n# with npm\nnpm run whole_file 'password'\n# directly with node\nnode password_checker_whole_file.js 'password'\n```\n\nThe string 'whole file' can be replaced with any other method. Check the files or the `package.json` file to see the other available methods.\n\n### Options\n\nYou can specify the chunk size (for stream-based methods) in kilobytes by passing a second argument to any of the commands above. The default is 64kb. For example:\n\n```bash\nyarn read_stream '12345' 8\nnpm run readline 'letmein' 128\n./run_all 'hey' 32\nnode password_checker_line_reader.js 'pass' 4\n```\n\n## Important files\n\n```bash\n# source code of the methods\npassword_checkers.js\n# helpers for calling the methods from CLI\npassword_checker_whole_file.js\npassword_checker_read_stream.js\npassword_checker_readline.js\npassword_checker_line_reader.js\n# CLI runner\ncli.js\n# script that runs all methods\nrun_all.sh\n# file with all the passwords\nxato-net-10-million-passwords.txt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniguardiola%2Fnode-line-by-line","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniguardiola%2Fnode-line-by-line","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniguardiola%2Fnode-line-by-line/lists"}