{"name":"cheerio","version":"1.1.2","keywords":["htmlparser","jquery","selector","scraper","parser","dom","xml","html"],"author":{"name":"Matt Mueller","email":"mattmuelle@gmail.com"},"license":"MIT","_id":"cheerio@1.1.2","maintainers":[{"name":"jugglinmike","email":"mike@mikepennisi.com"},{"name":"feedic","email":"me@feedic.com"}],"homepage":"https://cheerio.js.org/","bugs":{"url":"https://github.com/cheeriojs/cheerio/issues"},"dist":{"shasum":"26af77e89336c81c63ea83197f868b4cbd351369","tarball":"http://registry-npm.ywwl.com/cheerio/download/cheerio-1.1.2.tgz","fileCount":243,"integrity":"sha512-IkxPpb5rS/d1IiLbHMgfPuS0FgiWTtFIm/Nj+2woXDLTZ7fOT2eqzgYbdMlLweqlHbsZjxEChoVK+7iph7jyQg==","signatures":[{"sig":"MEUCIQDE9vTOuv8TGZXkE/E4q+lekwEPx8MMbKoKLhrfStjt1gIgNILo/mN1aQVQAIzMJbrmyBhX6wCZdOdNUcQfheYGWUg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1267074,"size":151276,"noattachment":false,"key":"/cheerio/-/cheerio-1.1.2.tgz"},"main":"./dist/commonjs/index.js","tshy":{"exclude":["**/*.spec.ts","**/__fixtures__/*","**/__tests__/*","**/__snapshots__/*"],"exports":{".":"./src/index.ts","./slim":"./src/slim.ts","./utils":"./src/utils.ts","./package.json":"./package.json"},"esmDialects":["browser"]},"type":"module","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","browser":"./dist/browser/index.js","engines":{"node":">=20.18.1"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"browser":{"types":"./dist/browser/index.d.ts","default":"./dist/browser/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./slim":{"import":{"types":"./dist/esm/slim.d.ts","default":"./dist/esm/slim.js"},"browser":{"types":"./dist/browser/slim.d.ts","default":"./dist/browser/slim.js"},"require":{"types":"./dist/commonjs/slim.d.ts","default":"./dist/commonjs/slim.js"}},"./utils":{"import":{"types":"./dist/esm/utils.d.ts","default":"./dist/esm/utils.js"},"browser":{"types":"./dist/browser/utils.d.ts","default":"./dist/browser/utils.js"},"require":{"types":"./dist/commonjs/utils.d.ts","default":"./dist/commonjs/utils.js"}},"./package.json":"./package.json"},"funding":"https://github.com/cheeriojs/cheerio?sponsor=1","gitHead":"6364a47674088c416bcd64afcf8b8b2f75d586fb","scripts":{"lint":"npm run lint:es && npm run lint:prettier && npm run lint:ts","test":"npm run lint && npm run test:vi","build":"tshy","format":"npm run format:es && npm run format:prettier","lint:es":"eslint .","lint:ts":"tsc --noEmit","prepare":"husky","test:vi":"vitest run","benchmark":"node --import=tsx benchmark/benchmark.ts","format:es":"eslint . --fix","lint:prettier":"npm run format:prettier:raw -- --check","prepublishOnly":"npm run build","format:prettier":"npm run format:prettier:raw -- --write","update-sponsors":"tsx scripts/fetch-sponsors.mts","format:prettier:raw":"prettier \"**/*.{{m,c,}{j,t}s{x,},md{x,},json,y{a,}ml}\" --ignore-path .gitignore"},"_npmUser":{"name":"feedic","email":"me@feedic.com"},"prettier":{"tsdoc":true,"plugins":["./node_modules/prettier-plugin-jsdoc/dist/index.js"],"tabWidth":2,"proseWrap":"always","singleQuote":true},"repository":{"url":"git://github.com/cheeriojs/cheerio.git","type":"git"},"_npmVersion":"11.4.2","description":"The fast, flexible & elegant library for parsing and manipulating HTML and XML.","directories":{},"lint-staged":{"*.js":["prettier --write","eslint --fix"],"*.{json,md,ts,yml}":["prettier --write"]},"_nodeVersion":"24.4.0","dependencies":{"parse5":"^7.3.0","undici":"^7.12.0","domutils":"^3.2.2","domhandler":"^5.0.3","htmlparser2":"^10.0.0","cheerio-select":"^2.1.0","dom-serializer":"^2.0.0","whatwg-mimetype":"^4.0.0","encoding-sniffer":"^0.2.1","parse5-parser-stream":"^7.1.2","parse5-htmlparser2-tree-adapter":"^7.1.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.3","tshy":"^3.0.2","husky":"^9.1.7","jsdom":"^26.1.0","eslint":"^9.31.0","jquery":"^3.7.1","vitest":"^3.1.4","globals":"^16.3.0","prettier":"^3.6.2","tinybench":"^4.0.1","@eslint/js":"^9.30.1","typescript":"^5.8.3","@types/node":"^24.0.15","lint-staged":"^16.1.2","@types/jsdom":"^21.1.7","@eslint/compat":"^1.3.1","@imgix/js-core":"^3.8.0","eslint-plugin-n":"^17.21.0","@octokit/graphql":"^9.0.1","typescript-eslint":"^8.37.0","@vitest/coverage-v8":"^3.2.4","eslint-plugin-jsdoc":"^51.4.1","@vitest/eslint-plugin":"^1.3.4","eslint-plugin-unicorn":"^59.0.1","prettier-plugin-jsdoc":"^1.3.3","@types/whatwg-mimetype":"^3.0.2","eslint-config-prettier":"^10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/cheerio_1.1.2_1753088799268_0.21797766298130505","host":"s3://npm-registry-packages-npm-production"},"readme":"<h1 align=\"center\">cheerio</h1>\n\n<h5 align=\"center\">The fast, flexible, and elegant library for parsing and manipulating HTML and XML.</h5>\n\n<div align=\"center\">\n  <a href=\"https://github.com/cheeriojs/cheerio/actions/workflows/ci.yml\">\n    <img src=\"https://github.com/cheeriojs/cheerio/actions/workflows/ci.yml/badge.svg\" alt=\"Build Status\">\n  </a>\n  <a href=\"https://coveralls.io/github/cheeriojs/cheerio\">\n    <img src=\"https://img.shields.io/coveralls/github/cheeriojs/cheerio/main\" alt=\"Coverage\">\n  </a>\n  <a href=\"#backers\">\n    <img src=\"https://img.shields.io/opencollective/backers/cheerio\" alt=\"OpenCollective backers\">\n  </a>\n  <a href=\"#sponsors\">\n    <img src=\"https://img.shields.io/opencollective/sponsors/cheerio\" alt=\"OpenCollective sponsors\">\n  </a>\n</div>\n\n<br>\n\n[中文文档 (Chinese Readme)](https://github.com/cheeriojs/cheerio/wiki/Chinese-README)\n\n```js\nimport * as cheerio from 'cheerio';\nconst $ = cheerio.load('<h2 class=\"title\">Hello world</h2>');\n\n$('h2.title').text('Hello there!');\n$('h2').addClass('welcome');\n\n$.html();\n//=> <html><head></head><body><h2 class=\"title welcome\">Hello there!</h2></body></html>\n```\n\n## Installation\n\nInstall Cheerio using a package manager like npm, yarn, or bun.\n\n```bash\nnpm install cheerio\n# or\nbun add cheerio\n```\n\n## Features\n\n**&#10084; Proven syntax:** Cheerio implements a subset of core jQuery. Cheerio\nremoves all the DOM inconsistencies and browser cruft from the jQuery library,\nrevealing its truly gorgeous API.\n\n**&#991; Blazingly fast:** Cheerio works with a very simple, consistent DOM\nmodel. As a result parsing, manipulating, and rendering are incredibly\nefficient.\n\n**&#10049; Incredibly flexible:** Cheerio wraps around\n[parse5](https://github.com/inikulin/parse5) for parsing HTML and can optionally\nuse the forgiving [htmlparser2](https://github.com/fb55/htmlparser2/). Cheerio\ncan parse nearly any HTML or XML document. Cheerio works in both browser and\nserver environments.\n\n## API\n\n### Loading\n\nFirst you need to load in the HTML. This step in jQuery is implicit, since\njQuery operates on the one, baked-in DOM. With Cheerio, we need to pass in the\nHTML document.\n\n```js\n// ESM or TypeScript:\nimport * as cheerio from 'cheerio';\n\n// In other environments:\nconst cheerio = require('cheerio');\n\nconst $ = cheerio.load('<ul id=\"fruits\">...</ul>');\n\n$.html();\n//=> <html><head></head><body><ul id=\"fruits\">...</ul></body></html>\n```\n\n### Selectors\n\nOnce you've loaded the HTML, you can use jQuery-style selectors to find elements\nwithin the document.\n\n#### \\$( selector, [context], [root] )\n\n`selector` searches within the `context` scope which searches within the `root`\nscope. `selector` and `context` can be a string expression, DOM Element, array\nof DOM elements, or cheerio object. `root`, if provided, is typically the HTML\ndocument string.\n\nThis selector method is the starting point for traversing and manipulating the\ndocument. Like in jQuery, it's the primary method for selecting elements in the\ndocument.\n\n```js\n$('.apple', '#fruits').text();\n//=> Apple\n\n$('ul .pear').attr('class');\n//=> pear\n\n$('li[class=orange]').html();\n//=> Orange\n```\n\n### Rendering\n\nWhen you're ready to render the document, you can call the `html` method on the\n\"root\" selection:\n\n```js\n$.root().html();\n//=>  <html>\n//      <head></head>\n//      <body>\n//        <ul id=\"fruits\">\n//          <li class=\"apple\">Apple</li>\n//          <li class=\"orange\">Orange</li>\n//          <li class=\"pear\">Pear</li>\n//        </ul>\n//      </body>\n//    </html>\n```\n\nIf you want to render the\n[`outerHTML`](https://developer.mozilla.org/en-US/docs/Web/API/Element/outerHTML)\nof a selection, you can use the `outerHTML` prop:\n\n```js\n$('.pear').prop('outerHTML');\n//=> <li class=\"pear\">Pear</li>\n```\n\nYou may also render the text content of a Cheerio object using the `text`\nmethod:\n\n```js\nconst $ = cheerio.load('This is <em>content</em>.');\n$('body').text();\n//=> This is content.\n```\n\n### The \"DOM Node\" object\n\nCheerio collections are made up of objects that bear some resemblance to\n[browser-based DOM nodes](https://developer.mozilla.org/en-US/docs/Web/API/Node).\nYou can expect them to define the following properties:\n\n- `tagName`\n- `parentNode`\n- `previousSibling`\n- `nextSibling`\n- `nodeValue`\n- `firstChild`\n- `childNodes`\n- `lastChild`\n\n## Screencasts\n\n[https://vimeo.com/31950192](https://vimeo.com/31950192)\n\n> This video tutorial is a follow-up to Nettut's \"How to Scrape Web Pages with\n> Node.js and jQuery\", using cheerio instead of JSDOM + jQuery. This video shows\n> how easy it is to use cheerio and how much faster cheerio is than JSDOM +\n> jQuery.\n\n## Cheerio in the real world\n\nAre you using cheerio in production? Add it to the\n[wiki](https://github.com/cheeriojs/cheerio/wiki/Cheerio-in-Production)!\n\n## Sponsors\n\nDoes your company use Cheerio in production? Please consider\n[sponsoring this project](https://github.com/cheeriojs/cheerio?sponsor=1)! Your\nhelp will allow maintainers to dedicate more time and resources to its\ndevelopment and support.\n\n**Headlining Sponsors**\n\n<!-- BEGIN SPONSORS: headliner -->\n\n<a href=\"https://tidelift.com/subscription/pkg/npm-cheerio\" target=\"_blank\" rel=\"noopener noreferrer\">\n            <img height=\"128px\" width=\"128px\" src=\"https://humble.imgix.net/https%3A%2F%2Fgithub.com%2Ftidelift.png?ixlib=js-3.8.0&w=128&h=128&fit=fillmax&fill=solid&s=0713e6ee5c7ab01e7559df695c1e8cd9\" title=\"Tidelift\" alt=\"Tidelift\"></img>\n          </a>\n<a href=\"https://github.com/\" target=\"_blank\" rel=\"noopener noreferrer\">\n            <img height=\"128px\" width=\"128px\" src=\"https://humble.imgix.net/https%3A%2F%2Fgithub.com%2Fgithub.png?ixlib=js-3.8.0&w=128&h=128&fit=fillmax&fill=solid&s=a1e87ca289de84eb32ea85432cf8ad11\" title=\"Github\" alt=\"Github\"></img>\n          </a>\n<a href=\"https://www.airbnb.com/\" target=\"_blank\" rel=\"noopener noreferrer\">\n            <img height=\"128px\" width=\"128px\" src=\"https://humble.imgix.net/https%3A%2F%2Fgithub.com%2Fairbnb.png?ixlib=js-3.8.0&w=128&h=128&fit=fillmax&fill=solid&s=384cad45e10faea516202ad10801f895\" title=\"AirBnB\" alt=\"AirBnB\"></img>\n          </a>\n<a href=\"https://hasdata.com\" target=\"_blank\" rel=\"noopener noreferrer\">\n            <img height=\"128px\" width=\"128px\" src=\"https://humble.imgix.net/https%3A%2F%2Fhasdata.com%2Ffavicon.svg?ixlib=js-3.8.0&w=128&h=128&fit=fillmax&fill=solid&s=21933842d61dec74a961fc57754e58cb\" title=\"HasData\" alt=\"HasData\"></img>\n          </a>\n\n<!-- END SPONSORS -->\n\n**Other Sponsors**\n\n<!-- BEGIN SPONSORS: sponsor -->\n\n<a href=\"https://onlinecasinosspelen.com\" target=\"_blank\" rel=\"noopener noreferrer\">\n            <img height=\"64px\" width=\"64px\" src=\"https://humble.imgix.net/https%3A%2F%2Fimages.opencollective.com%2Fonlinecasinosspelen%2F99ac6a2%2Flogo.png?ixlib=js-3.8.0&w=64&h=64&fit=fillmax&fill=solid&s=8ec1ec058845b823858f22205485be02\" title=\"OnlineCasinosSpelen\" alt=\"OnlineCasinosSpelen\"></img>\n          </a>\n<a href=\"https://Nieuwe-Casinos.net\" target=\"_blank\" rel=\"noopener noreferrer\">\n            <img height=\"64px\" width=\"64px\" src=\"https://humble.imgix.net/https%3A%2F%2Fimages.opencollective.com%2Fnieuwecasinos%2Fc67d423%2Flogo.png?ixlib=js-3.8.0&w=64&h=64&fit=fillmax&fill=solid&s=ed55d86b80b1aa8cf89b033020521945\" title=\"Nieuwe-Casinos.net\" alt=\"Nieuwe-Casinos.net\"></img>\n          </a>\n\n<!-- END SPONSORS -->\n\n## Backers\n\n[Become a backer](https://github.com/cheeriojs/cheerio?sponsor=1) to show your\nsupport for Cheerio and help us maintain and improve this open source project.\n\n<!-- BEGIN SPONSORS: backer -->\n\n<a href=\"https://kafidoff.com\" target=\"_blank\" rel=\"noopener noreferrer\">\n            <img height=\"64px\" width=\"64px\" src=\"https://humble.imgix.net/https%3A%2F%2Fimages.opencollective.com%2Fkafidoff-vasy%2Fd7ff85c%2Favatar.png?ixlib=js-3.8.0&w=64&h=64&fit=fillmax&fill=solid&s=a41c66c2f9b1d3a7a241e425e7aa2d09\" title=\"Vasy Kafidoff\" alt=\"Vasy Kafidoff\"></img>\n          </a>\n\n<!-- END SPONSORS -->\n\n## License\n\nMIT\n","publish_time":1753088799470,"_cnpm_publish_time":1753088799470,"dist-tags":{"latest":"1.2.0"}}