{"name":"get-dom-document","version":"0.1.3","type":"commonjs","main":"./lib/get-dom-document.node.js","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":"e3f6613b5f1899e6edd4ec577233eb1f3c36bc51","bugs":{"url":"https://github.com/ocavue/get-dom-document/issues"},"_id":"get-dom-document@0.1.3","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-bZ0O00gSQgMo+wz7gU6kbbWCPh4dfDsL9ZOmVhA8TOXszl5GV56TpTuW1/Qq/QctgpjK56yyvB1vBO+wzz8Szw==","shasum":"d0188090e43d38dd146c467ac6e3e1f2ace7af52","tarball":"http://registry-npm.ywwl.com/get-dom-document/download/get-dom-document-0.1.3.tgz","fileCount":8,"unpackedSize":4767,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4urxx08yUKGSXRCdf2Ce09Er4WDANoTQgtlRkTjT2hAIgIstcAwZeXFxOfTWMEhvnRhlMOHZthovoN8SMSwyoB3U="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTRmeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmotZA/8DyEJWNFG5R4vBEidbw9ZcYGoDLPO26Na1h7PTQnU09o9U41p\r\nF/1XTMUlwcJBpcBLaFRsK5ZTZtp/XjTNbDKi49BQQtFKx3yfrCyHPrj4BGQ2\r\nd+hNtkkpu0nAgG3I0S2HHGXiXZWOwHme+NGslCjqheYK+wF/dcTu7RGO7f4W\r\n2nnTbr79Zj1jvkOLGm9msIsfMawH3ouFTJya1c0HEk8KqdkaMElcz+QnBqNG\r\ntukMiAYaqNZ3c7XX7fAx2aj2m732pDyyOlG7NRi6olLs9rmHxXK1MPdlYHEW\r\nLtgEIbmD75vBGr3qUQTtfiXhMTxn7K441xwVdXnh7uF4Hub7YWTATpcVpGLv\r\n/26sz+/VSfA/+jce/BblHKexC+BcKkiRruAQE4C2vBwrCAoswyUIKHyGPV5g\r\nBZ7IEgM+7ZZY9hWhGgTdTdv2w2ZQUeT26SkbcJKZ2V8XNaBwpijKA2S3m9Sb\r\nlWov/bRokQV8LLLK0GHi+zdaR8k3EIbqbzWSuxwAsmnaa6CgAO7JAW60Bbz/\r\nAN1G0eQ5ZU5Hd+mRfZ9NkpA7SevpXnfGUg1epXegiAwsfeqIgIeGK70bwWq/\r\naJ5IcaOYvzVTPKqpm6VvTdm5wRwwNHMvXbd5mI5Mivrrnc/MHmv5oFql/Bo7\r\n5gaERCOjLcyGiGy8Bgehnb/MjFgIP2rUVxY=\r\n=OE+0\r\n-----END PGP SIGNATURE-----\r\n","size":2015,"noattachment":false,"key":"/get-dom-document/-/get-dom-document-0.1.3.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.3_1665997213866_0.4144683622807055"},"_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":1665997214023,"_cnpm_publish_time":1665997214023,"dist-tags":{"latest":"0.1.3"}}