happy-dom-global
Version:
Make Node a browser-like environment, by using Happy DOM.
28 lines (17 loc) • 553 B
Markdown
Make Node a browser-like environment, by using [Happy DOM](https://github.com/capricorn86/happy-dom).
```sh
npm install happy-dom-global
```
Simply importing it will register browser-like globals:
```ts
import 'happy-dom-global';
// Let's check that some browser-like globals are available
console.log ( typeof globalThis.window ); // => 'object'
console.log ( typeof globalThis.document ); // => 'object'
console.log ( typeof globalThis.location ); // => 'object'
```
MIT © Fabio Spampinato