JSPM

  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q34202F
  • License MIT

JSONP response middleware

Package Exports

  • @tinyhttp/jsonp
  • @tinyhttp/jsonp/package.json

Readme

@tinyhttp/jsonp

npm (scoped) npm

JSONP middleware module.

Install

pnpm i @tinyhttp/jsonp

Example

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

const app = new App()

app.use((req, res, next) => {
  res.jsonp = jsonp(req, res, app)
  next()
})

app.get('/', (req, res) => {
  res.jsonp({ some: 'jsonp' })
})

app.listen(3000)

License

MIT © v1rtl