Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit 76e7e55

Browse files
chore: update README
1 parent e2d9b23 commit 76e7e55

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

README.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,37 @@ npm install @netlify/functions
1818

1919
To use On-demand Builders, wrap your function handler with the `builder` function.
2020

21-
_With JavaScript:_
21+
- With JavaScript:
2222

23-
```js
24-
const { builder } = require('@netlify/functions')
23+
```js
24+
const { builder } = require('@netlify/functions')
2525

26-
const handler = async (event, context) => {
27-
return {
28-
statusCode: 200,
29-
body: JSON.stringify({ message: 'Hello World' }),
30-
}
31-
}
26+
const handler = async (event, context) => {
27+
return {
28+
statusCode: 200,
29+
body: JSON.stringify({ message: 'Hello World' }),
30+
}
31+
}
3232

33-
exports.handler = builder(handler)
34-
```
33+
exports.handler = builder(handler)
34+
```
3535

36-
_With TypeScript:_
37-
```ts
38-
import { builder, Handler } from '@netlify/functions'
36+
- With TypeScript:
3937

40-
const myHandler: Handler = async (event, context) => {
41-
return {
42-
statusCode: 200,
43-
body: JSON.stringify({ message: "Hello World" }),
44-
}
45-
}
38+
```ts
39+
import { builder, Handler } from '@netlify/functions'
4640
47-
const handler = builder(myHandler)
41+
const myHandler: Handler = async (event, context) => {
42+
return {
43+
statusCode: 200,
44+
body: JSON.stringify({ message: "Hello World" }),
45+
}
46+
}
4847
49-
export { handler }
50-
```
48+
const handler = builder(myHandler)
49+
50+
export { handler }
51+
```
5152

5253
### TypeScript typings
5354

0 commit comments

Comments
 (0)