Skip to content

Commit c6f3ff6

Browse files
committed
.
0 parents  commit c6f3ff6

File tree

11 files changed

+9025
-0
lines changed

11 files changed

+9025
-0
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_size = 2
7+
indent_style = space
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true

.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
parser: "@typescript-eslint/parser",
3+
extends: [
4+
"plugin:@typescript-eslint/recommended",
5+
"prettier/@typescript-eslint",
6+
"plugin:prettier/recommended"
7+
],
8+
parserOptions: {
9+
ecmaVersion: 2018,
10+
sourceType: "module"
11+
}
12+
};

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
coverage/
3+
.DS_Store
4+
npm-debug.log
5+
dist/

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
sudo: false
2+
3+
language: node_js
4+
5+
notifications:
6+
email:
7+
on_success: never
8+
on_failure: change
9+
10+
node_js:
11+
- stable
12+
13+
after_script:
14+
- npm install coveralls@2
15+
- cat ./coverage/lcov.info | coveralls

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 Blake Embrey ([email protected])
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Worker Sentry
2+
3+
[![NPM version][npm-image]][npm-url]
4+
[![NPM downloads][downloads-image]][downloads-url]
5+
[![Build status][travis-image]][travis-url]
6+
[![Test coverage][coveralls-image]][coveralls-url]
7+
8+
> Sentry client for Cloudflare Workers using `fetch` and native V8 stack traces.
9+
10+
## Installation
11+
12+
```
13+
npm install @borderless/worker-sentry --save
14+
```
15+
16+
## Usage
17+
18+
```ts
19+
import { Sentry } from "@borderless/worker-sentry";
20+
21+
const sentry = new Sentry({ dsn: "https://[email protected]/789" });
22+
23+
addEventListener("fetch", (event) => {
24+
event.respondWith(
25+
handler(event.request).catch((err) => {
26+
// Wait until the response from Sentry has resolved.
27+
event.waitUntil(
28+
// Sends a request to Sentry and returns the response promise.
29+
sentry.captureException(err, {
30+
tags: {},
31+
user: {
32+
ip_address: event.request.headers.get("cf-connecting-ip"),
33+
},
34+
})
35+
);
36+
})
37+
);
38+
});
39+
```
40+
41+
## License
42+
43+
MIT
44+
45+
[npm-image]: https://img.shields.io/npm/v/@borderless/worker-sentry.svg?style=flat
46+
[npm-url]: https://npmjs.org/package/@borderless/worker-sentry
47+
[downloads-image]: https://img.shields.io/npm/dm/@borderless/worker-sentry.svg?style=flat
48+
[downloads-url]: https://npmjs.org/package/@borderless/worker-sentry
49+
[travis-image]: https://img.shields.io/travis/BorderlessLabs/worker-sentry.svg?style=flat
50+
[travis-url]: https://travis-ci.org/BorderlessLabs/worker-sentry
51+
[coveralls-image]: https://img.shields.io/coveralls/BorderlessLabs/worker-sentry.svg?style=flat
52+
[coveralls-url]: https://coveralls.io/r/BorderlessLabs/worker-sentry?branch=master

0 commit comments

Comments
 (0)