|
1 |
| -[](http://www.apache.org/licenses/LICENSE-2.0) |
| 1 | +# JavaScript SDK for CloudEvents |
| 2 | + |
2 | 3 | [](https://www.codacy.com/app/fabiojose/sdk-javascript?utm_source=github.com&utm_medium=referral&utm_content=cloudevents/sdk-javascript&utm_campaign=Badge_Grade)
|
3 | 4 | [](https://www.codacy.com/app/fabiojose/sdk-javascript?utm_source=github.com&utm_medium=referral&utm_content=cloudevents/sdk-javascript&utm_campaign=Badge_Coverage)
|
4 | 5 | [](https://travis-ci.org/cloudevents/sdk-javascript)
|
5 | 6 | [](https://www.npmjs.com/package/cloudevents-sdk)
|
6 | 7 | [](https://www.npmjs.com/package/cloudevents-sdk)
|
7 |
| -[](https://david-dm.org/cloudevents/sdk-javascript) |
8 | 8 | [](https://snyk.io/test/github/cloudevents/sdk-javascript)
|
| 9 | +[](http://www.apache.org/licenses/LICENSE-2.0) |
9 | 10 |
|
10 |
| -# sdk-javascript |
11 |
| - |
12 |
| -Official CloudEvents' SDK for JavaScript. |
13 | 11 |
|
14 |
| -<img src="https://github.com/cncf/artwork/blob/master/projects/cloudevents/horizontal/color/cloudevents-horizontal-color.png" width="300" height="58" alt="CloudEvents logo"> |
| 12 | +The CloudEvents SDK for JavaScript. |
15 | 13 |
|
16 | 14 | ## Status
|
17 | 15 |
|
18 |
| -This SDK is still considered a work in progress, therefore things might (and |
19 |
| -will) break with every update. |
| 16 | +This SDK is still considered a work in progress. |
20 | 17 |
|
21 | 18 | This SDK current supports the following versions of CloudEvents:
|
22 |
| -- v1.0 |
23 |
| - |
24 |
| -**Checkout the [changelog](./CHANGELOG.md) to see what's going on!** |
25 |
| - |
26 |
| -## Contributing |
27 |
| - |
28 |
| -Before create an awesome PR, please read our [guidelines](./CONTRIBUTING.md). |
29 |
| - |
30 |
| -## Examples |
31 |
| - |
32 |
| -To see working examples, point to [examples](./examples). |
33 |
| - |
34 |
| -## :newspaper: Newsletter :newspaper: |
35 |
| - |
36 |
| -> all the API developed before, for 0.1 and 0.3, works as the same. |
37 |
| -
|
38 |
| -Checkout the new expressive additions. |
39 |
| - |
40 |
| -### Use typed CloudEvents in your Typescript project |
41 |
| - |
42 |
| -> There is full example: [typescript-ex](./examples/typescript-ex) |
43 |
| -
|
44 |
| -```ts |
45 |
| -import CloudEvent, { |
46 |
| - event, |
47 |
| - StructuredHTTPEmitter, |
48 |
| - BinaryHTTPEmitter, |
49 |
| - |
50 |
| - StructuredHTTPReceiver, |
51 |
| - BinaryHTTPReceiver |
52 |
| -} from 'cloudevents-sdk/v1'; |
53 | 19 |
|
54 |
| -let myevent: CloudEvent = event() |
55 |
| - .source('/source') |
56 |
| - .type('type') |
57 |
| - .dataContentType('text/plain') |
58 |
| - .dataschema('http://d.schema.com/my.json') |
59 |
| - .subject('cha.json') |
60 |
| - .data('my-data') |
61 |
| - .addExtension("my-ext", "0x600"); |
62 |
| - |
63 |
| -// . . . |
64 |
| - |
65 |
| -``` |
66 |
| - |
67 |
| -## Versioning |
68 |
| - |
69 |
| -### Before Spec reaches 1.0 |
70 |
| - |
71 |
| -- `0.x.p`: where `x` relates to spec version and `p` relates to fixes, releases |
72 |
| -and breaking changes |
| 20 | +- v1.0 |
73 | 21 |
|
74 |
| -### After Spec reaches 1.0 |
75 |
| - |
76 |
| -- `x.M.p`: where `x` relates to spec version, `M` relates to minor and `p` relates |
77 |
| -to fixes. See [semver](https://semver.org/) |
| 22 | +**Checkout the [changelog](CHANGELOG.md) to see what's going on!** |
78 | 23 |
|
79 | 24 | ## Installation
|
80 | 25 |
|
@@ -109,8 +54,6 @@ These are the supported specifications by this version.
|
109 | 54 |
|
110 | 55 | ## How to use
|
111 | 56 |
|
112 |
| -> If you want old examples, they are [here](./OLDOCS.md) |
113 |
| -
|
114 | 57 | ### Usage
|
115 | 58 |
|
116 | 59 | ```js
|
@@ -331,6 +274,11 @@ Receiver.check(Object, Map)
|
331 | 274 | CloudEvent Receiver.parse(Object, Map)
|
332 | 275 | ```
|
333 | 276 |
|
| 277 | +## Versioning |
| 278 | + |
| 279 | +- `x.M.p`: where `x` relates to spec version, `M` relates to minor and `p` relates |
| 280 | +to fixes. See [semver](https://semver.org/) |
| 281 | + |
334 | 282 | ## Community
|
335 | 283 |
|
336 | 284 | - There are bi-weekly calls immediately following the [Serverless/CloudEvents
|
|
0 commit comments