https://github.com/dword-design/nuxt-dev-ready
Waits until the Nuxt dev server is loaded. Mainly useful for testing.
https://github.com/dword-design/nuxt-dev-ready
wait
Last synced: about 1 month ago
JSON representation
Waits until the Nuxt dev server is loaded. Mainly useful for testing.
- Host: GitHub
- URL: https://github.com/dword-design/nuxt-dev-ready
- Owner: dword-design
- License: other
- Created: 2023-04-23T15:19:39.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-11T05:04:44.000Z (about 2 months ago)
- Last Synced: 2025-03-11T06:19:15.771Z (about 2 months ago)
- Topics: wait
- Language: JavaScript
- Homepage:
- Size: 525 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# nuxt-dev-ready
Waits until the Nuxt dev server is loaded. Mainly useful for testing.
## Install
```bash
# npm
$ npm install nuxt-dev-ready# Yarn
$ yarn add nuxt-dev-ready
```## Usage
```js
import { execaCommand } from 'execa'
import kill from 'tree-kill-promise'
import nuxtDevReady from 'nuxt-dev-ready'const nuxt = execaCommand('nuxt dev')
try {
await nuxtDevReady()// Do some testing
} finally {
await kill(nuxt.pid)
}
```## Custom port
You can pass a custom port to `nuxtDevReady` like so:
```js
import { execaCommand } from 'execa'
import kill from 'tree-kill-promise'
import nuxtDevReady from 'nuxt-dev-ready'const nuxt = execaCommand('nuxt dev', { env: { PORT: 4000 } })
try {
await nuxtDevReady(4000)
} finally {
await kill(nuxt.pid)
}
```## Contribute
Are you missing something or want to contribute? Feel free to file an [issue](https://github.com/dword-design/nuxt-dev-ready/issues) or a [pull request](https://github.com/dword-design/nuxt-dev-ready/pulls)! ⚙️
## Support
Hey, I am Sebastian Landwehr, a freelance web developer, and I love developing web apps and open source packages. If you want to support me so that I can keep packages up to date and build more helpful tools, you can donate here:
![]()
If you want to send me a one time donation. The coffee is pretty good 😊.
![]()
Also for one time donations if you like PayPal.
![]()
Here you can support me regularly, which is great so I can steadily work on projects.Thanks a lot for your support! ❤️
## License
[MIT License](https://opensource.org/licenses/MIT) © [Sebastian Landwehr](https://sebastianlandwehr.com)