serverless-typescript
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.5
    2,413
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.5
    2,413
  • 0.0.4
    0
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i serverless-typescript

Weekly Downloads

2,413

Version

0.0.5

License

MIT

Unpacked Size

13.2 kB

Total Files

17

Last publish

Collaborators

  • fredericb