Socket
Socket
Sign inDemoInstall

@netlify/functions

Package Overview
Dependencies
Maintainers
15
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netlify/functions - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

src/lib/builder.ts

7

CHANGELOG.md
# Changelog
## [0.7.0](https://www.github.com/netlify/functions-js/compare/v0.6.0...v0.7.0) (2021-04-14)
### Features
* add type to builder wrapper ([#48](https://www.github.com/netlify/functions-js/issues/48)) ([0af5b04](https://www.github.com/netlify/functions-js/commit/0af5b04c2b1241f64a56394317371a08781e881d))
## [0.6.0](https://www.github.com/netlify/functions-js/compare/v0.5.0...v0.6.0) (2021-04-12)

@@ -4,0 +11,0 @@

2

package.json

@@ -5,3 +5,3 @@ {

"types": "./src/main.d.ts",
"version": "0.6.0",
"version": "0.7.0",
"description": "JavaScript utilities for Netlify Functions",

@@ -8,0 +8,0 @@ "files": [

@@ -7,3 +7,3 @@ # @netlify/functions

JavaScript utilities for Netlify Functions.
Development utilities for Netlify Functions.

@@ -18,6 +18,8 @@ ## Installation

### Builder Functions
### On-demand Builders
To use On-demand Builders, wrap your function handler with the `builder` function.
```js
const { builderFunction } = require('@netlify/functions')
const { builder } = require('@netlify/functions')

@@ -31,5 +33,30 @@ const handler = async (event, context) => {

exports.handler = builderFunction(handler)
exports.handler = builder(handler)
```
### TypeScript typings
This module exports typings for authoring Netlify Functions in TypeScript.
```ts
import { Handler } from '@netlify/functions'
const handler: Handler = async (event, context) => {
return {
statusCode: 200,
body: JSON.stringify({ message: "Hello World" })
}
}
export { handler }
```
The following types are exported:
- `Handler`
- `HandlerCallback`
- `HandlerContext`
- `HandlerEvent`
- `HandlerResponse`
## Contributors

@@ -36,0 +63,0 @@

@@ -0,1 +1,2 @@

export * from './lib/builder'
export * from './function'
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc