Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
use-stay-awake
Advanced tools
React hook that will help the device stay awake while actively using your website or app.
React hook that will help the device stay awake while actively using your website or app.
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 receives a total of 135 weekly downloads. As such, use-stay-awake popularity was classified as not popular.
We found that use-stay-awake 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.