{"_id":"@c0b41/brave-this","_rev":"5-672414ff21567baf87d69885337b0ff5","name":"@c0b41/brave-this","dist-tags":{"latest":"0.5.0"},"versions":{"0.1.0":{"name":"@c0b41/brave-this","version":"0.1.0","license":"MIT","_id":"@c0b41/brave-this@0.1.0","maintainers":[{"name":"c0b41","email":"cobaimelan@gmail.com"}],"homepage":"https://github.com/c0b41/brave-this#readme","bugs":{"url":"https://github.com/c0b41/brave-this/issues"},"dist":{"shasum":"048350cc8b0542a47c4e3247b73ff701cbb249a4","tarball":"https://registry.npmjs.org/@c0b41/brave-this/-/brave-this-0.1.0.tgz","fileCount":4,"integrity":"sha512-IyO+S247EfjuNwwBhMQwA/rwM6Z5MQvoz0w/hIl/ztupeI9HuFwWdVdkL70o0o2AttSNM4hN+OVNrZ/tBxJRFg==","signatures":[{"sig":"MEUCIQCNyUciLWmk6FiW4UrhNuPKmIVUggogPzRzZ/yyDxFuVQIgOlx01viGIOyFobrdDBURQLUPv+N+PFnL05v0fXg9sGw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@c0b41%2fbrave-this@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":87496},"main":"dist/index.js","type":"module","_from":"file:c0b41-brave-this-0.1.0.tgz","types":"dist/index.d.ts","scripts":{"dev":"tsup --watch","build":"tsup","example":"DEBUG=* node ./examples/index.js"},"_npmUser":{"name":"c0b41","actor":{"name":"c0b41","type":"user","email":"cobaimelan@gmail.com"},"email":"cobaimelan@gmail.com"},"_resolved":"/tmp/ba03b2ecce452c032539f514a6ddbe26/c0b41-brave-this-0.1.0.tgz","_integrity":"sha512-IyO+S247EfjuNwwBhMQwA/rwM6Z5MQvoz0w/hIl/ztupeI9HuFwWdVdkL70o0o2AttSNM4hN+OVNrZ/tBxJRFg==","repository":{"url":"git+https://github.com/c0b41/brave-this.git"},"_npmVersion":"10.9.2","description":"This repository provides a utility for interacting with the Brave Search engine, allowing you to programmatically perform searches and parse various types of results such as organic links, knowledge graphs, news, videos, and more.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"debug":"^4.4.1","undici":"^7.10.0","cheerio":"1.0.0-rc.10","https-tls":"^1.0.23","jsonrepair":"^3.12.0","oxc-walker":"^0.3.0","lossless-json":"^4.1.0","@babel/generator":"^7.27.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","oxc-parser":"^0.73.2","typescript":"^5.8.2","@types/node":"^17.0.31","@types/debug":"^4.1.12"},"optionalDependencies":{"win-node-env":"^0.6.1"},"_npmOperationalInternal":{"tmp":"tmp/brave-this_0.1.0_1750856015467_0.731472472053099","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@c0b41/brave-this","version":"0.2.0","license":"MIT","_id":"@c0b41/brave-this@0.2.0","maintainers":[{"name":"c0b41","email":"cobaimelan@gmail.com"}],"homepage":"https://github.com/c0b41/brave-this#readme","bugs":{"url":"https://github.com/c0b41/brave-this/issues"},"dist":{"shasum":"cae0d76ab1ed1e4a15e3ed907f937b3a32ebfd8c","tarball":"https://registry.npmjs.org/@c0b41/brave-this/-/brave-this-0.2.0.tgz","fileCount":4,"integrity":"sha512-K1IpurObBV9Oz6iteQhGxeBV1N+nSyg3xK4/jvOslEfYx9ux/zulzQq57XFLCLV0odi6qAzb3FAnziCSKj3WNw==","signatures":[{"sig":"MEUCIQDBFIZy8ZUQO9ENl3sjuD6+guxyd5/qbGihiccz4WTuBgIgNGlklGIKdLofgknj4+mOQ6djT9u/Y0RbNwU1FpP8FI8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@c0b41%2fbrave-this@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":87746},"main":"dist/index.js","type":"module","_from":"file:c0b41-brave-this-0.2.0.tgz","types":"dist/index.d.ts","scripts":{"dev":"tsup --watch","build":"tsup","example":"DEBUG=* node ./examples/index.js"},"_npmUser":{"name":"c0b41","actor":{"name":"c0b41","type":"user","email":"cobaimelan@gmail.com"},"email":"cobaimelan@gmail.com"},"_resolved":"/tmp/1511371123c51531de5ce86258729847/c0b41-brave-this-0.2.0.tgz","_integrity":"sha512-K1IpurObBV9Oz6iteQhGxeBV1N+nSyg3xK4/jvOslEfYx9ux/zulzQq57XFLCLV0odi6qAzb3FAnziCSKj3WNw==","repository":{"url":"git+https://github.com/c0b41/brave-this.git"},"_npmVersion":"10.9.2","description":"This repository provides a utility for interacting with the Brave Search engine, allowing you to programmatically perform searches and parse various types of results such as organic links, knowledge graphs, news, videos, and more.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"debug":"^4.4.1","undici":"^7.10.0","cheerio":"1.0.0-rc.10","https-tls":"^1.0.23","jsonrepair":"^3.12.0","oxc-walker":"^0.3.0","lossless-json":"^4.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","oxc-parser":"^0.73.2","typescript":"^5.8.2","@types/node":"^17.0.31","@types/debug":"^4.1.12"},"optionalDependencies":{"win-node-env":"^0.6.1"},"_npmOperationalInternal":{"tmp":"tmp/brave-this_0.2.0_1750857375128_0.6691860773738825","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@c0b41/brave-this","version":"0.3.0","license":"MIT","_id":"@c0b41/brave-this@0.3.0","maintainers":[{"name":"c0b41","email":"cobaimelan@gmail.com"}],"homepage":"https://github.com/c0b41/brave-this#readme","bugs":{"url":"https://github.com/c0b41/brave-this/issues"},"dist":{"shasum":"56091d0ac3a2846c7562b5cab6c97773281ad0fe","tarball":"https://registry.npmjs.org/@c0b41/brave-this/-/brave-this-0.3.0.tgz","fileCount":6,"integrity":"sha512-olVpjzlcikh410Vp922LPmghxb6Ghn/ziS+jzRwT0gaPEdHUEXtkOUN5HLI79OKWxLPZQXh/pMYLwkpaRLRjvA==","signatures":[{"sig":"MEQCIAdxCDzTGhP4bQ3CzuQiSjfdpGFQa20841WSn8cSinuFAiB5Hi+wYBoyPfs0mNwdrHaSiLb9b+mz28xVSzTPUTaGwQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@c0b41%2fbrave-this@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":174322},"main":"./dist/index.cjs","_from":"file:c0b41-brave-this-0.3.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","build":"tsup","example":"DEBUG=* node ./examples/index.js"},"_npmUser":{"name":"c0b41","actor":{"name":"c0b41","type":"user","email":"cobaimelan@gmail.com"},"email":"cobaimelan@gmail.com"},"_resolved":"/tmp/0d1057c240ac0cc7ac6f03bafac17d1c/c0b41-brave-this-0.3.0.tgz","_integrity":"sha512-olVpjzlcikh410Vp922LPmghxb6Ghn/ziS+jzRwT0gaPEdHUEXtkOUN5HLI79OKWxLPZQXh/pMYLwkpaRLRjvA==","repository":{"url":"git+https://github.com/c0b41/brave-this.git"},"_npmVersion":"10.9.2","description":"This repository provides a utility for interacting with the Brave Search engine, allowing you to programmatically perform searches and parse various types of results such as organic links, knowledge graphs, news, videos, and more.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"debug":"^4.4.1","undici":"^7.10.0","cheerio":"1.0.0-rc.10","https-tls":"^1.0.23","jsonrepair":"^3.12.0","oxc-walker":"^0.3.0","lossless-json":"^4.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","oxc-parser":"^0.73.2","typescript":"^5.8.2","@types/node":"^17.0.31","@types/debug":"^4.1.12"},"optionalDependencies":{"win-node-env":"^0.6.1"},"_npmOperationalInternal":{"tmp":"tmp/brave-this_0.3.0_1750859961697_0.7611660512773217","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@c0b41/brave-this","version":"0.4.0","license":"MIT","_id":"@c0b41/brave-this@0.4.0","maintainers":[{"name":"c0b41","email":"cobaimelan@gmail.com"}],"homepage":"https://github.com/c0b41/brave-this#readme","bugs":{"url":"https://github.com/c0b41/brave-this/issues"},"dist":{"shasum":"cce6f40694afb6d4b85a8b3d264d98ebc3af26e9","tarball":"https://registry.npmjs.org/@c0b41/brave-this/-/brave-this-0.4.0.tgz","fileCount":6,"integrity":"sha512-pnbGtK4gYhcAuodJiCyRywqJ4dUP9+4RCxA0lE1H2SD4IJE+6yJoNlXMM8vipAi//AZTbzBSVlB37AFC2F1q8A==","signatures":[{"sig":"MEYCIQDtWnoTUYY0lsS5WjzyemQFOXSwaL+jBXzskXJVoeLAxQIhAJfCXY5IcWCchZ03zbc2uZIBvl3Sjo0GgJDpup1oL2Pc","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@c0b41%2fbrave-this@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":174321},"main":"./dist/index.js","_from":"file:c0b41-brave-this-0.4.0.tgz","types":"./dist/index.d.mts","module":"./dist/index.mjs","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","build":"tsup","example":"DEBUG=* node ./examples/index.js"},"_npmUser":{"name":"c0b41","actor":{"name":"c0b41","type":"user","email":"cobaimelan@gmail.com"},"email":"cobaimelan@gmail.com"},"_resolved":"/tmp/80a65fb381666972f355204ce5a9f789/c0b41-brave-this-0.4.0.tgz","_integrity":"sha512-pnbGtK4gYhcAuodJiCyRywqJ4dUP9+4RCxA0lE1H2SD4IJE+6yJoNlXMM8vipAi//AZTbzBSVlB37AFC2F1q8A==","repository":{"url":"git+https://github.com/c0b41/brave-this.git"},"_npmVersion":"10.9.2","description":"This repository provides a utility for interacting with the Brave Search engine, allowing you to programmatically perform searches and parse various types of results such as organic links, knowledge graphs, news, videos, and more.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"debug":"^4.4.1","undici":"^7.10.0","cheerio":"1.0.0-rc.10","https-tls":"^1.0.23","jsonrepair":"^3.12.0","oxc-walker":"^0.3.0","lossless-json":"^4.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","oxc-parser":"^0.73.2","typescript":"^5.8.2","@types/node":"^17.0.31","@types/debug":"^4.1.12"},"optionalDependencies":{"win-node-env":"^0.6.1"},"_npmOperationalInternal":{"tmp":"tmp/brave-this_0.4.0_1750860689756_0.6514858932826362","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@c0b41/brave-this","version":"0.5.0","description":"This repository provides a utility for interacting with the Brave Search engine, allowing you to programmatically perform searches and parse various types of results such as organic links, knowledge graphs, news, videos, and more.","license":"MIT","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.mts","exports":{".":{"require":"./dist/index.js","import":"./dist/index.mjs"}},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","prepublishOnly":"npm run build","example":"DEBUG=* node ./examples/index.js"},"dependencies":{"cheerio":"1.0.0-rc.10","debug":"^4.4.1","https-tls":"^1.0.23","jsonrepair":"^3.12.0","lossless-json":"^4.1.0","oxc-walker":"^0.3.0","undici":"^7.10.0"},"devDependencies":{"@types/debug":"^4.1.12","@types/node":"^17.0.31","oxc-parser":"^0.73.2","tsup":"^8.4.0","typescript":"^5.8.2"},"optionalDependencies":{"win-node-env":"^0.6.1"},"packageManager":"pnpm@9.15.0","repository":{"url":"git+https://github.com/c0b41/brave-this.git"},"gitHead":"efee6bd7f161f3815e2bc6b9c9dd98bc669720db","_id":"@c0b41/brave-this@0.5.0","bugs":{"url":"https://github.com/c0b41/brave-this/issues"},"homepage":"https://github.com/c0b41/brave-this#readme","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-sZRsFhv/56N0soJesRPyFLcrqkTiH5wazDS9vyqKTU7I1z8Zm9N5nYkIVMwWM2rMGl9ReH1uS8UjkCuSVCvyoA==","shasum":"3f6f3cba34ef3c052477caff0fa0e61daef31e89","tarball":"https://registry.npmjs.org/@c0b41/brave-this/-/brave-this-0.5.0.tgz","fileCount":6,"unpackedSize":153544,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDJQjTP4HVO+gjBkNW2Td/W9Iir9S9205vtEmbJPsmzpgIgfQIB8RnE9cAIQiwNjk0vJ8kq2ZB/r9Gvu4OSzIXfolU="}]},"_npmUser":{"name":"c0b41","email":"cobaimelan@gmail.com"},"directories":{},"maintainers":[{"name":"c0b41","email":"cobaimelan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/brave-this_0.5.0_1781286946781_0.35317850231266856"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-25T12:53:35.386Z","modified":"2026-06-12T17:55:47.114Z","0.1.0":"2025-06-25T12:53:35.654Z","0.2.0":"2025-06-25T13:16:15.329Z","0.3.0":"2025-06-25T13:59:21.877Z","0.4.0":"2025-06-25T14:11:29.939Z","0.5.0":"2026-06-12T17:55:46.974Z"},"bugs":{"url":"https://github.com/c0b41/brave-this/issues"},"license":"MIT","homepage":"https://github.com/c0b41/brave-this#readme","repository":{"url":"git+https://github.com/c0b41/brave-this.git"},"description":"This repository provides a utility for interacting with the Brave Search engine, allowing you to programmatically perform searches and parse various types of results such as organic links, knowledge graphs, news, videos, and more.","maintainers":[{"name":"c0b41","email":"cobaimelan@gmail.com"}],"readme":"# brave-this\r\n\r\nThis repository provides a utility for interacting with the Brave Search engine, allowing you to programmatically perform searches and parse various types of results such as organic links, knowledge graphs, news, videos, and more.\r\n\r\n## Installation\r\n\r\n```sh\r\npnpm add @c0b41/brave-this\r\n```\r\n\r\n## Search\r\n\r\n```js\r\nasync function performSearch() {\r\n    try {\r\n        const results = await search({\r\n            query: 'latest tech news',\r\n            options: {\r\n                safe: 'moderate',\r\n                lang: 'en-US',\r\n                page: 0,\r\n                mobile: false\r\n            }\r\n        });\r\n\r\n        console.log('Organic Results:', results.results ? .items);\r\n        console.log('Knowledge Graph Title:', results.knowledges ? .title);\r\n        console.log('News Articles:', results.news ? .items);\r\n        console.log('Did You Mean:', results.didYouMean);\r\n\r\n    } catch (error) {\r\n        console.error('Search failed:', error);\r\n    }\r\n}\r\n\r\nperformSearch();\r\n```\r\n\r\n## Search Parameters\r\n\r\nThe SearchParams type defines the structure for the options object passed to the search\r\n\r\n```js\r\ntype SearchParams = {\r\n  query: string,\r\n  options?: {\r\n    safe?: 'off' | 'moderate' | 'strict', // Safe search filter\r\n    search_lang?: string, // Search language (e.g., 'en-US')\r\n    page?: number, // Page number for results (0-indexed)\r\n    mobile?: boolean, // Set to true for a mobile user agent\r\n    headers?: Headers, // Custom HTTP headers to send with the request\r\n  },\r\n}\r\n```\r\n\r\n## Search Results\r\n\r\nThe BraveSearchResult type is the shape of the object returned by the search function, containing parsed data for various result types:\r\n\r\n```js\r\ntype BraveSearchResult = {\r\n  results: OrganicResults | null,\r\n  knowledges: KnowledgeGraph | null,\r\n  news: News | null,\r\n  videos: Videos | null,\r\n  weather: Weather | null,\r\n  time: Time | null,\r\n  location: Location | null,\r\n  dictionary: Dictionary | null,\r\n  translation: Translation | null,\r\n  converters: Converters | null,\r\n  didYouMean: DidYouMean | null,\r\n  relatedqueries: RelatedQuerys | null,\r\n  discussions: Discussions | null,\r\n}\r\n```\r\n\r\nEach property (e.g., OrganicResults, KnowledgeGraph) corresponds to a parser class (#nodes/organicresults, #nodes/knowledgegraph, etc.) that extracts and structures data from the raw Brave search response.\r\n\r\n## Debugging\r\n\r\nYou can enable detailed debugging logs by setting the DEBUG environment variable. If process.env.DEBUG is set, the raw HTML content fetched from Brave Search will be written to ./data/data.html.\r\n\r\n```sh\r\nDEBUG=* node your_script.js\r\n```\r\n","readmeFilename":"README.md"}