{"id":18062851,"url":"https://github.com/stagas/fast-json-data","last_synced_at":"2025-06-13T17:35:26.470Z","repository":{"id":54345096,"uuid":"521469141","full_name":"stagas/fast-json-data","owner":"stagas","description":"Fast JSON data disk read/write.","archived":false,"fork":false,"pushed_at":"2022-08-09T04:47:46.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-11T19:45:47.833Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/stagas.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":"2022-08-05T01:48:15.000Z","updated_at":"2022-08-07T10:54:28.000Z","dependencies_parsed_at":"2022-08-13T12:40:48.899Z","dependency_job_id":null,"html_url":"https://github.com/stagas/fast-json-data","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"stagas/ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stagas%2Ffast-json-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stagas%2Ffast-json-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stagas%2Ffast-json-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stagas%2Ffast-json-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stagas","download_url":"https://codeload.github.com/stagas/fast-json-data/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247340031,"owners_count":20923175,"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":[],"created_at":"2024-10-31T05:08:42.718Z","updated_at":"2025-04-05T13:22:15.887Z","avatar_url":"https://github.com/stagas.png","language":"TypeScript","readme":"\u003ch1\u003e\nfast-json-data \u003ca href=\"https://npmjs.org/package/fast-json-data\"\u003e\u003cimg src=\"https://img.shields.io/badge/npm-v1.0.0-F00.svg?colorA=000\"/\u003e\u003c/a\u003e \u003ca href=\"src\"\u003e\u003cimg src=\"https://img.shields.io/badge/loc-119-FFF.svg?colorA=000\"/\u003e\u003c/a\u003e \u003ca href=\"https://cdn.jsdelivr.net/npm/fast-json-data@1.0.0/dist/fast-json-data.min.js\"\u003e\u003cimg src=\"https://img.shields.io/badge/brotli-603b-333.svg?colorA=000\"/\u003e\u003c/a\u003e \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-F0B.svg?colorA=000\"/\u003e\u003c/a\u003e\n\u003c/h1\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\nFast JSON data disk read/write.\n\n\u003ch4\u003e\n\u003ctable\u003e\u003ctr\u003e\u003ctd title=\"Triple click to select and copy paste\"\u003e\n\u003ccode\u003enpm i fast-json-data \u003c/code\u003e\n\u003c/td\u003e\u003ctd title=\"Triple click to select and copy paste\"\u003e\n\u003ccode\u003epnpm add fast-json-data \u003c/code\u003e\n\u003c/td\u003e\u003ctd title=\"Triple click to select and copy paste\"\u003e\n\u003ccode\u003eyarn add fast-json-data\u003c/code\u003e\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\u003c/h4\u003e\n\nEfficiently read and write well-formed JSON data to the disk. About x1.5-2 times as fast as JSON.parse/stringify.\n\n```ts\nimport { Literal, parse, stringify } from 'fast-json-data'\n\nconst schema = [[Literal, [\n  '_id',\n  '_rev',\n  'name',\n  'homepage',\n  ['versions', ['*', [\n    'name',\n    'gitHead',\n    ['os', [Literal]],\n    ['cpu', [Literal]],\n    ['engines', ['*']],\n    ['dist', [\n      'shasum',\n      'tarball',\n      'unpackedSize',\n    ]],\n    ['dependencies', [\n      '*',\n    ]],\n  ]]],\n\n  ['time', ['*']],\n]]]\n\n...\n\n// packumentCache is a Map\u003cstring, Packument\u003e\n\nawait fsp.writeFile(\n  options.packumentCachePath,\n  stringify(schema, [...packumentCache]),\n  'utf-8'\n)\n\n...\n\njson = parse(schema, await fsp.readFile(options.packumentCachePath, 'utf-8'))\n```\n\n## API\n\n\u003cp\u003e  \u003cdetails id=\"Literal$15\" title=\"Variable\" \u003e\u003csummary\u003e\u003cspan\u003e\u003ca href=\"#Literal$15\"\u003e#\u003c/a\u003e\u003c/span\u003e  \u003ccode\u003e\u003cstrong\u003eLiteral\u003c/strong\u003e\u003c/code\u003e  \u003cspan\u003e\u003cspan\u003e\u0026nbsp;=\u0026nbsp;\u003c/span\u003e  \u003ccode\u003e...\u003c/code\u003e\u003c/span\u003e  \u003c/summary\u003e  \u003ca href=\"src/fast-json-data.ts#L1\"\u003esrc/fast-json-data.ts#L1\u003c/a\u003e  \u003cul\u003e\u003cp\u003etypeof   \u003ca href=\"#Literal$15\"\u003eLiteral\u003c/a\u003e\u003c/p\u003e        \u003c/ul\u003e\u003c/details\u003e\u003cdetails id=\"parse$5\" title=\"Function\" \u003e\u003csummary\u003e\u003cspan\u003e\u003ca href=\"#parse$5\"\u003e#\u003c/a\u003e\u003c/span\u003e  \u003ccode\u003e\u003cstrong\u003eparse\u003c/strong\u003e\u003c/code\u003e\u003cem\u003e(schema, input)\u003c/em\u003e    \u003c/summary\u003e  \u003ca href=\"src/fast-json-data.ts#L62\"\u003esrc/fast-json-data.ts#L62\u003c/a\u003e  \u003cul\u003e    \u003cp\u003e    \u003cdetails id=\"schema$7\" title=\"Parameter\" \u003e\u003csummary\u003e\u003cspan\u003e\u003ca href=\"#schema$7\"\u003e#\u003c/a\u003e\u003c/span\u003e  \u003ccode\u003e\u003cstrong\u003eschema\u003c/strong\u003e\u003c/code\u003e    \u003c/summary\u003e    \u003cul\u003e\u003cp\u003eany\u003c/p\u003e        \u003c/ul\u003e\u003c/details\u003e\u003cdetails id=\"input$8\" title=\"Parameter\" \u003e\u003csummary\u003e\u003cspan\u003e\u003ca href=\"#input$8\"\u003e#\u003c/a\u003e\u003c/span\u003e  \u003ccode\u003e\u003cstrong\u003einput\u003c/strong\u003e\u003c/code\u003e    \u003c/summary\u003e    \u003cul\u003e\u003cp\u003estring\u003c/p\u003e        \u003c/ul\u003e\u003c/details\u003e  \u003cp\u003e\u003cstrong\u003eparse\u003c/strong\u003e\u003cem\u003e(schema, input)\u003c/em\u003e  \u0026nbsp;=\u0026gt;  \u003cul\u003eany\u003c/ul\u003e\u003c/p\u003e\u003c/p\u003e    \u003c/ul\u003e\u003c/details\u003e\u003cdetails id=\"parseLines$9\" title=\"Function\" \u003e\u003csummary\u003e\u003cspan\u003e\u003ca href=\"#parseLines$9\"\u003e#\u003c/a\u003e\u003c/span\u003e  \u003ccode\u003e\u003cstrong\u003eparseLines\u003c/strong\u003e\u003c/code\u003e\u003cem\u003e(schema, input)\u003c/em\u003e    \u003c/summary\u003e  \u003ca href=\"src/fast-json-data.ts#L66\"\u003esrc/fast-json-data.ts#L66\u003c/a\u003e  \u003cul\u003e    \u003cp\u003e    \u003cdetails id=\"schema$11\" title=\"Parameter\" \u003e\u003csummary\u003e\u003cspan\u003e\u003ca href=\"#schema$11\"\u003e#\u003c/a\u003e\u003c/span\u003e  \u003ccode\u003e\u003cstrong\u003eschema\u003c/strong\u003e\u003c/code\u003e    \u003c/summary\u003e    \u003cul\u003e\u003cp\u003eany\u003c/p\u003e        \u003c/ul\u003e\u003c/details\u003e\u003cdetails id=\"input$12\" title=\"Parameter\" \u003e\u003csummary\u003e\u003cspan\u003e\u003ca href=\"#input$12\"\u003e#\u003c/a\u003e\u003c/span\u003e  \u003ccode\u003e\u003cstrong\u003einput\u003c/strong\u003e\u003c/code\u003e    \u003c/summary\u003e    \u003cul\u003e\u003cp\u003estring  [] \u0026amp; {\u003cp\u003e  \u003cdetails id=\"index$14\" title=\"Property\" \u003e\u003csummary\u003e\u003cspan\u003e\u003ca href=\"#index$14\"\u003e#\u003c/a\u003e\u003c/span\u003e  \u003ccode\u003e\u003cstrong\u003eindex\u003c/strong\u003e\u003c/code\u003e    \u003c/summary\u003e  \u003ca href=\"src/fast-json-data.ts#L66\"\u003esrc/fast-json-data.ts#L66\u003c/a\u003e  \u003cul\u003e\u003cp\u003enumber\u003c/p\u003e        \u003c/ul\u003e\u003c/details\u003e\u003c/p\u003e}\u003c/p\u003e        \u003c/ul\u003e\u003c/details\u003e  \u003cp\u003e\u003cstrong\u003eparseLines\u003c/strong\u003e\u003cem\u003e(schema, input)\u003c/em\u003e  \u0026nbsp;=\u0026gt;  \u003cul\u003eany\u003c/ul\u003e\u003c/p\u003e\u003c/p\u003e    \u003c/ul\u003e\u003c/details\u003e\u003cdetails id=\"stringify$1\" title=\"Function\" \u003e\u003csummary\u003e\u003cspan\u003e\u003ca href=\"#stringify$1\"\u003e#\u003c/a\u003e\u003c/span\u003e  \u003ccode\u003e\u003cstrong\u003estringify\u003c/strong\u003e\u003c/code\u003e\u003cem\u003e(schema, input)\u003c/em\u003e    \u003c/summary\u003e  \u003ca href=\"src/fast-json-data.ts#L3\"\u003esrc/fast-json-data.ts#L3\u003c/a\u003e  \u003cul\u003e    \u003cp\u003e    \u003cdetails id=\"schema$3\" title=\"Parameter\" \u003e\u003csummary\u003e\u003cspan\u003e\u003ca href=\"#schema$3\"\u003e#\u003c/a\u003e\u003c/span\u003e  \u003ccode\u003e\u003cstrong\u003eschema\u003c/strong\u003e\u003c/code\u003e    \u003c/summary\u003e    \u003cul\u003e\u003cp\u003eany\u003c/p\u003e        \u003c/ul\u003e\u003c/details\u003e\u003cdetails id=\"input$4\" title=\"Parameter\" \u003e\u003csummary\u003e\u003cspan\u003e\u003ca href=\"#input$4\"\u003e#\u003c/a\u003e\u003c/span\u003e  \u003ccode\u003e\u003cstrong\u003einput\u003c/strong\u003e\u003c/code\u003e    \u003c/summary\u003e    \u003cul\u003e\u003cp\u003eany\u003c/p\u003e        \u003c/ul\u003e\u003c/details\u003e  \u003cp\u003e\u003cstrong\u003estringify\u003c/strong\u003e\u003cem\u003e(schema, input)\u003c/em\u003e  \u0026nbsp;=\u0026gt;  \u003cul\u003estring\u003c/ul\u003e\u003c/p\u003e\u003c/p\u003e    \u003c/ul\u003e\u003c/details\u003e\u003c/p\u003e\n\n## Contributing\n\n[Fork](https://github.com/stagas/fast-json-data/fork) or [edit](https://github.dev/stagas/fast-json-data) and submit a PR.\n\nAll contributions are welcome!\n\n## License\n\n\u003ca href=\"LICENSE\"\u003eMIT\u003c/a\u003e \u0026copy; 2022 [stagas](https://github.com/stagas)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstagas%2Ffast-json-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstagas%2Ffast-json-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstagas%2Ffast-json-data/lists"}