0.0.5 • Published 4 years ago

serverless-typescript v0.0.5

Weekly downloads
731
License
MIT
Repository
github
Last release
4 years ago

Serverless Typescript

Serverless

A Serverless plugin improving typescript developer experience. Lambda related configuration should be as close as possible from actually executed source code. Target typical lambda structure :

import { Event, parseBody } from 'serverless-typescript/lib/api/input-validation';

interface MyHTTPBody {
  param1: string;
  param2: number;
}

/*
 * @Security({'custom:role': Role.Superadmin})
 * @Path('GET', '/api/{myParam}/list')
 */
export const main = async (event: Event<MyHTTPBody>): Promise<APIGatewayProxyResult> => {
  const input = parseBody(event);
  console.log(input.param1);
  //...
};

Highlights

Install

$ npm install serverless-typescript --save-dev

Add the plugin to your serverless.yml file:

plugins:
  - serverless-typescript
0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

1.0.1

4 years ago