Browser window accessor
$ npm install bwindow --save
'use strict'
const { get } = require('bwindow')
// Check document object available
{
let isServerSide = !get('document')
/* ... */
}
// With strict options, throws an error when not found
{
let URL = get('URL', { strict: true })
/* ... */
}
Available functions
Signature | Description |
---|---|
get(name, options, options.strict) -> ?Object |
Get object from window |
once(event, handler) -> function |
Bind window event once |
set(name, value, options, options.strict) -> ?Object |
Set object to window |
This software is released under the MIT License.