https://github.com/mrmurphy/koa-response-censor
Filter out certain keys from the response body. Keep those secrets secret!
https://github.com/mrmurphy/koa-response-censor
Last synced: 7 months ago
JSON representation
Filter out certain keys from the response body. Keep those secrets secret!
- Host: GitHub
- URL: https://github.com/mrmurphy/koa-response-censor
- Owner: mrmurphy
- Created: 2015-06-05T04:41:00.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-06T04:52:35.000Z (about 11 years ago)
- Last Synced: 2025-10-12T04:39:36.710Z (8 months ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# koa-response-censor
Filter out certain keys from the response body. Keep those secrets secret! [](https://travis-ci.org/murphyrandle/koa-response-censor)

## Install
>Install with [npm](https://github.com/npm/npm)
```
$ npm install koa-response-censor
```
## Usage
```js
var app = require('koa')(),
koaCensor = require('koa-response-censor');
app.use(koaCensor({
keys: [
'pwdHash',
'_secretKey',
'myPhoneNumber'
]
}));
...
// any keys at any depth of the response body matching
// a term found in the array above will be omitted from
// the response.
```
## Options
- `keys` **{array}** An array of keys to be omitted (deeply) from the response body
## Tests
```
$ npm test
```
## License
The MIT License, 2014 [Murphy Randle](https://github.com/murphyrandle)