Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fabiospampinato/happy-dom-global

Make Node a browser-like environment, by using Happy DOM.
https://github.com/fabiospampinato/happy-dom-global

browser dom environment happy-dom

Last synced: 6 days ago
JSON representation

Make Node a browser-like environment, by using Happy DOM.

Awesome Lists containing this project

README

        

# Happy DOM Global

Make Node a browser-like environment, by using [Happy DOM](https://github.com/capricorn86/happy-dom).

## Install

```sh
npm install --save happy-dom-global
```

## Usage

Simply importing it will register browser-like globals:

```ts
import 'happy-dom-global';

console.log ( typeof globalThis.window ); // => 'object'
console.log ( typeof globalThis.document ); // => 'object'
console.log ( typeof globalThis.location ); // => 'object'
```

## License

MIT © Fabio Spampinato