Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
use-stay-awake-lp
Advanced tools
React hook that will help the device stay awake while actively using your website or app.
React hook that make device stay awake while actively using your website.
Using Yarn
yarn add --dev use-stay-awake
Using NPM
npm install --save use-stay-awake
import React from "react";
import useStayAwake from "use-stay-awake";
function App() {
const device = useStayAwake();
return (
<div>
<p>
Status:
<span>
{device.canSleep
? "Device is allowed to sleep"
: "Device is not allowed to sleep"}
</span>
</p>
<button
onClick={() => {
device.preventSleeping();
}}
>
Prevent Sleeping
</button>
<button
onClick={() => {
device.allowSleeping();
}}
>
Allow Sleeping
</button>
</div>
);
}
export default App;
Prop Name | Type | Description |
---|---|---|
canSleep | boolean default: true | Indicator if the device allowed to sleep. |
preventSleeping | function | Function that prevent the device from sleeping. |
allowSleeping | function | Function that allow the device from sleeping. |
v9-11
v12-84
v22-81
v4-87
v4-14-TP
v16-69
v3.2-14.0
v4.4-81
v12-46
v84
v68
v12.12
v4-12.0
v10.4
v7.12
v2.5
Thank you so much for contributing! :blue_heart:
Clone the repository
git clone https://github.com/roldanjr/use-stay-awake
Locate library folder
cd use-stay-awake
Install library dependencies
yarn install or npm install
Locate demo folder and install dependencies
cd demo
yarn install or npm install
Start development server under root folder
yarn develop or npm run develop
MIT © Roldan Montilla Jr
FAQs
React hook that will help the device stay awake while actively using your website or app.
The npm package use-stay-awake-lp receives a total of 0 weekly downloads. As such, use-stay-awake-lp popularity was classified as not popular.
We found that use-stay-awake-lp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.