
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
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.
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.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.