GithubHelp home page GithubHelp logo

alexenvoy / google-cloudevents-nodejs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googleapis/google-cloudevents-nodejs

0.0 0.0 0.0 559 KB

CloudEvent Types for Node.js

License: Apache License 2.0

Shell 0.73% JavaScript 0.05% TypeScript 99.22%

google-cloudevents-nodejs's Introduction

Google CloudEvents โ€“ Node.js npm version github ci

This repository contains types for CloudEvents issued by Google, enabling you to have autocompletion in JavaScript or TypeScript projects.

Note: This repo is auto-generated from schemas in https://github.com/googleapis/google-cloudevents

Prerequisites

  • Node 10+

Install

Install the library from npm:

npm i @google/events

Features

This library is meant to provide types for Node projects accepting CloudEvent data, typically sent through a HTTP request's POST body.

For every event type, this library contains:

  • Exports a JavaScript function to[DataType].
  • Exports a TypeScript type interface DataType.

This provides autocompletion and inline IDE documentation for event types.

Example Usage

Require or import the module. Here is an example JS and TS file:

JS

const {toLogEntryData} = require('@google/events/cloud/audit/v1/LogEntryData');

const data = {
  // ...
};

const jsExample = toLogEntryData(data);
console.log(jsExample);

TS

import {LogEntryData} from '@google/events/cloud/audit/v1/LogEntryData';

const data = {
  // ...
};

const tsExample: LogEntryData = data;
console.log(tsExample);

Reference

The reference.md file has detailed examples for how to use every event data type.

google-cloudevents-nodejs's People

Contributors

alexander-fenster avatar averikitsch avatar bcoe avatar github-actions[bot] avatar google-cloud-policy-bot[bot] avatar grant avatar justinbeckwith avatar release-please[bot] avatar renovate-bot avatar yoshi-code-bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.