Gathering detailed insights and metrics for @tsoa-deno/runtime
Gathering detailed insights and metrics for @tsoa-deno/runtime
Gathering detailed insights and metrics for @tsoa-deno/runtime
Gathering detailed insights and metrics for @tsoa-deno/runtime
Build OpenAPI-compliant REST APIs using TypeScript and Deno
npm install @tsoa-deno/runtime
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (95.91%)
Handlebars (2.7%)
JavaScript (1.4%)
Total Downloads
627
Last Day
2
Last Week
2
Last Month
26
Last Year
627
4 Stars
1,841 Commits
1 Branches
1 Contributors
Latest Version
6.2.0
Package Id
@tsoa-deno/runtime@6.2.0
Unpacked Size
194.36 kB
Size
38.93 kB
File Count
101
NPM Version
lerna/8.0.1/node@v18.16.0+x64 (darwin)
Node Version
18.16.0
Publised On
27 Mar 2024
Cumulative downloads
Total Downloads
Last day
0%
2
Compared to previous day
Last week
-60%
2
Compared to previous week
Last month
-13.3%
26
Compared to previous month
Last year
0%
627
Compared to previous year
4
This library is the Deno port of the TSOA Runtime
, part of the TSOA framework. Originally designed for Node.js, this port enables Deno developers to utilize the runtime aspect of TSOA. Routes and specifications are generated via the TSOA command line tool, similar to its Node.js counterpart. The port was made possible using the denoify
script, allowing for compatibility with Deno packages.
:warning: Warning: Unfortunately tsoa-deno does not work on Supabase Edge functions at the moment, as support for decorators is currently broken (as of Supabase Edge release v1.34.0). I hope the Supabase bug will soon be resolved (https://github.com/supabase/edge-runtime/issues/296). Meanwhile it still works great on Deno Deploy and other Deno servers.
TSOA is an open-source framework that facilitates building REST APIs in TypeScript. It provides tools for automatically generating Swagger documentation based on TypeScript interfaces and decorators. TSOA aims to simplify the development process by reducing boilerplate code and enhancing the overall TypeScript experience in API development.
This package can be imported directly into your Deno project from Deno Land.
Use TSOA Runtime
in Deno as you would in a Node.js environment, with the added step of registering the tsoa controller using Hono (please refer to the main repository to see how to do this). Below is a simple usage example of how to use the runtime library in Deno (ie. Supabase Functions):
Filename: functions/tsoa/index.ts
1// Get TSOA controller routes for this endpoint 2import * as routes from "../_shared/routes.ts"; 3 4import { Hono } from 'https://deno.land/x/hono@v3.7.6/mod.ts'; 5import { serve } from "https://deno.land/std@0.168.0/http/server.ts"; 6 7const app = new Hono(); 8// Register routes 9routes.RegisterRoutes(app); 10serve(app.fetch);
Filename: functions/tsoa/tsoa-controller.ts
1import { Route, Body, Post, Controller } from 'tsoa_runtime'; 2 3@Route('/tsoa') 4export class TsoaController extends Controller { 5 /** 6 * A simple TSOA endpoint test 7 */ 8 @Post('test') 9 public async test(@Body() body: { input: string }): Promise<{ outputMatrix: number[] }> { 10 const outputMatrix = [1, 10, 4, 7]; 11 return { outputMatrix }; 12 } 13}
For more detailed examples and advanced usage, please refer to the main repository.
This Deno port of TSOA Runtime
is currently in a testing phase to gauge its suitability and acceptance among Deno developers. Contributions, feedback, and reports on usage experiences are highly welcomed and appreciated. We envision this project potentially becoming part of the mainstream TSOA release in the future. Please refer to the main repository for guidelines on contributing.
No vulnerabilities found.
No security vulnerabilities found.