{"name":"get-dom-document","version":"0.1.1","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,"scripts":{"release":"bumpp && npm publish"},"peerDependencies":{"jsdom":"*"},"peerDependenciesMeta":{"jsdom":{"optional":true}},"devDependencies":{"bumpp":"^8.2.1"},"gitHead":"121679c6ffea0a76adcf575f52b8ec6d042c1dab","bugs":{"url":"https://github.com/ocavue/get-dom-document/issues"},"_id":"get-dom-document@0.1.1","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-UW/5ylJ7Tmr+26aYKAkftK4G0wbtY/YyOjrKPzWDkLifVS/Kpsgkmxzf2yRfJDMyUofEmccU8CxmSCsV3AKT4A==","shasum":"a50975471c93a897295276299af0a9bba8542496","tarball":"http://registry-npm.ywwl.com/get-dom-document/download/get-dom-document-0.1.1.tgz","fileCount":8,"unpackedSize":4517,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmoPt7H9Oy/O4a9cn8KhxpVnCKBR0x+yLpuOymp1jw6QIhAKuts+ySzE5EZckrRyEWJ84hqPjgJoIwYiU6ZQeqVJGD"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLUgPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoafA//Wz540J926SgPQpOuXtaJjehEtSKYVxRzl/MFnw77vtX2aNbc\r\n4FgM5tJxTMb6YSZaRSo4+QqgRl7sjtiVgUSu/U3rWCgENTMxF2zcZKc//8Kq\r\nqPKxszwAormmutTJWnpgnbmQFhZv2bB31R2No3sh4ZQYArR6BJvZyU+2tZsi\r\n8czPcrlVWIpclRe7HSOgQeS2BcHudLMY0fDxTbe5hPSthQ95f7UTIkcVomsL\r\ny93Fh53cxVaoFNXsp7GloXGxU0bFzMIO8pwKinAr43TkDbbe2+0JdylyKKb2\r\nO9RjMjYq3LOI8fvVYNvrpcdVOV1GHRH9aLZqO5yZKvCubWZhSeAz51ffOsIn\r\nTKYTZbliAmW6vfdN9CPBltJwk+5vtRbKwu4dWUG7uB2vNvODlbRoektWJ7pW\r\nOvsUy9aeRbW0G587sCIneKhefVYcUHxoMF7BWjm9kSDe2cUtKC52ivKbUiwn\r\nwB4QVH+WLrSloL1ehMYNQEAKcmDDKLhz8+HdLlO/jOC1SiqU6dVLSnVCmMoa\r\nE9wZ0qKaivW5VfHhOsLHTl6bSfEtE6jBU/VIlg72J2Hz2HamP/1iPGmb5GqI\r\n7XmxhlrDfVjiJAozhnmyBwqJivu8asDhFCeUk3ehSxev9MWRdRClFRH6ZgaJ\r\nIeLiO9Knw7uuBOs100HgNlwjBjdN1/ZwPtU=\r\n=hyt/\r\n-----END PGP SIGNATURE-----\r\n","size":1932,"noattachment":false,"key":"/get-dom-document/-/get-dom-document-0.1.1.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.1_1663911950962_0.6134509934082888"},"_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":1663911951149,"_cnpm_publish_time":1663911951149,"dist-tags":{"latest":"0.1.3"}}