Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@google-cloud/functions-framework

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/functions-framework

FaaS (Function as a service) framework for writing portable Node.js functions

  • 3.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
344K
decreased by-62.02%
Maintainers
1
Weekly downloads
 
Created

What is @google-cloud/functions-framework?

@google-cloud/functions-framework is a Node.js framework for writing, deploying, and running Google Cloud Functions locally. It allows developers to create HTTP functions and background functions that can be triggered by various Google Cloud services.

What are @google-cloud/functions-framework's main functionalities?

HTTP Function

This feature allows you to create an HTTP function that can be triggered by HTTP requests. The example code defines a simple HTTP function that responds with 'Hello, World!'.

const functions = require('@google-cloud/functions-framework');

functions.http('helloHttp', (req, res) => {
  res.send('Hello, World!');
});

Background Function

This feature allows you to create a background function that can be triggered by events from Google Cloud services. The example code defines a background function that logs the received event.

const functions = require('@google-cloud/functions-framework');

functions.cloudEvent('helloBackground', (cloudEvent) => {
  console.log('Received event:', cloudEvent);
});

Local Development

This feature allows you to run your Google Cloud Functions locally for development and testing. The example code shows how to set up a script in your package.json to start the functions framework targeting the 'helloHttp' function.

{
  "scripts": {
    "start": "functions-framework --target=helloHttp"
  }
}

Other packages similar to @google-cloud/functions-framework

FAQs

Package last updated on 05 Jul 2023

Did you know?

Socket

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.

Install

Related posts

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