
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
wait-for-localhost
Advanced tools
Wait for localhost to be ready
Useful if you need a local server to be ready to accept requests before doing other things.
npm install wait-for-localhost
import waitForLocalhost from 'wait-for-localhost';
await waitForLocalhost({port: 8080});
console.log('Server is ready');
Returns a Promise<object>
that settles when localhost is ready.
The object contains a ipVersion
property with a value of either 6
or 4
depending on the IP version that was used.
Type: object
Type: number
Default: 80
Type: string
Default: '/'
Use a custom path.
For example, /health
for a health-check endpoint.
Type: boolean
Default: false
Use the GET
HTTP-method instead of HEAD
to check if the server is running.
Type: number[]
Default: [200]
HTTP status codes to consider as successful responses.
FAQs
Wait for localhost to be ready
The npm package wait-for-localhost receives a total of 2,975 weekly downloads. As such, wait-for-localhost popularity was classified as popular.
We found that wait-for-localhost 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.