{"name":"get-dom-document","version":"0.1.2","type":"commonjs","main":"./lib/get-dom-document.node.js","module":"./lib/get-dom-document.node.mjs","browser":"./lib/get-dom-document.browser.js","types":"./lib/get-dom-document.d.ts","exports":{"types":"./lib/get-dom-document.d.ts","node":{"import":"./lib/get-dom-document.node.mjs","require":"./lib/get-dom-document.node.js"},"browser":{"import":"./lib/get-dom-document.browser.mjs","require":"./lib/get-dom-document.browser.js"},"default":"./lib/get-dom-document.node.js"},"description":"Get a [DOM document](https://developer.mozilla.org/en-US/docs/Web/API/Document) in both Node.js and the browser environment.","author":{"name":"ocavue","email":"ocavue@gmail.com"},"license":"MIT","funding":"https://github.com/sponsors/ocavue","homepage":"https://github.com/ocavue/get-dom-document","repository":{"type":"git","url":"git+https://github.com/ocavue/get-dom-document.git"},"keywords":[],"sideEffects":false,"peerDependencies":{"jsdom":"*"},"peerDependenciesMeta":{"jsdom":{"optional":true}},"devDependencies":{"bumpp":"^8.2.1"},"scripts":{"release":"bumpp && npm publish"},"bugs":{"url":"https://github.com/ocavue/get-dom-document/issues"},"_id":"get-dom-document@0.1.2","_integrity":"sha512-vh+334mlpztbnwcmBkuUgszzurptR7z3ZquoW2Xq1hapGDyfzXWktPksyFQocjSN+NyFx9g1M8NaB8ncdBgATg==","_resolved":"/private/var/folders/00/y54gq_b567l2cd0qtqqqlysm0000gn/T/2906313ba707971d6e6c0ecd3896551b/get-dom-document-0.1.2.tgz","_from":"file:get-dom-document-0.1.2.tgz","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-vh+334mlpztbnwcmBkuUgszzurptR7z3ZquoW2Xq1hapGDyfzXWktPksyFQocjSN+NyFx9g1M8NaB8ncdBgATg==","shasum":"1e6f3e2a7fe26d8655ba97cc5b06a8e1297336e4","tarball":"http://registry-npm.ywwl.com/get-dom-document/download/get-dom-document-0.1.2.tgz","fileCount":8,"unpackedSize":4813,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmQ2wgDtoVD7q8MrTeGaAJTtTQrngrPChr16E9HDSAfgIgTCaippdwTZle2YH+9JHmWZOnHAv+iBZBSN4gViLxsb4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSTfxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqjVBAAg3LwjCUYrdR+qXPSlb1LG3iOKwEFEcjt5OaosyOIHQzbaJqa\r\nV9ElbP41FWUCUSgIhSnL9XjBeCY46wQIcGVllDtFkVGeT0ynRYstfgLHJjfn\r\n7L8ruoEvuKprRsn4je4dKDNp+kXBWCIW5DUSrhDLm57P2lbwOtBEU4+INLho\r\nwAzwby7O5xVnDBt1lSy8o85Bou2lGs6+GGaADMEixTthVMPGdOoKj+e50Nsg\r\n8/Bfee8k8qaKKnW3yS8sYjjviTDJhl8TLjrhwoM/N+GiykNUACvGwGP0vgX9\r\nYjylJqI/DczbH0UTl9+nref8W8FGdfs2t6g1CJu5EsK2cblZwOswNgmGwGtB\r\nIqzybhWD/Z3mTNUCigiqiT6bv7nx8qiDYavGcoAyLk/0EiFfAI01b3MeAMsR\r\nJ7NWAuhET+YRC6umxNXJlgPjRLmjNuIt7nNKQDw/G2KFtdYIK8oX61oXK9Pq\r\nxQg8DGMdioQupP05Z6oJBPvHPUIk9j4TprbZIatThydZm2XV8jJFdruiymOQ\r\nvAyhqoubsnWOMjK6PhEDTAvB/AO6Z0+sCLWRPH9iyOdGbhuVgmg4Hg4VVQqx\r\n4U0+nTsRcd6RIESeVRuSGgyblXxQ+PDf68FXIEj2GI/+uXaDb/idfd9asWvo\r\nd8TkzrY12L02MK8am7l5G08fCjyn/EGZ32o=\r\n=N5Gt\r\n-----END PGP SIGNATURE-----\r\n","size":2042,"noattachment":false,"key":"/get-dom-document/-/get-dom-document-0.1.2.tgz"},"_npmUser":{"name":"ocavue","email":"ocavue@gmail.com"},"directories":{},"maintainers":[{"name":"ocavue","email":"ocavue@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-dom-document_0.1.2_1665742833417_0.8850973872059125"},"_hasShrinkwrap":false,"readme":"# get-dom-document\n\nGet a [DOM document](https://developer.mozilla.org/en-US/docs/Web/API/Document) in both Node.js and the browser environment.\n\n`getDomDocument` will firstly try to get the DOM document from the global `document` object. If it is not available, it will try to create a new DOM document using [`jsdom`](https://github.com/jsdom/jsdom) in Node.js environment. If `jsdom` is not available or it's not running in Node.js environment, it will return `null`.\n\nThis package use the `browser` field in `package.json` and [conditional exports](https://nodejs.org/docs/latest-v16.x/api/packages.html#conditional-exports) to provide different implementations for Node.js and the browser environment.\n\n## Install\n\n```\nnpm install get-dom-document\n```\n\n## Usage\n\nCommonJS:\n\n```js\nconst { getDomDocument } = require(\"get-dom-document\");\n\nconst document = getDomDocument();\n```\n\nES module:\n\n```js\nimport { getDomDocument } from \"get-dom-document\";\n\nconst document = getDomDocument();\n```\n","publish_time":1665742833551,"_cnpm_publish_time":1665742833551,"dist-tags":{"latest":"0.1.3"}}