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.
connection-state
Advanced tools
Detect online and offline network state.
You can see it in action here filipchalupa.cz/connection-state. Try to disconnect your device from the internet after loading the page.
npm install connection-state
import { connectionState } from 'connection-state'
const connection = connectionState()
console.log(`You are ${connection.getState()}.`)
// connection.getState() returns 'online' or 'offline'
connection.addListener((state) => {
console.log(`Your connection state has changed. You are now ${state}.`)
})
// state is 'online' or 'offline'
You can specify endpoints to check if you are online. The library will try to fetch the endpoints. If it succeeds, you are online. If it fails, you are offline.
const connection = connectionState({
endpoints: ['https://www.google.com'],
})
npm ci
npm run dev
FAQs
Detect online and offline network state.
The npm package connection-state receives a total of 109 weekly downloads. As such, connection-state popularity was classified as not popular.
We found that connection-state 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.