https://github.com/queckezz/global-undom
Run browser-specific code in node using undom
https://github.com/queckezz/global-undom
Last synced: 7 months ago
JSON representation
Run browser-specific code in node using undom
- Host: GitHub
- URL: https://github.com/queckezz/global-undom
- Owner: queckezz
- License: mit
- Created: 2016-09-05T09:53:17.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-06T06:52:27.000Z (about 9 years ago)
- Last Synced: 2025-03-04T22:37:12.047Z (7 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# global-undom
> Run browser-specific code in node using [`undom`](https://github.com/developit/undom)
This module shims the global `document` object in non-browser environments. Excludes the shim if required by a browser environment (using the `browser` field in `package.json`). This allows for easy testing without something heavy-weight like [`jsdom`](https://github.com/tmpvar/jsdom).
[](https://npmjs.org/package/global-undom)
[](https://david-dm.org/queckezz/global-undom)
[](./license)
[](https://github.com/feross/standard)## Installation
```bash
$ npm install global-undom
```## Example
```js
const document = require('global-undom')
// e.g. document.createTextNode()
```## License
[MIT](./license)