Skip to content

Commit

Permalink
fix(polyfill): export polyfill function (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushmanchhabra authored Aug 26, 2024
1 parent 9619482 commit bbd6174
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,21 @@ Command line interface for building NW.js apps

1. Install [Volta](https://volta.sh/)
1. Install package: `npm i -D @nwutils/cli`

## Usage

Apply NW.js specific polyfills to your NW.js application.

```js
import { applyNwjsPolyfills } from '@nwutils/cli';

// Run this as early in your application lifecycle as possible.
applyNwjsPolyfills();
```

## Roadmap

* [ ] Add tests for nw.Window.isDevToolsOpen
* [ ] Setup Vitest Code Coverage Action
* [ ] Setup License Check Action
* [ ] Setup eslint
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
export {};
import applyNwjsPolyfills from './polyfill';

export {
applyNwjsPolyfills
}
7 changes: 6 additions & 1 deletion src/polyfill.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/**
* Query the status of devtools window..
* Query the status of DevTools window.
*
* @example
* nw.Window.isDevToolsOpen(function(status) {
* console.log(status);
* });
*
* @function
* @param {(status: boolean) => void} callback - Callback function
Expand Down

0 comments on commit bbd6174

Please sign in to comment.