Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
screen-wake-lock
Advanced tools
React library to prevent device from entering sleep mode when app is in active tab.
# Install using npm
npm install screen-wake-lock
# Install using yarn
yarn add screen-wake-lock
import React from 'react';
import ReactDOM from 'react-dom';
import WakeLock from 'screen-wake-lock';
import App from './App';
ReactDOM.render(
<React.StrictMode>
<WakeLock />
<App />
</React.StrictMode>,
document.getElementById('root'),
);
import React from 'react';
import WakeLock from 'screen-wake-lock';
const SpecificComponent = () => {
return (
<>
<WakeLock />
<div>Sleepless in Seattle</div>
</>
);
};
export default SpecificComponent;
import React from 'react';
import { useWakeLock } from 'screen-wake-lock';
const SpecificComponent = () => {
useWakeLock();
return <div>Sleepless in Seattle</div>;
};
export default SpecificComponent;
useWakeLock
takes an optional parameter debug
. When passed true
it will print the status of the wake lock to the console whenever it gets locked or released. for instance when navigating away from the browser tab where the app is running and back. This can be a convenient way to test that the hook is working.
import React from 'react';
import { useWakeLock } from 'screen-wake-lock';
const SpecificComponent = () => {
useWakeLock(true);
return <div>Sleepless in Seattle</div>;
};
export default SpecificComponent;
// Screen Wake Lock released: true
// Screen Wake Lock released: false
Check that linting, formatting, build and tests pass
npm run lint
npm run format
npm run build
npm test
Bump version
npm version [major | minor | patch]
Publish to NPM
npm publish
FAQs
React library to prevent computer from entering sleep mode
We found that screen-wake-lock 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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.