feat: use npm name cloudevents (#260)
BREAKING CHANGE: This changes the modules name from cloudevents-sdk to cloudevents * feat: use npm name cloudevents fixes #215 Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
This commit is contained in:
parent
4b54b272a5
commit
565f867424
|
@ -22,7 +22,7 @@ The CloudEvents SDK requires a current LTS version of Node.js. At the moment
|
||||||
those are Node.js 10.x and Node.js 12.x. To install in your Node.js project:
|
those are Node.js 10.x and Node.js 12.x. To install in your Node.js project:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
npm install cloudevents-sdk
|
npm install cloudevents
|
||||||
```
|
```
|
||||||
|
|
||||||
### Receiving and Emitting Events
|
### Receiving and Emitting Events
|
||||||
|
@ -37,7 +37,7 @@ binary and structured events in either the 1.0 or 0.3 protocol formats.
|
||||||
const {
|
const {
|
||||||
CloudEvent,
|
CloudEvent,
|
||||||
Receiver
|
Receiver
|
||||||
} = require("cloudevents-sdk");
|
} = require("cloudevents");
|
||||||
|
|
||||||
// Create a receiver to accept events over HTTP
|
// Create a receiver to accept events over HTTP
|
||||||
const receiver = new Receiver();
|
const receiver = new Receiver();
|
||||||
|
@ -58,7 +58,7 @@ structured events, add `Protocol.HTTPStructured` as a parameter to
|
||||||
`emitter.send()`.
|
`emitter.send()`.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { CloudEvent, Emitter, Protocol, Version } = require("cloudevents-sdk");
|
const { CloudEvent, Emitter, Protocol, Version } = require("cloudevents");
|
||||||
|
|
||||||
// With only an endpoint URL, this creates a v1 emitter
|
// With only an endpoint URL, this creates a v1 emitter
|
||||||
const emitter = new Emitter({
|
const emitter = new Emitter({
|
||||||
|
@ -101,7 +101,7 @@ All created `CloudEvent` objects are read-only. If you need to update a propert
|
||||||
```js
|
```js
|
||||||
const {
|
const {
|
||||||
CloudEvent,
|
CloudEvent,
|
||||||
} = require("cloudevents-sdk");
|
} = require("cloudevents");
|
||||||
|
|
||||||
// Create a new CloudEvent
|
// Create a new CloudEvent
|
||||||
const ce = new CloudEvent({...});
|
const ce = new CloudEvent({...});
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "cloudevents-sdk",
|
"name": "cloudevents",
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"description": "CloudEvents SDK for JavaScript",
|
"description": "CloudEvents SDK for JavaScript",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
|
Loading…
Reference in New Issue