0.0.3 • Published 4 years ago

serverless-yaml2ts v0.0.3

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

serverless-yaml2ts

Simple convertor from serverless.yml to serverless.ts

oclif Version Downloads/week License

Before

service:
  name: example-project
frameworkVersion: '>=1.72.0'
custom:
  webpack:
    webpackConfig: ./webpack.config.js
    includeModules: true

plugins:
  - serverless-webpack

provider:
  name: aws
  runtime: nodejs12.x
  apiGateway:
    minimumCompressionSize: 1024
  environment:
    AWS_NODEJS_CONNECTION_REUSE_ENABLED: 1

functions:
  hello:
    handler: handler.hello
    events:
      - http:
          method: get
          path: hello

After

import { Serverless } from 'serverless/aws';
export const service: Serverless = {
  "service": {
    "name": "example-project"
  },
  "frameworkVersion": ">=1.72.0",
  "custom": {
    "webpack": {
      "webpackConfig": "./webpack.config.js",
      "includeModules": true
    }
  },
  "plugins": [
    "serverless-webpack"
  ],
  "provider": {
    "name": "aws",
    "runtime": "nodejs12.x",
    "apiGateway": {
      "minimumCompressionSize": 1024
    },
    "environment": {
      "AWS_NODEJS_CONNECTION_REUSE_ENABLED": 1
    }
  },
  "functions": {
    "hello": {
      "handler": "handler.hello",
      "events": [
        {
          "http": {
            "method": "get",
            "path": "hello"
          }
        }
      ]
    }
  }
}

module.exports = service

Usage

$ npm install -g serverless-yaml2ts
$ sls-yaml2ts COMMAND
running command...
$ sls-yaml2ts (-v|--version|version)
serverless-yaml2ts/0.0.3 darwin-x64 node-v12.9.1
$ sls-yaml2ts --help [COMMAND]
USAGE
  $ sls-yaml2ts COMMAND
...

Commands