Socket
Book a DemoInstallSign in
Socket

bun-serve-express

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bun-serve-express

Express API compatibility for Bun.serve()

1.0.5
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Bun.serve + Express

Express API compatibility layer for Bun.serve. Highly similar to uWebSockets-express.

Usage

import bunExpress from "bun-serve-express";

const app = bunExpress(/* optional serve options */);

// use existing middleware implementations!
app.use(express.json());
app.use('/', serveIndex(path.join(__dirname, ".."), { icons: true, hidden: true }))
app.use('/', express.static(path.join(__dirname, "..")));

// register routes
app.get("/hello", (req, res) => {
  res.json({ hello: "world!" });
});

app.listen(8000);

Compatibility coverage

  • ✅ Middleware support
  • ✅ Supports existing Express Router instances
  • Response API
    • ✅ res.headersSent
    • ✅ res.locals
    • ✅ res.append()
    • ✅ res.clearCookie()
    • ✅ res.cookie()
    • ✅ res.end()
    • ✅ res.get()
    • ✅ res.json()
    • ✅ res.jsonp()
    • ✅ res.location()
    • ✅ res.redirect()
    • ✅ res.render()
    • ✅ res.send()
    • ✅ res.sendFile()
    • ✅ res.sendStatus()
    • ✅ res.set()
    • ✅ res.status()
    • ✅ res.type()
    • ✅ res.vary()
    • ❌ res.app
    • ❌ res.attachment()
    • ❌ res.download()
    • ❌ res.format()
    • ❌ res.links()
  • Request API
    • ✅ req.baseUrl
    • ✅ req.body
    • ✅ req.ip
    • ✅ req.method
    • ✅ req.originalUrl
    • ✅ req.params
    • ✅ req.path
    • ✅ req.query
    • ✅ req.accepts()
    • ✅ req.get()
    • ✅ req.param()
    • ❌ req.app
    • ❌ req.cookies
    • ❌ req.fresh
    • ❌ req.hostname
    • ❌ req.ips
    • ❌ req.protocol
    • ❌ req.route
    • ❌ req.secure
    • ❌ req.signedCookies
    • ❌ req.stale
    • ❌ req.subdomains
    • ❌ req.xhr
    • ❌ req.acceptsCharsets()
    • ❌ req.acceptsEncodings()
    • ❌ req.acceptsLanguages()
    • ❌ req.is()
    • ❌ req.range()

Middleware support

License

MIT

FAQs

Package last updated on 19 Dec 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.