@tinyhttp/ping
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@tinyhttp/ping

npm GitHub Workflow Status Coverage

Inspired by koa-response-time

Response time checker for tinyhttp. Sets X-Response-Time header using process.hrtime()

Install

pnpm i @tinyhttp/ping

API

import { ping } from '@tinyhttp/ping'

Options

round

Round the ping time. Default is set to true.

Example

import { ping } from '@tinyhttp/ping'
import { createServer } from 'http'
import path from 'path'

createServer(async (req, res) => {
  ping()(req, res)
  res.end('Hello World')
}).listen(3000)

Package Sidebar

Install

npm i @tinyhttp/ping

Weekly Downloads

2

Version

2.0.0

License

MIT

Unpacked Size

4.68 kB

Total Files

5

Last publish

Collaborators

  • dropthebeatbro