Skip to content

Commit cd95e3a

Browse files
author
jun.zhua
committed
📄add LICENSE
1 parent 8f6ca79 commit cd95e3a

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019-present zhujun24, https://github.com/zhujun24/
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 all
13+
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 THE
21+
SOFTWARE.

README.md

+13-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
[![Build Status](https://travis-ci.org/zhujun24/http-request-context.svg)](https://travis-ci.org/zhujun24/http-request-context)
66
[![Coverage Status](https://coveralls.io/repos/github/zhujun24/http-request-context/badge.svg?branch=master)](https://coveralls.io/github/zhujun24/http-request-context?branch=master)
7+
[![Known Vulnerabilities](https://snyk.io//test/github/zhujun24/http-request-context/badge.svg?targetFile=package.json)](https://snyk.io//test/github/zhujun24/http-request-context?targetFile=package.json)
8+
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fzhujun24%2Fhttp-request-context.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fzhujun24%2Fhttp-request-context?ref=badge_shield)
79
[![npm package](https://img.shields.io/npm/v/http-request-context.svg)](https://www.npmjs.com/package/http-request-context)
10+
811
[![NPM downloads](https://img.shields.io/npm/dm/http-request-context.svg)](https://www.npmjs.com/package/http-request-context)
912
[![Dependency Status](https://david-dm.org/zhujun24/http-request-context.svg)](https://www.npmjs.com/package/http-request-context)
1013
[![Dependency Status](https://david-dm.org/zhujun24/http-request-context/dev-status.svg)](https://www.npmjs.com/package/http-request-context)
@@ -42,13 +45,15 @@ Parameter configuration must be require before, but normally no config are requi
4245
- `httpRequestContext.get(key)` Get the `[key]` attribute of the context.
4346
- `httpRequestContext.get()` Gets an object containing all context properties.
4447

45-
## Example
48+
## How to Use
4649

47-
see [example](https://github.com/zhujun24/http-request-context/tree/master/example)
50+
see [example](https://github.com/zhujun24/http-request-context/tree/master/example) here.
4851

49-
## How to Use
52+
### Install
5053

51-
Install: `npm install http-request-context --save`
54+
```npm
55+
npm install http-request-context --save
56+
```
5257

5358
### Express
5459

@@ -123,6 +128,10 @@ httpRequestContext.get('foo') // 'bar'
123128

124129
If you init mysql connect before http server start, you may get context undefined in mysql query callback scope.
125130

131+
[googleapis/cloud-trace-nodejs #946](https://github.com/googleapis/cloud-trace-nodejs/issues/946)
132+
133+
[nodejs/node #22360](https://github.com/nodejs/node/issues/22360)
134+
126135
```js
127136
mysqlConnection.query('SELECT * FROM table', (error, results, fields) => {
128137
httpRequestContext.get('foo') // undefined

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "http-request-context",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "Store context in http middleware lifecycle.",
55
"main": "index.js",
66
"engines": {

0 commit comments

Comments
 (0)