Socket
Socket
Sign inDemoInstall

@elysiajs/eden

Package Overview
Dependencies
2
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elysiajs/eden


Version published
Weekly downloads
7.6K
decreased by-13.46%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

0.7.7 - 15 Dec 2023

Bug fix:

  • treaty: #36 FileArray send [ object Promise ] instead binary
  • treaty: #34 Add a way to get the unresolved Response for corner case support

Readme

Source

@elysiajs/eden

Fully type-safe Elysia client refers to the documentation

Installation

bun add elysia @elysiajs/eden

Example

// server.ts
import { Elysia, t } from 'elysia'

const app = new Elysia()
    .get('/', () => 'Hi Elysia')
    .get('/id/:id', ({ params: { id } }) => id)
    .post('/mirror', ({ body }) => body, {
        schema: {
            body: t.Object({
                id: t.Number(),
                name: t.String()
            })
        }
    })
    .listen(8080)

export type App = typeof app

// client.ts
import { edenTreaty } from '@elysiajs/eden'
import type { App } from './server'

const app = edenTreaty<App>('http://localhost:8080')

// data: Hi Elysia (fully type-safe)
const { data: pong } = app.index.get()

// data: 1895
const { data: id } = client.id.1895.get()

// data: { id: 1895, name: 'Skadi' }
const { data: nendoroid } = app.mirror.post({
    id: 1895,
    name: 'Skadi'
})

Keywords

FAQs

Last updated on 15 Dec 2023

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc