
Research
/Security News
Shai Hulud Strikes Again (v2)
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.
@netlify/functions
Advanced tools

JavaScript and TypeScript utilities for Netlify Functions.
npm install @netlify/functions
To use On-demand Builders, wrap your function handler with the builder function.
With JavaScript:
const { builder } = require('@netlify/functions')
const handler = async (event, context) => {
return {
statusCode: 200,
body: JSON.stringify({ message: 'Hello World' }),
}
}
exports.handler = builder(handler)
With TypeScript:
import { builder, Handler } from '@netlify/functions'
const myHandler: Handler = async (event, context) => {
return {
statusCode: 200,
body: JSON.stringify({ message: 'Hello World' }),
}
}
const handler = builder(myHandler)
export { handler }
To use Scheduled Functions, wrap your function handler with the schedule function.
With JavaScript:
const { schedule } = require('@netlify/functions')
exports.handler = schedule('5 4 * * *', async () => {
console.log("It's 04:05 AM!")
})
With TypeScript:
import { schedule } from '@netlify/functions'
export const handler = schedule("5 4 * * *", async () => {
console.log("It's 04:05 AM!")
})
This module exports typings for authoring Netlify Functions in TypeScript.
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:
HandlerHandlerCallbackHandlerContextHandlerEventHandlerResponsePlease see CONTRIBUTING.md for instructions on how to set up and work on this repository. Thanks for contributing!
AWS Lambda is a serverless computing service provided by Amazon Web Services. It allows you to run code without provisioning or managing servers. Compared to @netlify/functions, AWS Lambda offers more extensive integration with other AWS services but may require more configuration and setup.
Vercel (formerly known as Zeit Now) is a platform for serverless functions and static site hosting. It provides a similar serverless function capability as @netlify/functions but is tightly integrated with the Vercel platform. It offers easy deployment and scaling of serverless functions.
Firebase Functions is a serverless framework provided by Google Firebase. It allows you to run backend code in response to events triggered by Firebase features and HTTPS requests. Compared to @netlify/functions, Firebase Functions is more integrated with the Firebase ecosystem, making it a good choice for apps already using Firebase services.
FAQs
TypeScript utilities for interacting with Netlify Functions
The npm package @netlify/functions receives a total of 551,678 weekly downloads. As such, @netlify/functions popularity was classified as popular.
We found that @netlify/functions demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 19 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.