Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jigra-community/keep-awake

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jigra-community/keep-awake

Prevent your screen from getting some sleep!

  • 5.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Keep Awake

@jigra-community/keep-awake

⚡️ Jigra plugin to prevent devices from dimming or locking the screen.

Installation

npm install @jigra-community/keep-awake
npx jig sync

Configuration

No configuration required for this plugin.

Usage

import { KeepAwake } from '@jigra-community/keep-awake';

const keepAwake = async () => {
  await KeepAwake.keepAwake();
};

const allowSleep = async () => {
  await KeepAwake.allowSleep();
};

const isSupported = async () => {
  const result = await KeepAwake.isSupported();
  return result.isSupported;
};

const isKeptAwake = async () => {
  const result = await KeepAwake.isKeptAwake();
  return result.isKeptAwake;
};

API

  • keepAwake()
  • allowSleep()
  • isSupported()
  • isKeptAwake()
  • Interfaces

keepAwake()

keepAwake() => Promise<void>

Prevent the device from dimming the screen.


allowSleep()

allowSleep() => Promise<void>

Allow the device to dim the screen.


isSupported()

isSupported() => Promise<IsSupportedResult>

Whether keep awake is supported or not.

Returns: Promise<IsSupportedResult>


isKeptAwake()

isKeptAwake() => Promise<IsKeptAwakeResult>

Check if the device is kept awake.

Returns: Promise<IsKeptAwakeResult>


Interfaces

IsSupportedResult
PropType
isSupportedboolean
IsKeptAwakeResult
PropType
isKeptAwakeboolean

License

See LICENSE.

Keywords

FAQs

Package last updated on 10 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc