{"id":15724969,"url":"https://github.com/ecto/knife","last_synced_at":"2025-05-06T02:56:09.508Z","repository":{"id":138995762,"uuid":"2661911","full_name":"ecto/knife","owner":"ecto","description":"Parse shitty JSON!","archived":false,"fork":false,"pushed_at":"2011-10-28T00:17:22.000Z","size":92,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T02:56:05.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"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/ecto.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}},"created_at":"2011-10-27T23:11:02.000Z","updated_at":"2016-11-07T18:57:29.000Z","dependencies_parsed_at":"2023-03-23T15:36:43.395Z","dependency_job_id":null,"html_url":"https://github.com/ecto/knife","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/ecto%2Fknife","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Fknife/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Fknife/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Fknife/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecto","download_url":"https://codeload.github.com/ecto/knife/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252612465,"owners_count":21776254,"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-03T22:18:34.026Z","updated_at":"2025-05-06T02:56:09.448Z","avatar_url":"https://github.com/ecto.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# knife\n\nParse JSON that's smushed together\n\n![knife](http://i.imgur.com/ywYZ5.png)\n\n# why?\n\nImagine you have a TCP server that clients are sending JSON to. At fast paces, you can't know if the end of the message is actually the end of the JSON object.\n\nInstead of searching for a delimiter or control character, why not continually parse it?\n\n# install\n\n    npm install knife\n\n# example\n\n````javascript\n\nvar knife = require('knife');\n\nvar testObj = {\n  lol: 'wut'\n}\n\nvar goodJSON = JSON.stringify(testObj),\n    badJSON = goodJSON + goodJSON;\n\nconsole.log([\n  knife.parse(goodJSON),\n  knife.parse(badJSON)\n]);\n\n````\n\n# knife.parse(uglyStuff, debug = false)\n\nwill always return\n\n````javascript\n{\n  results: [ {}, {}, ... ],\n  remainder: ''\n}\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecto%2Fknife","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecto%2Fknife","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecto%2Fknife/lists"}