🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

issac

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

issac

A lightweight web back-end framework based on Bun , using pure ts + Bun Native API to achieve .

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

issac

license npm bun

中文文档

A lightweight web backend framework based on bun , implemented using pure ts + bun native.

Thanks to the fast bun native, issac has good performance.

Currently supports.

tip: bun provides first support for ts, which allows issac to get good type hints in js without a .d.ts file.

  • routing
  • middleware
  • built-in logging
  • error handling
  • basic websocket support (to be improved in the future)

TODO

  • Complete basic websocket support (✔)
  • Path Parameters and Wildcard Routing (✔)
  • Complete websocket routing support (in progress)
  • Lifecycle support (in progress)
  • Type Safe (in progress)
  • Route Cache (in progress)

Quick Start

Since issac is based on bun Native implementation, issac can only be used in bun environment.

Installation

Use bun's package management tool (Recommended).

bun add issac

Using npm

npm install issac

Start

Create a simple http/ws server with issac:

import { Issac } from 'issac'

const app = new Issac({
    ws: {
        // Configure the ws scheduler to escalate requests to ws.
        // Any request that contains test: issac in the request header will be escalated to ws
        scheduler: (req) => req.headers.get('test') === 'issac'
    }
})

// Register the ws handler
app.ws({
    open(ws) {
        console.log('a new websocket!')
    },
    message(ws, message) {
        ws.send(message + 'plus!')
    }
})

// Register the http route
app.get('/test', (req, res) => {
    // Return a piece of text
    res.text('issac!')
})

// listen
app.listen(1145, () => {
    console.log('listen on 1145!')
})

issac's API style is very express-like, so developers familiar with express can get started quickly.

Keywords

issac

FAQs

Package last updated on 28 Jan 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