{"name":"get-dom-document","version":"0.1.0","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":"216a8d78220714ec1e3d728f1fec34758f8002ce","bugs":{"url":"https://github.com/ocavue/get-dom-document/issues"},"_id":"get-dom-document@0.1.0","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-QaZVTlEk9mlEmg9GYxM4P2q/Df8OFYcQl2w7rHgvt2PaDoJYeQPYnA2c7TaIq7APJBukCba3By5NjeY3drTijQ==","shasum":"cd4aecc6f858240495545da951088f32f3060070","tarball":"http://registry-npm.ywwl.com/get-dom-document/download/get-dom-document-0.1.0.tgz","fileCount":8,"unpackedSize":4509,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyV6yxMXU+PxADwY4nLtCKoZoSUAMva122Nabi/kmUIAIgYbIrR7agF5G3P00Xsy1p1SW0wz7ULC5ro9P5WJfZafU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLDunACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpzLw//VUCTiBRXfJo/yV4i53X9l7qoz+KdZ3QmzgYS7C0+qnVJ2Wxj\r\nUC5oSRc7w0u7wwdIf8zGRnygY97OAAfN1inDtlem7BQuXtefMVdT5P66010z\r\n9AYtWdVeAMgmgih6cXT0mMh0pWgCH+DRY4DH+8hHPr14e0jnoffnuGIM6XiR\r\nJYdJUfokQFhwwlmudKNoAMxWpF37gE1EpKLAztWYuOMm9DHuClTfG5mEV6UW\r\nUCM1XKkqJrRZRP2Qul7t7CLmN0WoJbiuAdFeRnY3EsNIVAs/NaSKVfgwsTXM\r\n2Ul/+5H0TOZoo2xXPipAWP3hpJK+s3UEhZNn+lv7dqWPUjxy/enbXsRkJcFM\r\n1x5SK4wtuwON7X7MFO/K30ls2YwCdUgN928dhBrUkEdLkiUf2+Jv+JTYGksS\r\nlz6bagKfJNxtt0oBLHLl+pkG/3pA9wVwEQKGj+6pSDMarJzwy3sA02LhWziu\r\n1SXqszVcF5E4m7t/UEGYHNzTPqYnwXojbvllVq0PanHyH2skGDH3ACGiLEFq\r\nIGHbvHMQJ6+92zMv3JrFc0sQrdD/BY8x4jtsB49OTpxa1Bq48FudbX9Ldum9\r\nRu5o7r4Jp+rpgYwU71qd/ctSDwHsiw25rqXMeBHxx2PGB5ShvrzJWlw/oDeo\r\nVZYHbYuiTBKD5kKJMTdCuCEs/lm4cOa5nlQ=\r\n=4GMe\r\n-----END PGP SIGNATURE-----\r\n","size":1931,"noattachment":false,"key":"/get-dom-document/-/get-dom-document-0.1.0.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.0_1663843238944_0.5510424823355724"},"_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":1663843239135,"_cnpm_publish_time":1663843239135,"dist-tags":{"latest":"0.1.3"}}