{"_id":"extract-first-json","_rev":"203959","name":"extract-first-json","description":"Extract the first JSON object or array from a string","dist-tags":{"latest":"2.0.2"},"maintainers":[{"name":"bconnorwhite","email":""},{"name":"npm:bconnorwhite","email":""}],"time":{"modified":"2023-03-21T13:34:56.000Z","created":"2020-09-20T16:58:23.380Z","2.0.2":"2023-01-30T00:19:31.192Z","2.0.1":"2023-01-30T00:17:11.448Z","2.0.0":"2023-01-30T00:15:01.492Z","1.0.1":"2020-09-20T17:54:33.701Z","1.0.0":"2020-09-20T16:58:23.380Z"},"users":{},"author":{"name":"Connor White"},"repository":{"type":"git","url":"git+https://github.com/bconnorwhite/extract-first-json.git"},"versions":{"2.0.2":{"name":"extract-first-json","version":"2.0.2","description":"Extract the first JSON object or array from a string","license":"MIT","private":false,"author":{"name":"Connor White"},"contributors":[{"name":"Connor White"}],"homepage":"https://connorwhite.dev/github/extract-first-json","repository":{"type":"git","url":"git+https://github.com/bconnorwhite/extract-first-json.git"},"bugs":{"url":"https://github.com/bconnorwhite/extract-first-json/issues"},"keywords":["extract","json","object","array","from","string"],"type":"module","main":".auto/build/index.js","exports":"./.auto/build/index.js","types":".auto/build/index.d.ts","engines":{"node":"^14.13.1 || >=16.0.0"},"scripts":{"build":"auto build","dev":"auto dev","lint":"auto lint","prepack":"yarn build","release":"auto release","test":"auto test","typecheck":"auto typecheck"},"dependencies":{"parse-json-object":"^3.0.1","reduce-first":"^2.0.0"},"devDependencies":{"autorepo":"^0.1.9"},"eslintConfig":{"extends":"@autosoft/eslint-config"},"jest":{"preset":"@autosoft/jest-preset"},"npmpackagejsonlint":{"extends":"npm-package-json-lint-config-auto"},"_id":"extract-first-json@2.0.2","dist":{"shasum":"1001274b5ebd1255aaea9f8f5ca369db0e90aff7","size":2319,"noattachment":false,"key":"/extract-first-json/-/extract-first-json-2.0.2.tgz","tarball":"http://name.csiicloud.com:7001/extract-first-json/download/extract-first-json-2.0.2.tgz"},"_npmUser":{"name":"bconnorwhite","email":"connor.bcw@gmail.com"},"directories":{},"maintainers":[{"name":"bconnorwhite","email":""},{"name":"npm:bconnorwhite","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/extract-first-json_2.0.2_1675037970990_0.06603256344545105"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-30T00:19:31.192Z","publish_time":1675037971192,"_cnpm_publish_time":1675037971192},"2.0.1":{"name":"extract-first-json","version":"2.0.1","description":"Extract the first JSON object or array from a string","license":"MIT","private":false,"author":{"name":"Connor White"},"contributors":[{"name":"Connor White"}],"homepage":"https://connorwhite.dev/github/extract-first-json","repository":{"type":"git","url":"git+https://github.com/bconnorwhite/extract-first-json.git"},"bugs":{"url":"https://github.com/bconnorwhite/extract-first-json/issues"},"keywords":["extract","json","object","array","from","string"],"type":"module","main":".auto/build/index.js","exports":"./.auto/build/index.js","types":".auto/build/index.d.ts","engines":{"node":"^14.13.1 || >=16.0.0"},"scripts":{"build":"auto build","dev":"auto dev","lint":"auto lint","prepack":"yarn build","release":"auto release","test":"auto test","typecheck":"auto typecheck"},"dependencies":{"parse-json-object":"^3.0.1","reduce-first":"^2.0.0","types-json":"^4.0.0"},"devDependencies":{"autorepo":"^0.1.9"},"eslintConfig":{"extends":"@autosoft/eslint-config"},"jest":{"preset":"@autosoft/jest-preset"},"npmpackagejsonlint":{"extends":"npm-package-json-lint-config-auto"},"_id":"extract-first-json@2.0.1","dist":{"shasum":"1141c7adcca55f0718af41854d5d5b4e68eb55ad","size":2254,"noattachment":false,"key":"/extract-first-json/-/extract-first-json-2.0.1.tgz","tarball":"http://name.csiicloud.com:7001/extract-first-json/download/extract-first-json-2.0.1.tgz"},"_npmUser":{"name":"bconnorwhite","email":"connor.bcw@gmail.com"},"directories":{},"maintainers":[{"name":"bconnorwhite","email":""},{"name":"npm:bconnorwhite","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/extract-first-json_2.0.1_1675037831280_0.8890247441816992"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-30T00:17:11.448Z","publish_time":1675037831448,"_cnpm_publish_time":1675037831448},"2.0.0":{"name":"extract-first-json","version":"2.0.0","description":"Extract the first JSON object or array from a string","license":"MIT","private":false,"author":{"name":"Connor White"},"contributors":[{"name":"Connor White"}],"homepage":"https://connorwhite.dev/github/extract-first-json","repository":{"type":"git","url":"git+https://github.com/bconnorwhite/extract-first-json.git"},"bugs":{"url":"https://github.com/bconnorwhite/extract-first-json/issues"},"keywords":["extract","json","object","array","from","string"],"type":"module","main":".auto/build/index.js","exports":"./.auto/build/index.js","types":".auto/build/index.d.ts","engines":{"node":"^14.13.1 || >=16.0.0"},"scripts":{"build":"auto build","dev":"auto dev","lint":"auto lint","prepack":"yarn build","release":"auto release","test":"auto test","typecheck":"auto typecheck"},"dependencies":{"parse-json-object":"^3.0.1","reduce-first":"^2.0.0","types-json":"^4.0.0"},"devDependencies":{"autorepo":"^0.1.9"},"eslintConfig":{"extends":"@autosoft/eslint-config"},"jest":{"preset":"@autosoft/jest-preset"},"npmpackagejsonlint":{"extends":"npm-package-json-lint-config-auto"},"_id":"extract-first-json@2.0.0","dist":{"shasum":"e01eae36f97d4c52b90c77605b38a68d9d9fb3fd","size":2226,"noattachment":false,"key":"/extract-first-json/-/extract-first-json-2.0.0.tgz","tarball":"http://name.csiicloud.com:7001/extract-first-json/download/extract-first-json-2.0.0.tgz"},"_npmUser":{"name":"bconnorwhite","email":"connor.bcw@gmail.com"},"directories":{},"maintainers":[{"name":"bconnorwhite","email":""},{"name":"npm:bconnorwhite","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/extract-first-json_2.0.0_1675037701276_0.03220143066758485"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-30T00:15:01.492Z","publish_time":1675037701492,"_cnpm_publish_time":1675037701492},"1.0.1":{"name":"extract-first-json","version":"1.0.1","description":"Extract the first JSON object or array from a string","license":"MIT","author":{"name":"Connor White","email":"connor.bcw@gmail.com","url":"https://connorwhite.org"},"homepage":"https://connorwhite.org/github/extract-first-json","repository":{"type":"git","url":"git+https://github.com/bconnorwhite/extract-first-json.git"},"keywords":["extract","json","object","array","from","string"],"main":"./build/index.js","scripts":{"build":"bob build","lint":"bob lint","postversion":"git push --tags","prepublishOnly":"yarn run build && yarn test","test":"jest"},"dependencies":{"parse-json-object":"^2.0.0","reduce-first":"^1.0.1"},"devDependencies":{"@bconnorwhite/bob":"^2.3.0","jest":"^26.4.2"},"eslintConfig":{"extends":"eslint-config-bob"},"npmpackagejsonlint":{"extends":"npm-package-json-lint-config-bob"},"_id":"extract-first-json@1.0.1","dist":{"shasum":"be828615ac0c83c982f22d8c93063e4f9dc2a356","size":1759,"noattachment":false,"key":"/extract-first-json/-/extract-first-json-1.0.1.tgz","tarball":"http://name.csiicloud.com:7001/extract-first-json/download/extract-first-json-1.0.1.tgz"},"maintainers":[{"name":"bconnorwhite","email":""},{"name":"npm:bconnorwhite","email":""}],"_npmUser":{"name":"bconnorwhite","email":"connor.bcw@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/extract-first-json_1.0.1_1600624473572_0.31767450134563036"},"_hasShrinkwrap":false,"publish_time":1600624473701,"_cnpm_publish_time":1600624473701,"_cnpmcore_publish_time":"2021-12-16T23:41:07.151Z"},"1.0.0":{"name":"extract-first-json","version":"1.0.0","description":"Extract the first JSON object or array from a string","license":"MIT","author":{"name":"Connor White","email":"connor.bcw@gmail.com","url":"https://connorwhite.org"},"homepage":"https://connorwhite.org/github/extract-first-json","repository":{"type":"git","url":"git+https://github.com/bconnorwhite/extract-first-json.git"},"keywords":["extract","json","object","array","from","string"],"main":"./build/index.js","scripts":{"build":"bob build","lint":"bob lint","postversion":"git push --tags","prepublishOnly":"yarn run build && yarn test","test":"jest"},"dependencies":{"parse-json-object":"^2.0.0","reduce-first":"^1.0.1"},"devDependencies":{"@bconnorwhite/bob":"^2.3.0","jest":"^26.4.2"},"eslintConfig":{"extends":"eslint-config-bob"},"npmpackagejsonlint":{"extends":"npm-package-json-lint-config-bob"},"_id":"extract-first-json@1.0.0","dist":{"shasum":"54563eda6f457cea2505c24a40c8ea80cb1a1357","size":1740,"noattachment":false,"key":"/extract-first-json/-/extract-first-json-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/extract-first-json/download/extract-first-json-1.0.0.tgz"},"maintainers":[{"name":"bconnorwhite","email":""},{"name":"npm:bconnorwhite","email":""}],"_npmUser":{"name":"bconnorwhite","email":"connor.bcw@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/extract-first-json_1.0.0_1600621103215_0.23435158644866583"},"_hasShrinkwrap":false,"publish_time":1600621103380,"_cnpm_publish_time":1600621103380,"_cnpmcore_publish_time":"2021-12-16T23:41:07.473Z"}},"readme":"<!--BEGIN HEADER-->\n<div id=\"top\" align=\"center\">\n  <h1>extract-first-json</h1>\n  <a href=\"https://npmjs.com/package/extract-first-json\">\n    <img alt=\"NPM\" src=\"https://img.shields.io/npm/v/extract-first-json.svg\">\n  </a>\n  <a href=\"https://github.com/bconnorwhite/extract-first-json\">\n    <img alt=\"TypeScript\" src=\"https://img.shields.io/github/languages/top/bconnorwhite/extract-first-json.svg\">\n  </a>\n</div>\n\n<br />\n\n<blockquote align=\"center\">Extract the first JSON object or array from a string.</blockquote>\n\n<br />\n\n_If I should maintain this repo, please ⭐️_\n<a href=\"https://github.com/bconnorwhite/extract-first-json\">\n  <img align=\"right\" alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/bconnorwhite/extract-first-json?label=%E2%AD%90%EF%B8%8F&style=social\">\n</a>\n\n_DM me on [Twitter](https://twitter.com/bconnorwhite) if you have questions or suggestions._\n<a href=\"https://twitter.com/bconnorwhite\">\n  <img align=\"right\" alt=\"Twitter\" src=\"https://img.shields.io/twitter/url?label=%40bconnorwhite&style=social&url=https%3A%2F%2Ftwitter.com%2Fbconnorwhite\">\n</a>\n\n---\n<!--END HEADER-->\n\n## Installation\n\n```sh\nyarn add extract-first-json\n```\n\n```sh\nnpm install extract-first-json\n```\n\n```sh\npnpm add extract-first-json\n```\n\n<br />\n\n## Usage\n\n```ts\nimport { extractJSON, extractJSONObject, extractJSONArray } from \"extract-first-json\";\n\nconst string = `Example: { \"ok\": true }`;\n\nconst arrayString = `Example: [{ \"ok\": true }]`;\n\nextractJSON(string); // { ok: true }\n\nextractJSONObject(string); // { ok: true }\n\nextractJSONArray(arrayString); // [{ \"ok\": true }]\n```\n\n<!--BEGIN FOOTER-->\n\n<br />\n\n<h2 id=\"dependencies\">Dependencies<a href=\"https://www.npmjs.com/package/extract-first-json?activeTab=dependencies\"><img align=\"right\" alt=\"dependencies\" src=\"https://img.shields.io/librariesio/release/npm/extract-first-json.svg\"></a></h2>\n\n- [parse-json-object](https://www.npmjs.com/package/parse-json-object): Parse a typed JSON object from a string\n- [reduce-first](https://www.npmjs.com/package/reduce-first): Return early from reduce\n\n<br />\n\n<h3>Dev Dependencies</h3>\n\n- [autorepo](https://www.npmjs.com/package/autorepo): Autorepo abstracts away your dev dependencies, providing a single command to run all of your scripts.\n\n<br />\n\n<h2 id=\"license\">License <a href=\"https://opensource.org/licenses/MIT\"><img align=\"right\" alt=\"license\" src=\"https://img.shields.io/npm/l/extract-first-json.svg\"></a></h2>\n\n[MIT](https://opensource.org/licenses/MIT)\n<!--END FOOTER-->\n","_attachments":{},"homepage":"https://connorwhite.dev/github/extract-first-json","bugs":{"url":"https://github.com/bconnorwhite/extract-first-json/issues"},"license":"MIT"}