@tinyhttp/jsonp

npm (scoped) npm

JSONP response extension.

Install

pnpm i @tinyhttp/jsonp

Example

import { App, extendMiddleware } from '@tinyhttp/app'
import { jsonp } from '@tinyhttp/jsonp'

new App({
  applyExtensions: (req, res) => {
    extendMiddleware(req, res)
    json(req, res)
  }
})
  .get('/', (req, res) => res.jsonp({ some: 'jsonp' }))
  .listen(3000)

Install

pnpm i @tinyhttp/jsonp

Version

1.1.0

Source

packages/etag