{"id":15845030,"url":"https://github.com/fabervitale/deno-ndjson","last_synced_at":"2026-02-08T15:31:15.086Z","repository":{"id":39920823,"uuid":"264619383","full_name":"FaberVitale/deno-ndjson","owner":"FaberVitale","description":"Read, write, parse and serialize new line delimited JSON in deno: http://ndjson.org/","archived":false,"fork":false,"pushed_at":"2022-05-21T11:32:35.000Z","size":40,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-19T22:52:55.172Z","etag":null,"topics":["deno","ndjson","parse","typescript"],"latest_commit_sha":null,"homepage":"","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/FaberVitale.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":"2020-05-17T08:47:55.000Z","updated_at":"2024-02-23T19:43:30.000Z","dependencies_parsed_at":"2022-09-21T04:42:29.736Z","dependency_job_id":null,"html_url":"https://github.com/FaberVitale/deno-ndjson","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/FaberVitale/deno-ndjson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaberVitale%2Fdeno-ndjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaberVitale%2Fdeno-ndjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaberVitale%2Fdeno-ndjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaberVitale%2Fdeno-ndjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FaberVitale","download_url":"https://codeload.github.com/FaberVitale/deno-ndjson/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaberVitale%2Fdeno-ndjson/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266753932,"owners_count":23979144,"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":["deno","ndjson","parse","typescript"],"created_at":"2024-10-05T17:41:40.324Z","updated_at":"2026-02-08T15:31:15.045Z","avatar_url":"https://github.com/FaberVitale.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deno-ndjson\n\n## Decription\n\nRead, write, parse and serialize newline delimited json, or\n[ndjson](http://ndjson.org/) for short.\n\n## Usage\n\n### parseNdjson\n\nParses the content of a\n[Deno.Reader](https://doc.deno.land/https/github.com/denoland/deno/releases/latest/download/lib.deno.d.ts#Deno.Reader).\n\nIgnores parsing errors if options.strict is `false`.\n\n```typescript\nasync function* parseNdjson\u003cT extends JSONData\u003e(\n  reader: Deno.Reader,\n  options?: { strict: boolean },\n): AsyncIterableIterator\u003cT\u003e;\n```\n\n#### example\n\n```typescript\nimport { parseNdjson } from \"https://deno.land/x/ndjson@1.1.0/mod.ts\";\n\nlet file: Deno.File | null = null;\n\ntry {\n  file = await Deno.open(\"\u003cfilepath_here\u003e\");\n\n  for await (const parsed of parseNdjson(file)) {\n    console.log(parsed);\n  }\n} catch (readError) {\n  // handle error\n} finally {\n  file?.close();\n}\n```\n\n[source](./lib/parse.ts)\n\n### readNdjson\n\nReads a Ndjson file and returns an array of parsed lines.\n\n```typescript\nasync function readNdjson\u003cT extends JSONData[]\u003e(filePath: string): Promise\u003cT\u003e;\n```\n\n#### example\n\n```typescript\nimport { readNdjson } from \"https://deno.land/x/ndjson@1.1.0/mod.ts\";\n\nconst parsed = await readNdjson(\"\u003cfile_path_here\u003e\");\n```\n\n[source](./lib/read.ts)\n\n### serializeNdJson\n\nSerializes the content of an array.\n\n```typescript\nfunction serializeNdJson(data: unknown[]): string;\n```\n\n#### example\n\n```typescript\nimport { serializeNdJson } from \"https://deno.land/x/ndjson@1.1.0/mod.ts\";\n\nconst serialized: string = serializeNdJson([\n  { who: \"let\" },\n  { the: \"dogs\" },\n  { out: \"!\" },\n]);\n```\n\n[source](./lib/serialize.ts)\n\n### writeNdjson\n\nWrites the content of an array to a file in ndjson format.\n\nOptional third argument is\n[Deno.WriteFileOptions](https://doc.deno.land/https/github.com/denoland/deno/releases/latest/download/lib.deno.d.ts#Deno.WriteFileOptions)\nand is passed down to the writer.\n\n```typescript\nasync function writeNdjson(\n  filePath: string,\n  data: unknown[],\n  options?: Deno.WriteFileOptions,\n): Promise\u003cvoid\u003e;\n```\n\n#### example\n\n```typescript\nimport { writeNdjson } from \"https://deno.land/x/ndjson@1.1.0/mod.ts\";\n\nconst toBeWritten = [\n  { message: \"qui\", level: \"info\", timestamp: \"2020-05-08T14:05:25.091Z\" },\n  { message: \"que\", level: \"info\", timestamp: \"2020-05-08T14:05:25.096Z\" },\n  { message: \"quod\", level: \"info\", timestamp: \"2020-05-08T14:05:25.104Z\" },\n];\n\nawait writeNdjson(\"\u003cfile_path_here\u003e\", toBeWritten, { append: true });\n```\n\n[source](./lib/write.ts)\n\n---\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabervitale%2Fdeno-ndjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabervitale%2Fdeno-ndjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabervitale%2Fdeno-ndjson/lists"}