mil-no-sleep v1.2.1
\
mil-no-sleep mocks the Wake Lock API and extends it to all browsers. This webcomponent follows the open-wc recommendation.
Demo: https://stackblitz.com/edit/mil-no-sleep-example?file=index.js
Installation
npm i mil-no-sleepUsage
<script type="module">
  import 'mil-no-sleep/mil-no-sleep.js';
</script>
<mil-no-sleep></mil-no-sleep>Methods
disableSleepMode(): Disable Sleep Mode.
enableSleepMode(): Re activate Sleep Mode.
Events
sleepModeDisabled: fired when sleep mode is disabled.
sleepModeEnabled: fired when sleep mode is reactivated.
Linting with ESLint, Prettier, and Types
To scan the project for linting errors, run
npm run lintYou can lint with ESLint and Prettier individually as well
npm run lint:eslintnpm run lint:prettierTo automatically fix many linting errors, run
npm run formatYou can format using ESLint and Prettier individually as well
npm run format:eslintnpm run format:prettierLocal Demo with es-dev-server
npm startTo run a local development server that serves the basic demo located in demo/index.html
npm start:compatibilityTo run a local development server in compatibility mode for older browsers that serves the basic demo located in demo/index.html