open-index/open-npm huggingface dataset:
npm package: @serverless/knative-eventing
Description: Instantly create and update [Knative eventing](https://knative.dev/docs/eventing/) definitions running on top of your Kubernetes cluster with [Serverless Components](https://github.com/serverless/components).
Author: Serverless, Inc.
Latest version: 0.2.1

# knative-eventing

Instantly create and update [Knative eventing](https://knative.dev/docs/eventing/) definitions running on top of your Kubernetes cluster with [Serverless Components](https://github.com/serverless/components).

&nbsp;

1. [Install](#1-install)
2. [Create](#2-create)
3. [Configure](#3-configure)
4. [Deploy](#4-deploy)

&nbsp;

### 1. Install

```console
$ npm install -g serverless
```

### 2. Create

Just create a `serverless.yml` file

```console
$ touch serverless.yml
```

Make sure that you have generated your [`Kubeconfig` file](https://rancher.com/docs/rancher/v2.x/en/cluster-admin/kubeconfig/) via `kubectl`.

### 3. Configure

```yml
# serverless.yml

myKnativeEventDefinition:
  component: '@serverless/knative-eventing'
  inputs:
    kubeConfigPath: ../kubeconfig # default is `~/.kube/config`
    knativeGroup: eventing.knative.dev # default is `eventing.knative.dev`
    knativeVersion: v1alpha1 # default is `v1alpha1`
    namespace: 'default' # default is `'default'`
    kind: 'Trigger' # default is `'Trigger'`
    name: my-knative-event
    spec: # eventing specification
      filter:
        attributes:
          type: dev.knative.foo.bar
      subscriber:
        ref:
          name: my-knative-service
          kind: 'Service'
          apiVersion: 'serving.knative.dev/v1alpha1'
```

### 4. Deploy

```console
$ serverless
```

### New to Components?

Checkout the [Serverless Components](https://github.com/serverless/components) repo for more information.
npm package: @serverless/knative-serving
Description: Instantly create and update Knative services on top of your Kubernetes cluster with [Serverless Components](https://github.com/serverless/components).
Author: Serverless, Inc.
Latest version: 0.1.0

# knative-serving

Instantly create and update Knative services on top of your Kubernetes cluster with [Serverless Components](https://github.com/serverless/components).

&nbsp;

1. [Install](#1-install)
2. [Create](#2-create)
3. [Configure](#3-configure)
4. [Deploy](#4-deploy)

&nbsp;

### 1. Install

```console
$ npm install -g serverless
```

### 2. Create

Just create a `serverless.yml` file

```console
$ touch serverless.yml
```

Make sure that you have generated your [`Kubeconfig` file](https://rancher.com/docs/rancher/v2.x/en/cluster-admin/kubeconfig/) via `kubectl`.

### 3. Configure

```yml
# serverless.yml

myKnativeService:
  component: '@serverless/knative-serving'
  inputs:
    kubeConfigPath: ../kubeconfig # default is `~/.kube/config`
    knativeGroup: serving.knative.dev # default is `serving.knative.dev`
    knativeVersion: v1alpha1 # default is `v1alpha1`
    registryAddress: 'https://container-registry.acme.com' # default is `'https://index.docker.io/v1'`
    namespace: 'default' # default is `'default'`
    name: my-knative-service
    repository: acme/some-func
    tag: latest
```

### 4. Deploy

```console
$ serverless
```

### New to Components?

Checkout the [Serverless Components](https://github.com/serverless/components) repo for more information.
npm package: @serverless/kubernetes-namespace
Description: Instantly create, update and remove Kubernetes namespaces with [Serverless Components](https://github.com/serverless/components).
Author: Serverless, Inc.
Latest version: 0.2.0

# kubernetes-namespace

Instantly create, update and remove Kubernetes namespaces with [Serverless Components](https://github.com/serverless/components).

&nbsp;

1. [Install](#1-install)
2. [Create](#2-create)
3. [Configure](#3-configure)
4. [Deploy](#4-deploy)

&nbsp;

### 1. Install

```console
$ npm install -g serverless
```

### 2. Create

Just create a `serverless.yml` file

```console
$ touch serverless.yml
```

Make sure that you have generated your [`Kubeconfig` file](https://rancher.com/docs/rancher/v2.x/en/cluster-admin/kubeconfig/) via `kubectl`.

### 3. Configure

```yml
# serverless.yml

myKubernetesNamespace:
  component: '@serverless/kubernetes-namespace'
  inputs:
    kubeConfigPath: ../kubeconfig # default is `~/.kube/config`
    name: 'default' # default is `'default'`
    labels: # default is `null`
      foo: bar
      baz: qux
```

### 4. Deploy

```console
$ serverless
```

### New to Components?

Checkout the [Serverless Components](https://github.com/serverless/components) repo for more information.
npm package: @serverless/mono
Description: ![https://www.serverless.com](https://s3.amazonaws.com/assets.github.serverless/readme-serverless-mono-2.png)
Author: Eslam λ Hefnawy
Latest version: 0.3.6

![https://www.serverless.com](https://s3.amazonaws.com/assets.github.serverless/readme-serverless-mono-2.png)

# mono

&nbsp;

Easily host web frameworks and applications on a single AWS Lambda function using this [Serverless Component](https://www.github.com/serverless/components).

### Features

* Designed to make it easy to host pre-existing web frameworks (e.g. Express.js, Hapi) or any large web application on a single AWS Lambda Function.
* Blazing Fast Uploads via AWS S3 Accelerated Transfer and Multi-Part.
* Dependencies are automatically put in AWS Lambda Layers, reducing cold-start time and further reducing upload time.
* Simple shim for receiving and responding to HTTP requests.

&nbsp;

1. [Install](#1-install)
2. [Create](#2-create)
3. [Configure](#3-configure)
4. [Deploy](#4-deploy)

&nbsp;


### 1. Install

```console
$ npm install -g @serverless/components
```

### 2. Create

```console
$ mkdir mono && cd mono
```

The directory should look something like this:


```
|- serverless.yml # required
|- index.js       # required
|- package.json   # optional
|- .env           # your development AWS api keys
|- .env.prod      # your production AWS api keys
```

the `.env` files are not required if you have the aws keys set globally and you want to use a single stage, but they should look like this.

```
AWS_ACCESS_KEY_ID=XXX
AWS_SECRET_ACCESS_KEY=XXX
```

The `index.js` file should look something like this.

```js
module.exports = async (e, ctx, cb) => {
  return { statusCode: 200, body: 'mono app deployed.' }
}

// you could also just return an object
// which would return it as body with
// 200 status code by default
// module.exports = () => ({ hello: 'world' })

// or just a string
// module.exports = () => 'success'

// or a status code number
// module.exports = () => 404 // not found!

// you don't even need to export a function!
// module.exports = { hello: 'world' } // great for mocking!
// module.exports = 'success'
// module.exports = 500
```

### 3. Configure

All the following inputs are optional. However, they allow you to configure your Lambda compute instance and pass environment variables.

```yml
# serverless.yml

name: mono
stage: dev

mono:
  component: "@serverless/mono"
  inputs:
    name: my-mono-app
    description: My Mono App
    region: us-east-1
    memory: 128
    timeout: 10
    env:
      TABLE_NAME: my-table

    # the directory that contains the index.js file.
    # If not provided, the default is the current working directory
    # code: ./code


```

### 4. Deploy

```console
mono (master)$ components

  Mono › outputs:
  url:  'https://bbhm7tk587.execute-api.us-east-1.amazonaws.com/dev/'


  7s › dev › Mono › done

mono (master)$
```

All requests to this root url will be proxied directly to your lambda function, giving you full control of the http layer.

&nbsp;

### New to Components?

Checkout the [Serverless Components](https://github.com/serverless/components) repo for more information.
npm package: @serverless/pubsub
Description: Easily add cross-provider PubSub mappings to your serverless functions using [Serverless Components](https://github.com/serverless/components).
Author: Serverless, Inc.
Latest version: 0.2.0

# PubSub

Easily add cross-provider PubSub mappings to your serverless functions using [Serverless Components](https://github.com/serverless/components).

## Table of Contents

1. [Install](#1-install)
2. [Create](#2-create)
3. [Configure](#3-configure)
4. [Deploy](#4-deploy)

### 1. Install

```shell
$ npm install -g @serverless/components
```

### 2. Create

Just create the following simple boilerplate:

```shell
$ touch serverless.yml # more info in the "Configure" section below
$ touch index.js       # your lambda code
$ touch .env           # your development AWS api keys
$ touch .env.prod      # your production AWS api keys
```

the `index.js` file should look something like this:


```js

module.exports.sendNotification = async (e) => {
  return {
    statusCode: 200,
    body: 'Notification Sent'
  }
}

```

the `.env` files are not required if you have the aws keys set globally and you want to use a single stage, but they should look like this.

```
AWS_ACCESS_KEY_ID=XXX
AWS_SECRET_ACCESS_KEY=XXX
```

Keep reading for info on how to set up the `serverless.yml` file.

### 3. Configure
```yml
# serverless.yml

name: subscriptions

createUser:
  component: "@serverless/function"
  inputs:
    name: ${name}-send-notification
    code: ./code
    handler: index.sendNotification

subscriptions:
  component: "@serverless/pubsub"
  inputs:
    - source: userCreated # topic name
      function: ${comp:sendNotification}
   
```
### 4. Deploy

```shell
pubsub (master)$ components
```

&nbsp;

### New to Components?

Checkout the [Serverless Components](https://github.com/serverless/components) repo for more information.
npm package: @serverless/schedule
Description: ![serverless scheduled task aws lambda](https://s3.amazonaws.com/assets.github.serverless/readme-serverless-schedule.png)
Author: Serverless, Inc.
Latest version: 2.1.0

![serverless scheduled task aws lambda](https://s3.amazonaws.com/assets.github.serverless/readme-serverless-schedule.png)

# schedule

&nbsp;

Instantly run scheduled cron jobs on AWS Lambda using [Serverless Components](https://github.com/serverless/components).

&nbsp;

1. [Install](#1-install)
2. [Create](#2-create)
3. [Configure](#3-configure)
4. [Deploy](#4-deploy)

&nbsp;


### 1. Install

```console
$ npm install -g serverless
```

### 2. Create

```console
$ mkdir schedule && cd schedule
```

The directory should look something like this:


```
|- index.js
|- serverless.yml
|- package.json # optional
|- .env         # your AWS api keys
```

the `.env` file should look like this

```
AWS_ACCESS_KEY_ID=XXX
AWS_SECRET_ACCESS_KEY=XXX
```

The `index.js` file should contain your scheduling code.  It must export a module named `task`:

```js
module.exports.task = async (e, ctx, cb) => {
  console.log('running in schedule')
}
```

### 3. Configure

All the following inputs are optional. However, they allow you to configure your Lambda compute instance and pass environment variables.

```yml
# serverless.yml

mySchedule:
  component: "@serverless/schedule"
  inputs:
    code:
      src: ./code # The root folder containing the index.js file
      build: build # The folder within your 'src' directory containing your built artifacts
      hook: npm run build # A hook to build/test/do anything

    handler: foo.bar # optional - specifies handler file & function. eg: foo.js instead of index.js and bar instead of task
    runtime: nodejs10.x # default

    # you can provide a rate either as rate with
    # this format <amount><unit-character> (e.g. 1s, 5m, 2h)
    # or a cron expresion  
    rate: 5m
    enabled: true # this is the default value
    region: us-east-1
    memory: 128
    timeout: 10
    env:
      TABLE_NAME: my-table
```

### 4. Deploy

```console
$ serverless
```

&nbsp;

### New to Components?

Checkout the [Serverless Components](https://github.com/serverless/components) repo for more information.