Working Skelleton
This commit is contained in:
+420
@@ -0,0 +1,420 @@
|
||||
3.15.1 / 2019-02-10
|
||||
===================
|
||||
|
||||
- update: deprecate `hpkp`
|
||||
|
||||
3.15.0 / 2018-11-07
|
||||
===================
|
||||
|
||||
- new: `featurePolicy` now supports four new features
|
||||
|
||||
3.14.0 / 2018-10-09
|
||||
===================
|
||||
|
||||
- new: `featurePolicy` middleware
|
||||
|
||||
3.13.0 / 2018-07-22
|
||||
===================
|
||||
|
||||
- new: `permittedCrossDomainPolicies` middleware
|
||||
|
||||
3.12.2 / 2018-07-20
|
||||
===================
|
||||
|
||||
- fix: remove `lodash.reduce` dependency from `csp`
|
||||
|
||||
3.12.1 / 2018-05-16
|
||||
===================
|
||||
|
||||
- fix: `expectCt` should use comma instead of semicolon as delimiter
|
||||
|
||||
3.12.0 / 2018-03-02
|
||||
===================
|
||||
|
||||
- new: `xssFilter` now supports `reportUri` option
|
||||
|
||||
3.11.0 / 2018-02-09
|
||||
===================
|
||||
|
||||
- update: main Helmet middleware is now named to help with debugging
|
||||
|
||||
3.10.0 / 2018-01-23
|
||||
===================
|
||||
|
||||
- new: `csp` now supports `prefix-src` directive
|
||||
|
||||
- update: `csp` no longer loads JSON files internally, helping some module bundlers
|
||||
|
||||
- fix: `false` should be able to disable a CSP directive
|
||||
|
||||
3.9.0 / 2017-10-13
|
||||
==================
|
||||
|
||||
- new: `csp` now supports `strict-dynamic` value
|
||||
- new: `csp` now supports `require-sri-for` directive
|
||||
|
||||
- remove: `connect` dependency
|
||||
|
||||
3.8.2 / 2017-09-27
|
||||
==================
|
||||
|
||||
- update: `connect` dependency to latest
|
||||
|
||||
3.8.1 / 2017-07-28
|
||||
==================
|
||||
|
||||
- fix: `csp` does not automatically set `report-to` when setting `report-uri`
|
||||
|
||||
3.8.0 / 2017-07-21
|
||||
==================
|
||||
|
||||
- update: `hsts` no longer cares whether it's HTTPS and always sets the header
|
||||
|
||||
3.7.0 / 2017-07-21
|
||||
==================
|
||||
|
||||
- new: `csp` now supports `report-to` directive
|
||||
|
||||
- update: throw an error when used incorrectly
|
||||
- update: add a few documentation files to `npmignore`
|
||||
|
||||
3.6.1 / 2017-05-21
|
||||
==================
|
||||
|
||||
- update: bump `connect` version
|
||||
|
||||
3.6.0 / 2017-05-04
|
||||
==================
|
||||
|
||||
- new: `expectCt` middleware for setting the `Expect-CT` header
|
||||
|
||||
3.5.0 / 2017-03-06
|
||||
==================
|
||||
|
||||
- new: `csp` now supports the `worker-src` directive
|
||||
|
||||
3.4.1 / 2017-02-24
|
||||
==================
|
||||
|
||||
- update: bump `connect` version
|
||||
|
||||
3.4.0 / 2017-01-13
|
||||
==================
|
||||
|
||||
- new: `csp` now supports more `sandbox` directives
|
||||
|
||||
3.3.0 / 2016-12-31
|
||||
==================
|
||||
|
||||
- update: `referrerPolicy` allows `strict-origin` and `strict-origin-when-cross-origin` directives
|
||||
- update: bump `connect` version
|
||||
|
||||
3.2.0 / 2016-12-22
|
||||
==================
|
||||
|
||||
- update: CSP now allows `manifest-src` directive
|
||||
|
||||
3.1.0 / 2016-11-03
|
||||
==================
|
||||
|
||||
- update: CSP now allows `frame-src` directive
|
||||
|
||||
3.0.0 / 2016-10-28
|
||||
==================
|
||||
|
||||
- update: CSP will check your directives for common mistakes and throw errors if it finds them. This can be disabled with `loose: true`.
|
||||
- update: empty arrays are no longer allowed in CSP. For source lists (like `script-src` or `object-src`), use the standard `scriptSrc: ["'none'"]`. The `sandbox` directive can be `sandbox: true` to block everything.
|
||||
- update: `false` can disable a CSP directive. For example, `scriptSrc: false` is the same as not specifying it.
|
||||
- update: in CSP, `reportOnly: true` no longer requires a `report-uri` to be set.
|
||||
- update: `hsts`'s `maxAge` now defaults to 180 days (instead of 1 day)
|
||||
- update: `hsts`'s `maxAge` parameter is seconds, not milliseconds
|
||||
- update: `hsts` includes subdomains by default
|
||||
- update: `hpkp`'s `maxAge` parameter is seconds, not milliseconds
|
||||
- update: `domain` parameter in `frameguard` cannot be empty
|
||||
|
||||
- remove: `noEtag` option no longer present in `noCache`
|
||||
- remove: iOS Chrome `connect-src` workaround in CSP module
|
||||
|
||||
2.3.0 / 2016-09-30
|
||||
==================
|
||||
|
||||
- new: `hpkp` middleware now supports the `includeSubDomains` property with a capital D
|
||||
|
||||
- fix: `hpkp` was setting `includeSubdomains` instead of `includeSubDomains`
|
||||
|
||||
2.2.0 / 2016-09-16
|
||||
==================
|
||||
|
||||
- new: `referrerPolicy` middleware
|
||||
|
||||
2.1.3 / 2016-09-07
|
||||
==================
|
||||
|
||||
- update: top-level aliases (like `helmet.xssFilter`) are no longer dynamically required
|
||||
|
||||
2.1.2 / 2016-07-27
|
||||
==================
|
||||
|
||||
- update: `nocache`'s `noEtag` option is now deprecated
|
||||
|
||||
- fix: `csp` now better handles Firefox on mobile
|
||||
|
||||
2.1.1 / 2016-06-10
|
||||
==================
|
||||
|
||||
- update: remove several dependencies from `helmet-csp`
|
||||
|
||||
- fix: `frameguard` had a documentation error about its default value
|
||||
- fix: `frameguard` docs in main Helmet readme said `frameguard`, not `helmet.frameguard`
|
||||
|
||||
2.1.0 / 2016-05-18
|
||||
==================
|
||||
|
||||
- new: `csp` lets you dynamically set `reportOnly`
|
||||
|
||||
2.0.0 / 2016-04-29
|
||||
==================
|
||||
|
||||
- new: pass configuration to enable/disable default middlewares
|
||||
|
||||
- update: `dnsPrefetchControl` middleware is now default
|
||||
|
||||
- fix: make `hpkp` lowercase in documentation
|
||||
- fix: update `hpkp` spec URL in readmes
|
||||
- fix: update `frameguard` header name in readme
|
||||
|
||||
- remove: module aliases. There is now just one way to include each middleware
|
||||
- remove: `frameguard` can no longer be initialized with strings; you must use an object
|
||||
|
||||
1.3.0 / 2016-03-01
|
||||
==================
|
||||
|
||||
- new: `hpkp` has a `setIf` option to conditionally set the header
|
||||
|
||||
1.2.0 / 2016-02-29
|
||||
==================
|
||||
|
||||
- new: `csp` now has a `browserSniff` option to disable all user-agent sniffing
|
||||
|
||||
- update: `frameguard` can now be initialized with options
|
||||
- update: add `npmignore` file to speed up installs slightly
|
||||
|
||||
1.1.0 / 2016-01-12
|
||||
==================
|
||||
|
||||
- new: code of conduct
|
||||
- new: `dnsPrefetchControl` middleware
|
||||
|
||||
- fix: `csp` readme had syntax errors
|
||||
|
||||
1.0.2 / 2016-01-08
|
||||
==================
|
||||
|
||||
- fix: `csp` wouldn't recognize `IE Mobile` browsers
|
||||
- fix: `csp` had some errors in its readme
|
||||
- fix: main readme had a syntax error
|
||||
|
||||
1.0.1 / 2015-12-19
|
||||
==================
|
||||
|
||||
- fix: `csp` with no User Agent would cause errors
|
||||
|
||||
1.0.0 / 2015-12-18
|
||||
==================
|
||||
|
||||
- new: `csp` module supports dynamically-generated values
|
||||
|
||||
- update: `csp` directives are now under the `directives` key
|
||||
- update: `hpkp`'s `Report-Only` header is now opt-in, not opt-out
|
||||
- update: tweak readmes of every sub-repo
|
||||
|
||||
- fix: old Firefox Content-Security-Policy behavior for `unsafe-inline` and `unsafe-eval`
|
||||
- fix: dynamic `csp` policies is no longer recursive
|
||||
|
||||
- remove: `crossdomain` middleware
|
||||
- remove: `csp` no longer throws errors when some directives aren't quoted (`'self'`, for example)
|
||||
- remove: `maxage` option in the `hpkp` middleware
|
||||
- remove: `safari5` option from `csp` module
|
||||
|
||||
0.15.0 / 2015-11-26
|
||||
===================
|
||||
|
||||
- update: `hpkp` allows a `report-uri` without the `Report-Only` header
|
||||
|
||||
0.14.0 / 2015-11-01
|
||||
===================
|
||||
|
||||
- new: `nocache` now sends the `Surrogate-Control` header
|
||||
|
||||
- update: `nocache` no longer contains the `private` directive in the `Cache-Control` header
|
||||
|
||||
0.13.0 / 2015-10-23
|
||||
===================
|
||||
|
||||
- new: `xssFilter` now has a function name
|
||||
|
||||
- update: add new CSP docs to readme
|
||||
- update: HSTS option renamed from `includeSubdomains` to `includeSubDomains`
|
||||
|
||||
0.11.0 / 2015-09-18
|
||||
===================
|
||||
|
||||
- new: `csp` now supports Microsoft Edge
|
||||
- new: CSP Level 2 support
|
||||
|
||||
- update: `connect` to 3.4.0
|
||||
- update: `depd` to 1.1.0
|
||||
|
||||
- fix: add `license` key to `csp`'s `package.json`
|
||||
- fix: empty `csp` directives support every directive, not just `sandbox`
|
||||
|
||||
0.10.0 / 2015-07-08
|
||||
===================
|
||||
|
||||
- new: add "Handling CSP violations" to `csp` readme
|
||||
- new: add license to `package.json`
|
||||
|
||||
- update: `hpkp` had a link to the wrong place in its readme
|
||||
- update: `hpkp` requires 2 or more pins
|
||||
|
||||
- fix: `hpkp` might have miscalculated `maxAge` slightly wrong
|
||||
|
||||
0.9.0 / 2015-04-24
|
||||
==================
|
||||
|
||||
- update: `nocache` adds `private` to its `Cache-Control` directive
|
||||
- update: `package.json` description
|
||||
|
||||
0.8.0 / 2015-04-21
|
||||
==================
|
||||
|
||||
- update: deprecate `crossdomain` middleware
|
||||
- update: remove hefty Lodash dependency from HSTS and CSP
|
||||
- update: update string detection module in Frameguard
|
||||
- update: change readme slightly to better reflect project's focus
|
||||
|
||||
- remove: `crossdomain` is no longer a default middleware
|
||||
|
||||
0.7.1 / 2015-03-23
|
||||
==================
|
||||
|
||||
- update: all outdated dependencies (insofar as possible)
|
||||
- update: HSTS now uses Lodash like all the rest of the libraries
|
||||
|
||||
0.7.0 / 2015-03-05
|
||||
==================
|
||||
|
||||
- new: `hpkp` middleware
|
||||
|
||||
- update: Travis CI should test 0.10 and 0.12
|
||||
- update: minor code cleanup
|
||||
|
||||
0.6.2 / 2015-03-01
|
||||
==================
|
||||
|
||||
- update: improve `xssFilter` performance
|
||||
- update: Lodash versions
|
||||
|
||||
0.6.1 / 2015-02-13
|
||||
==================
|
||||
|
||||
- new: "Other recommended modules" in README
|
||||
|
||||
- update: Lodash version
|
||||
|
||||
- fix: `frameguard` middleware exported a function called `xframe`
|
||||
|
||||
0.6.0 / 2015-01-21
|
||||
==================
|
||||
|
||||
- new: you can disable `csp` for Android
|
||||
|
||||
- fix: `csp` on Chrome Mobile on Android and iOS
|
||||
|
||||
0.5.4 / 2014-12-21
|
||||
==================
|
||||
|
||||
- update: `nocache` should force revalidation
|
||||
|
||||
0.5.3 / 2014-12-08
|
||||
==================
|
||||
|
||||
- update: Platform version in CSP and X-XSS-Protection
|
||||
|
||||
- fix: bad wording in frameguard docs
|
||||
|
||||
0.5.2 / 2014-11-16
|
||||
==================
|
||||
|
||||
- update: Connect version
|
||||
- update: Sinon version
|
||||
|
||||
- fix: minor `csp` bugfixes
|
||||
|
||||
0.5.1 / 2014-11-09
|
||||
==================
|
||||
|
||||
- new: Travis CI for everyone
|
||||
|
||||
- update: URLs in `package.json` for new URL
|
||||
|
||||
- fix: CSP would set all headers forever after receiving an unknown user agent
|
||||
|
||||
0.5.0 / 2014-10-28
|
||||
==================
|
||||
|
||||
- new: most middlewares have some aliases now
|
||||
|
||||
- update: `xframe` now called `frameguard` (though `xframe` still works)
|
||||
- update: `frameguard` chooses sameorigin by default
|
||||
- update: `frameguard` understands "SAME-ORIGIN" in addition to "SAMEORIGIN"
|
||||
- update: `nocache` removed from default middleware stack
|
||||
- update: middleware split out into their own modules
|
||||
- update: documentation
|
||||
- update: supported Node version to at least 0.10.0
|
||||
- update: Connect version
|
||||
|
||||
- fix: readme link was broken
|
||||
|
||||
- remove: deprecation warnings
|
||||
|
||||
0.4.2 / 2014-10-16
|
||||
==================
|
||||
|
||||
- new: support preload in HSTS header
|
||||
|
||||
0.4.1 / 2014-08-24
|
||||
==================
|
||||
|
||||
- update: use [helmet-crossdomain](https://github.com/helmetjs/crossdomain) to test the waters
|
||||
- update: 2 spaces instead of 4 throughout the code
|
||||
|
||||
0.4.0 / 2014-07-17
|
||||
==================
|
||||
|
||||
- new: nocache now sets the Expires and Pragma headers
|
||||
- new: nocache now allows you to crush ETags
|
||||
|
||||
- update: improve the docs for nosniff
|
||||
- update: revert HSTS behavior of requiring a specified max-age
|
||||
|
||||
- fix: allow HSTS to have a max-age of 0
|
||||
|
||||
0.3.2 / 2014-06-30
|
||||
==================
|
||||
|
||||
- new: all middleware functions are named
|
||||
- new: throw error with non-positive HSTS max-age
|
||||
|
||||
- update: add semicolons in README
|
||||
- update: make some Errors more specific
|
||||
|
||||
- fix: `helmet()` was having issues
|
||||
- fix: syntax errors in README
|
||||
|
||||
- remove: all comment headers; refer to the readme
|
||||
|
||||
0.3.1
|
||||
=====
|
||||
|
||||
This file was started after the release of 0.3.1.
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2012-2019 Evan Hahn, Adam Baldwin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
Helmet
|
||||
======
|
||||
[](http://badge.fury.io/js/helmet)
|
||||
[](https://david-dm.org/helmetjs/helmet)
|
||||
[](https://travis-ci.org/helmetjs/helmet)
|
||||
[](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fhelmetjs%2Fhelmet?ref=badge_shield)
|
||||
|
||||
Helmet helps you secure your Express apps by setting various HTTP headers. *It's not a silver bullet*, but it can help!
|
||||
|
||||
[Looking for a version of Helmet that supports the Koa framework?](https://github.com/venables/koa-helmet)
|
||||
|
||||
Quick start
|
||||
-----------
|
||||
|
||||
First, run `npm install helmet --save` for your app. Then, in an Express (or Connect) app:
|
||||
|
||||
```js
|
||||
const express = require('express')
|
||||
const helmet = require('helmet')
|
||||
|
||||
const app = express()
|
||||
|
||||
app.use(helmet())
|
||||
|
||||
// ...
|
||||
```
|
||||
|
||||
It's best to `use` Helmet early in your middleware stack so that its headers are sure to be set.
|
||||
|
||||
You can also use its pieces individually:
|
||||
|
||||
```js
|
||||
app.use(helmet.noCache())
|
||||
app.use(helmet.frameguard())
|
||||
```
|
||||
|
||||
You can disable a middleware that's normally enabled by default. This will disable `frameguard` but include the other defaults.
|
||||
|
||||
```js
|
||||
app.use(helmet({
|
||||
frameguard: false
|
||||
}))
|
||||
```
|
||||
|
||||
You can also set options for a middleware. Setting options like this will *always* include the middleware, whether or not it's a default.
|
||||
|
||||
```js
|
||||
app.use(helmet({
|
||||
frameguard: {
|
||||
action: 'deny'
|
||||
}
|
||||
}))
|
||||
```
|
||||
|
||||
*If you're using Express 3, make sure these middlewares are listed before `app.router`.*
|
||||
|
||||
How it works
|
||||
------------
|
||||
|
||||
Helmet is a collection of 14 smaller middleware functions that set HTTP response headers. Running `app.use(helmet())` will not include all of these middleware functions by default.
|
||||
|
||||
| Module | Default? |
|
||||
|---|---|
|
||||
| [contentSecurityPolicy](https://helmetjs.github.io/docs/csp/) for setting Content Security Policy | |
|
||||
| [crossdomain](https://helmetjs.github.io/docs/crossdomain/) for handling Adobe products' crossdomain requests | |
|
||||
| [dnsPrefetchControl](https://helmetjs.github.io/docs/dns-prefetch-control) controls browser DNS prefetching | ✓ |
|
||||
| [expectCt](https://helmetjs.github.io/docs/expect-ct/) for handling Certificate Transparency | |
|
||||
| [featurePolicy](https://helmetjs.github.io/docs/feature-policy/) to limit your site's features | |
|
||||
| [frameguard](https://helmetjs.github.io/docs/frameguard/) to prevent clickjacking | ✓ |
|
||||
| [hidePoweredBy](https://helmetjs.github.io/docs/hide-powered-by) to remove the X-Powered-By header | ✓ |
|
||||
| [hpkp](https://helmetjs.github.io/docs/hpkp/) for HTTP Public Key Pinning | |
|
||||
| [hsts](https://helmetjs.github.io/docs/hsts/) for HTTP Strict Transport Security | ✓ |
|
||||
| [ieNoOpen](https://helmetjs.github.io/docs/ienoopen) sets X-Download-Options for IE8+ | ✓ |
|
||||
| [noCache](https://helmetjs.github.io/docs/nocache/) to disable client-side caching | |
|
||||
| [noSniff](https://helmetjs.github.io/docs/dont-sniff-mimetype) to keep clients from sniffing the MIME type | ✓ |
|
||||
| [referrerPolicy](https://helmetjs.github.io/docs/referrer-policy) to hide the Referer header | |
|
||||
| [xssFilter](https://helmetjs.github.io/docs/xss-filter) adds some small XSS protections | ✓ |
|
||||
|
||||
You can see more in [the documentation](https://helmetjs.github.io/docs/).
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
# Security Issue Reporting & Disclosure Process
|
||||
|
||||
If you feel you have found a security issue or concern with Helmet please email the maintainers.
|
||||
|
||||
Email Evan Hahn at <me@evanhahn.com> or Adam Baldwin at <baldwin@andyet.net>.
|
||||
|
||||
## Expectations
|
||||
We will do everything we can to communicate in a timely manner and address your concerns, but realize that we do have day jobs and this is in open source project so have a little patience if you don't hear back from us immediatly.
|
||||
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
var deprecate = require('depd')('helmet')
|
||||
|
||||
var DEFAULT_MIDDLEWARE = [
|
||||
'dnsPrefetchControl',
|
||||
'frameguard',
|
||||
'hidePoweredBy',
|
||||
'hsts',
|
||||
'ieNoOpen',
|
||||
'noSniff',
|
||||
'xssFilter'
|
||||
]
|
||||
|
||||
var middlewares
|
||||
function helmet (options) {
|
||||
options = options || {}
|
||||
|
||||
if (options.constructor.name === 'IncomingMessage') {
|
||||
throw new Error('It appears you have done something like `app.use(helmet)`, but it should be `app.use(helmet())`.')
|
||||
}
|
||||
|
||||
var stack = middlewares.reduce(function (result, middlewareName) {
|
||||
var middleware = helmet[middlewareName]
|
||||
var middlewareOptions = options[middlewareName]
|
||||
var isDefault = DEFAULT_MIDDLEWARE.indexOf(middlewareName) !== -1
|
||||
|
||||
if (middlewareOptions === false) {
|
||||
return result
|
||||
} else if (middlewareOptions === true) {
|
||||
middlewareOptions = {}
|
||||
}
|
||||
|
||||
if (middlewareOptions != null) {
|
||||
return result.concat(middleware(middlewareOptions))
|
||||
} else if (isDefault) {
|
||||
return result.concat(middleware({}))
|
||||
}
|
||||
return result
|
||||
}, [])
|
||||
|
||||
return function helmet (req, res, next) {
|
||||
var index = 0
|
||||
|
||||
function internalNext () {
|
||||
if (arguments.length > 0) { return next.apply(null, arguments) }
|
||||
|
||||
var middleware = stack[index]
|
||||
if (!middleware) { return next() }
|
||||
|
||||
index++
|
||||
|
||||
middleware(req, res, internalNext)
|
||||
}
|
||||
|
||||
internalNext()
|
||||
}
|
||||
}
|
||||
|
||||
helmet.contentSecurityPolicy = require('helmet-csp')
|
||||
helmet.dnsPrefetchControl = require('dns-prefetch-control')
|
||||
helmet.expectCt = require('expect-ct')
|
||||
helmet.featurePolicy = require('feature-policy')
|
||||
helmet.frameguard = require('frameguard')
|
||||
helmet.hidePoweredBy = require('hide-powered-by')
|
||||
helmet.hsts = require('hsts')
|
||||
helmet.ieNoOpen = require('ienoopen')
|
||||
helmet.noCache = require('nocache')
|
||||
helmet.noSniff = require('dont-sniff-mimetype')
|
||||
helmet.permittedCrossDomainPolicies = require('helmet-crossdomain')
|
||||
helmet.referrerPolicy = require('referrer-policy')
|
||||
helmet.xssFilter = require('x-xss-protection')
|
||||
|
||||
helmet.hpkp = deprecate.function(require('hpkp'), 'helmet.hpkp is deprecated and will be removed in helmet@4. You can use the `hpkp` module instead. For more, see https://github.com/helmetjs/helmet/issues/180.')
|
||||
|
||||
middlewares = Object.keys(helmet)
|
||||
|
||||
module.exports = helmet
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
2.0.0 / 2018-10-26
|
||||
==================
|
||||
|
||||
* Drop support for Node.js 0.6
|
||||
* Replace internal `eval` usage with `Function` constructor
|
||||
* Use instance methods on `process` to check for listeners
|
||||
|
||||
1.1.2 / 2018-01-11
|
||||
==================
|
||||
|
||||
* perf: remove argument reassignment
|
||||
* Support Node.js 0.6 to 9.x
|
||||
|
||||
1.1.1 / 2017-07-27
|
||||
==================
|
||||
|
||||
* Remove unnecessary `Buffer` loading
|
||||
* Support Node.js 0.6 to 8.x
|
||||
|
||||
1.1.0 / 2015-09-14
|
||||
==================
|
||||
|
||||
* Enable strict mode in more places
|
||||
* Support io.js 3.x
|
||||
* Support io.js 2.x
|
||||
* Support web browser loading
|
||||
- Requires bundler like Browserify or webpack
|
||||
|
||||
1.0.1 / 2015-04-07
|
||||
==================
|
||||
|
||||
* Fix `TypeError`s when under `'use strict'` code
|
||||
* Fix useless type name on auto-generated messages
|
||||
* Support io.js 1.x
|
||||
* Support Node.js 0.12
|
||||
|
||||
1.0.0 / 2014-09-17
|
||||
==================
|
||||
|
||||
* No changes
|
||||
|
||||
0.4.5 / 2014-09-09
|
||||
==================
|
||||
|
||||
* Improve call speed to functions using the function wrapper
|
||||
* Support Node.js 0.6
|
||||
|
||||
0.4.4 / 2014-07-27
|
||||
==================
|
||||
|
||||
* Work-around v8 generating empty stack traces
|
||||
|
||||
0.4.3 / 2014-07-26
|
||||
==================
|
||||
|
||||
* Fix exception when global `Error.stackTraceLimit` is too low
|
||||
|
||||
0.4.2 / 2014-07-19
|
||||
==================
|
||||
|
||||
* Correct call site for wrapped functions and properties
|
||||
|
||||
0.4.1 / 2014-07-19
|
||||
==================
|
||||
|
||||
* Improve automatic message generation for function properties
|
||||
|
||||
0.4.0 / 2014-07-19
|
||||
==================
|
||||
|
||||
* Add `TRACE_DEPRECATION` environment variable
|
||||
* Remove non-standard grey color from color output
|
||||
* Support `--no-deprecation` argument
|
||||
* Support `--trace-deprecation` argument
|
||||
* Support `deprecate.property(fn, prop, message)`
|
||||
|
||||
0.3.0 / 2014-06-16
|
||||
==================
|
||||
|
||||
* Add `NO_DEPRECATION` environment variable
|
||||
|
||||
0.2.0 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Add `deprecate.property(obj, prop, message)`
|
||||
* Remove `supports-color` dependency for node.js 0.8
|
||||
|
||||
0.1.0 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Add `deprecate.function(fn, message)`
|
||||
* Add `process.on('deprecation', fn)` emitter
|
||||
* Automatically generate message when omitted from `deprecate()`
|
||||
|
||||
0.0.1 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Fix warning for dynamic calls at singe call site
|
||||
|
||||
0.0.0 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Initial implementation
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014-2018 Douglas Christopher Wilson
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
+280
@@ -0,0 +1,280 @@
|
||||
# depd
|
||||
|
||||
[![NPM Version][npm-version-image]][npm-url]
|
||||
[![NPM Downloads][npm-downloads-image]][npm-url]
|
||||
[![Node.js Version][node-image]][node-url]
|
||||
[![Linux Build][travis-image]][travis-url]
|
||||
[![Windows Build][appveyor-image]][appveyor-url]
|
||||
[![Coverage Status][coveralls-image]][coveralls-url]
|
||||
|
||||
Deprecate all the things
|
||||
|
||||
> With great modules comes great responsibility; mark things deprecated!
|
||||
|
||||
## Install
|
||||
|
||||
This module is installed directly using `npm`:
|
||||
|
||||
```sh
|
||||
$ npm install depd
|
||||
```
|
||||
|
||||
This module can also be bundled with systems like
|
||||
[Browserify](http://browserify.org/) or [webpack](https://webpack.github.io/),
|
||||
though by default this module will alter it's API to no longer display or
|
||||
track deprecations.
|
||||
|
||||
## API
|
||||
|
||||
<!-- eslint-disable no-unused-vars -->
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-module')
|
||||
```
|
||||
|
||||
This library allows you to display deprecation messages to your users.
|
||||
This library goes above and beyond with deprecation warnings by
|
||||
introspection of the call stack (but only the bits that it is interested
|
||||
in).
|
||||
|
||||
Instead of just warning on the first invocation of a deprecated
|
||||
function and never again, this module will warn on the first invocation
|
||||
of a deprecated function per unique call site, making it ideal to alert
|
||||
users of all deprecated uses across the code base, rather than just
|
||||
whatever happens to execute first.
|
||||
|
||||
The deprecation warnings from this module also include the file and line
|
||||
information for the call into the module that the deprecated function was
|
||||
in.
|
||||
|
||||
**NOTE** this library has a similar interface to the `debug` module, and
|
||||
this module uses the calling file to get the boundary for the call stacks,
|
||||
so you should always create a new `deprecate` object in each file and not
|
||||
within some central file.
|
||||
|
||||
### depd(namespace)
|
||||
|
||||
Create a new deprecate function that uses the given namespace name in the
|
||||
messages and will display the call site prior to the stack entering the
|
||||
file this function was called from. It is highly suggested you use the
|
||||
name of your module as the namespace.
|
||||
|
||||
### deprecate(message)
|
||||
|
||||
Call this function from deprecated code to display a deprecation message.
|
||||
This message will appear once per unique caller site. Caller site is the
|
||||
first call site in the stack in a different file from the caller of this
|
||||
function.
|
||||
|
||||
If the message is omitted, a message is generated for you based on the site
|
||||
of the `deprecate()` call and will display the name of the function called,
|
||||
similar to the name displayed in a stack trace.
|
||||
|
||||
### deprecate.function(fn, message)
|
||||
|
||||
Call this function to wrap a given function in a deprecation message on any
|
||||
call to the function. An optional message can be supplied to provide a custom
|
||||
message.
|
||||
|
||||
### deprecate.property(obj, prop, message)
|
||||
|
||||
Call this function to wrap a given property on object in a deprecation message
|
||||
on any accessing or setting of the property. An optional message can be supplied
|
||||
to provide a custom message.
|
||||
|
||||
The method must be called on the object where the property belongs (not
|
||||
inherited from the prototype).
|
||||
|
||||
If the property is a data descriptor, it will be converted to an accessor
|
||||
descriptor in order to display the deprecation message.
|
||||
|
||||
### process.on('deprecation', fn)
|
||||
|
||||
This module will allow easy capturing of deprecation errors by emitting the
|
||||
errors as the type "deprecation" on the global `process`. If there are no
|
||||
listeners for this type, the errors are written to STDERR as normal, but if
|
||||
there are any listeners, nothing will be written to STDERR and instead only
|
||||
emitted. From there, you can write the errors in a different format or to a
|
||||
logging source.
|
||||
|
||||
The error represents the deprecation and is emitted only once with the same
|
||||
rules as writing to STDERR. The error has the following properties:
|
||||
|
||||
- `message` - This is the message given by the library
|
||||
- `name` - This is always `'DeprecationError'`
|
||||
- `namespace` - This is the namespace the deprecation came from
|
||||
- `stack` - This is the stack of the call to the deprecated thing
|
||||
|
||||
Example `error.stack` output:
|
||||
|
||||
```
|
||||
DeprecationError: my-cool-module deprecated oldfunction
|
||||
at Object.<anonymous> ([eval]-wrapper:6:22)
|
||||
at Module._compile (module.js:456:26)
|
||||
at evalScript (node.js:532:25)
|
||||
at startup (node.js:80:7)
|
||||
at node.js:902:3
|
||||
```
|
||||
|
||||
### process.env.NO_DEPRECATION
|
||||
|
||||
As a user of modules that are deprecated, the environment variable `NO_DEPRECATION`
|
||||
is provided as a quick solution to silencing deprecation warnings from being
|
||||
output. The format of this is similar to that of `DEBUG`:
|
||||
|
||||
```sh
|
||||
$ NO_DEPRECATION=my-module,othermod node app.js
|
||||
```
|
||||
|
||||
This will suppress deprecations from being output for "my-module" and "othermod".
|
||||
The value is a list of comma-separated namespaces. To suppress every warning
|
||||
across all namespaces, use the value `*` for a namespace.
|
||||
|
||||
Providing the argument `--no-deprecation` to the `node` executable will suppress
|
||||
all deprecations (only available in Node.js 0.8 or higher).
|
||||
|
||||
**NOTE** This will not suppress the deperecations given to any "deprecation"
|
||||
event listeners, just the output to STDERR.
|
||||
|
||||
### process.env.TRACE_DEPRECATION
|
||||
|
||||
As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION`
|
||||
is provided as a solution to getting more detailed location information in deprecation
|
||||
warnings by including the entire stack trace. The format of this is the same as
|
||||
`NO_DEPRECATION`:
|
||||
|
||||
```sh
|
||||
$ TRACE_DEPRECATION=my-module,othermod node app.js
|
||||
```
|
||||
|
||||
This will include stack traces for deprecations being output for "my-module" and
|
||||
"othermod". The value is a list of comma-separated namespaces. To trace every
|
||||
warning across all namespaces, use the value `*` for a namespace.
|
||||
|
||||
Providing the argument `--trace-deprecation` to the `node` executable will trace
|
||||
all deprecations (only available in Node.js 0.8 or higher).
|
||||
|
||||
**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`.
|
||||
|
||||
## Display
|
||||
|
||||

|
||||
|
||||
When a user calls a function in your library that you mark deprecated, they
|
||||
will see the following written to STDERR (in the given colors, similar colors
|
||||
and layout to the `debug` module):
|
||||
|
||||
```
|
||||
bright cyan bright yellow
|
||||
| | reset cyan
|
||||
| | | |
|
||||
▼ ▼ ▼ ▼
|
||||
my-cool-module deprecated oldfunction [eval]-wrapper:6:22
|
||||
▲ ▲ ▲ ▲
|
||||
| | | |
|
||||
namespace | | location of mycoolmod.oldfunction() call
|
||||
| deprecation message
|
||||
the word "deprecated"
|
||||
```
|
||||
|
||||
If the user redirects their STDERR to a file or somewhere that does not support
|
||||
colors, they see (similar layout to the `debug` module):
|
||||
|
||||
```
|
||||
Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22
|
||||
▲ ▲ ▲ ▲ ▲
|
||||
| | | | |
|
||||
timestamp of message namespace | | location of mycoolmod.oldfunction() call
|
||||
| deprecation message
|
||||
the word "deprecated"
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### Deprecating all calls to a function
|
||||
|
||||
This will display a deprecated message about "oldfunction" being deprecated
|
||||
from "my-module" on STDERR.
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
// message automatically derived from function name
|
||||
// Object.oldfunction
|
||||
exports.oldfunction = deprecate.function(function oldfunction () {
|
||||
// all calls to function are deprecated
|
||||
})
|
||||
|
||||
// specific message
|
||||
exports.oldfunction = deprecate.function(function () {
|
||||
// all calls to function are deprecated
|
||||
}, 'oldfunction')
|
||||
```
|
||||
|
||||
### Conditionally deprecating a function call
|
||||
|
||||
This will display a deprecated message about "weirdfunction" being deprecated
|
||||
from "my-module" on STDERR when called with less than 2 arguments.
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
exports.weirdfunction = function () {
|
||||
if (arguments.length < 2) {
|
||||
// calls with 0 or 1 args are deprecated
|
||||
deprecate('weirdfunction args < 2')
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
When calling `deprecate` as a function, the warning is counted per call site
|
||||
within your own module, so you can display different deprecations depending
|
||||
on different situations and the users will still get all the warnings:
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
exports.weirdfunction = function () {
|
||||
if (arguments.length < 2) {
|
||||
// calls with 0 or 1 args are deprecated
|
||||
deprecate('weirdfunction args < 2')
|
||||
} else if (typeof arguments[0] !== 'string') {
|
||||
// calls with non-string first argument are deprecated
|
||||
deprecate('weirdfunction non-string first arg')
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Deprecating property access
|
||||
|
||||
This will display a deprecated message about "oldprop" being deprecated
|
||||
from "my-module" on STDERR when accessed. A deprecation will be displayed
|
||||
when setting the value and when getting the value.
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
exports.oldprop = 'something'
|
||||
|
||||
// message automatically derives from property name
|
||||
deprecate.property(exports, 'oldprop')
|
||||
|
||||
// explicit message
|
||||
deprecate.property(exports, 'oldprop', 'oldprop >= 0.10')
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/nodejs-depd/master?label=windows
|
||||
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd
|
||||
[coveralls-image]: https://badgen.net/coveralls/c/github/dougwilson/nodejs-depd/master
|
||||
[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master
|
||||
[node-image]: https://badgen.net/npm/node/depd
|
||||
[node-url]: https://nodejs.org/en/download/
|
||||
[npm-downloads-image]: https://badgen.net/npm/dm/depd
|
||||
[npm-url]: https://npmjs.org/package/depd
|
||||
[npm-version-image]: https://badgen.net/npm/v/depd
|
||||
[travis-image]: https://badgen.net/travis/dougwilson/nodejs-depd/master?label=linux
|
||||
[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd
|
||||
+538
@@ -0,0 +1,538 @@
|
||||
/*!
|
||||
* depd
|
||||
* Copyright(c) 2014-2018 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var relative = require('path').relative
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = depd
|
||||
|
||||
/**
|
||||
* Get the path to base files on.
|
||||
*/
|
||||
|
||||
var basePath = process.cwd()
|
||||
|
||||
/**
|
||||
* Determine if namespace is contained in the string.
|
||||
*/
|
||||
|
||||
function containsNamespace (str, namespace) {
|
||||
var vals = str.split(/[ ,]+/)
|
||||
var ns = String(namespace).toLowerCase()
|
||||
|
||||
for (var i = 0; i < vals.length; i++) {
|
||||
var val = vals[i]
|
||||
|
||||
// namespace contained
|
||||
if (val && (val === '*' || val.toLowerCase() === ns)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a data descriptor to accessor descriptor.
|
||||
*/
|
||||
|
||||
function convertDataDescriptorToAccessor (obj, prop, message) {
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
||||
var value = descriptor.value
|
||||
|
||||
descriptor.get = function getter () { return value }
|
||||
|
||||
if (descriptor.writable) {
|
||||
descriptor.set = function setter (val) { return (value = val) }
|
||||
}
|
||||
|
||||
delete descriptor.value
|
||||
delete descriptor.writable
|
||||
|
||||
Object.defineProperty(obj, prop, descriptor)
|
||||
|
||||
return descriptor
|
||||
}
|
||||
|
||||
/**
|
||||
* Create arguments string to keep arity.
|
||||
*/
|
||||
|
||||
function createArgumentsString (arity) {
|
||||
var str = ''
|
||||
|
||||
for (var i = 0; i < arity; i++) {
|
||||
str += ', arg' + i
|
||||
}
|
||||
|
||||
return str.substr(2)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create stack string from stack.
|
||||
*/
|
||||
|
||||
function createStackString (stack) {
|
||||
var str = this.name + ': ' + this.namespace
|
||||
|
||||
if (this.message) {
|
||||
str += ' deprecated ' + this.message
|
||||
}
|
||||
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
str += '\n at ' + stack[i].toString()
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
/**
|
||||
* Create deprecate for namespace in caller.
|
||||
*/
|
||||
|
||||
function depd (namespace) {
|
||||
if (!namespace) {
|
||||
throw new TypeError('argument namespace is required')
|
||||
}
|
||||
|
||||
var stack = getStack()
|
||||
var site = callSiteLocation(stack[1])
|
||||
var file = site[0]
|
||||
|
||||
function deprecate (message) {
|
||||
// call to self as log
|
||||
log.call(deprecate, message)
|
||||
}
|
||||
|
||||
deprecate._file = file
|
||||
deprecate._ignored = isignored(namespace)
|
||||
deprecate._namespace = namespace
|
||||
deprecate._traced = istraced(namespace)
|
||||
deprecate._warned = Object.create(null)
|
||||
|
||||
deprecate.function = wrapfunction
|
||||
deprecate.property = wrapproperty
|
||||
|
||||
return deprecate
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if event emitter has listeners of a given type.
|
||||
*
|
||||
* The way to do this check is done three different ways in Node.js >= 0.8
|
||||
* so this consolidates them into a minimal set using instance methods.
|
||||
*
|
||||
* @param {EventEmitter} emitter
|
||||
* @param {string} type
|
||||
* @returns {boolean}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function eehaslisteners (emitter, type) {
|
||||
var count = typeof emitter.listenerCount !== 'function'
|
||||
? emitter.listeners(type).length
|
||||
: emitter.listenerCount(type)
|
||||
|
||||
return count > 0
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if namespace is ignored.
|
||||
*/
|
||||
|
||||
function isignored (namespace) {
|
||||
if (process.noDeprecation) {
|
||||
// --no-deprecation support
|
||||
return true
|
||||
}
|
||||
|
||||
var str = process.env.NO_DEPRECATION || ''
|
||||
|
||||
// namespace ignored
|
||||
return containsNamespace(str, namespace)
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if namespace is traced.
|
||||
*/
|
||||
|
||||
function istraced (namespace) {
|
||||
if (process.traceDeprecation) {
|
||||
// --trace-deprecation support
|
||||
return true
|
||||
}
|
||||
|
||||
var str = process.env.TRACE_DEPRECATION || ''
|
||||
|
||||
// namespace traced
|
||||
return containsNamespace(str, namespace)
|
||||
}
|
||||
|
||||
/**
|
||||
* Display deprecation message.
|
||||
*/
|
||||
|
||||
function log (message, site) {
|
||||
var haslisteners = eehaslisteners(process, 'deprecation')
|
||||
|
||||
// abort early if no destination
|
||||
if (!haslisteners && this._ignored) {
|
||||
return
|
||||
}
|
||||
|
||||
var caller
|
||||
var callFile
|
||||
var callSite
|
||||
var depSite
|
||||
var i = 0
|
||||
var seen = false
|
||||
var stack = getStack()
|
||||
var file = this._file
|
||||
|
||||
if (site) {
|
||||
// provided site
|
||||
depSite = site
|
||||
callSite = callSiteLocation(stack[1])
|
||||
callSite.name = depSite.name
|
||||
file = callSite[0]
|
||||
} else {
|
||||
// get call site
|
||||
i = 2
|
||||
depSite = callSiteLocation(stack[i])
|
||||
callSite = depSite
|
||||
}
|
||||
|
||||
// get caller of deprecated thing in relation to file
|
||||
for (; i < stack.length; i++) {
|
||||
caller = callSiteLocation(stack[i])
|
||||
callFile = caller[0]
|
||||
|
||||
if (callFile === file) {
|
||||
seen = true
|
||||
} else if (callFile === this._file) {
|
||||
file = this._file
|
||||
} else if (seen) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
var key = caller
|
||||
? depSite.join(':') + '__' + caller.join(':')
|
||||
: undefined
|
||||
|
||||
if (key !== undefined && key in this._warned) {
|
||||
// already warned
|
||||
return
|
||||
}
|
||||
|
||||
this._warned[key] = true
|
||||
|
||||
// generate automatic message from call site
|
||||
var msg = message
|
||||
if (!msg) {
|
||||
msg = callSite === depSite || !callSite.name
|
||||
? defaultMessage(depSite)
|
||||
: defaultMessage(callSite)
|
||||
}
|
||||
|
||||
// emit deprecation if listeners exist
|
||||
if (haslisteners) {
|
||||
var err = DeprecationError(this._namespace, msg, stack.slice(i))
|
||||
process.emit('deprecation', err)
|
||||
return
|
||||
}
|
||||
|
||||
// format and write message
|
||||
var format = process.stderr.isTTY
|
||||
? formatColor
|
||||
: formatPlain
|
||||
var output = format.call(this, msg, caller, stack.slice(i))
|
||||
process.stderr.write(output + '\n', 'utf8')
|
||||
}
|
||||
|
||||
/**
|
||||
* Get call site location as array.
|
||||
*/
|
||||
|
||||
function callSiteLocation (callSite) {
|
||||
var file = callSite.getFileName() || '<anonymous>'
|
||||
var line = callSite.getLineNumber()
|
||||
var colm = callSite.getColumnNumber()
|
||||
|
||||
if (callSite.isEval()) {
|
||||
file = callSite.getEvalOrigin() + ', ' + file
|
||||
}
|
||||
|
||||
var site = [file, line, colm]
|
||||
|
||||
site.callSite = callSite
|
||||
site.name = callSite.getFunctionName()
|
||||
|
||||
return site
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a default message from the site.
|
||||
*/
|
||||
|
||||
function defaultMessage (site) {
|
||||
var callSite = site.callSite
|
||||
var funcName = site.name
|
||||
|
||||
// make useful anonymous name
|
||||
if (!funcName) {
|
||||
funcName = '<anonymous@' + formatLocation(site) + '>'
|
||||
}
|
||||
|
||||
var context = callSite.getThis()
|
||||
var typeName = context && callSite.getTypeName()
|
||||
|
||||
// ignore useless type name
|
||||
if (typeName === 'Object') {
|
||||
typeName = undefined
|
||||
}
|
||||
|
||||
// make useful type name
|
||||
if (typeName === 'Function') {
|
||||
typeName = context.name || typeName
|
||||
}
|
||||
|
||||
return typeName && callSite.getMethodName()
|
||||
? typeName + '.' + funcName
|
||||
: funcName
|
||||
}
|
||||
|
||||
/**
|
||||
* Format deprecation message without color.
|
||||
*/
|
||||
|
||||
function formatPlain (msg, caller, stack) {
|
||||
var timestamp = new Date().toUTCString()
|
||||
|
||||
var formatted = timestamp +
|
||||
' ' + this._namespace +
|
||||
' deprecated ' + msg
|
||||
|
||||
// add stack trace
|
||||
if (this._traced) {
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
formatted += '\n at ' + stack[i].toString()
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
if (caller) {
|
||||
formatted += ' at ' + formatLocation(caller)
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
/**
|
||||
* Format deprecation message with color.
|
||||
*/
|
||||
|
||||
function formatColor (msg, caller, stack) {
|
||||
var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan
|
||||
' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow
|
||||
' \x1b[0m' + msg + '\x1b[39m' // reset
|
||||
|
||||
// add stack trace
|
||||
if (this._traced) {
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
formatted += '\n \x1b[36mat ' + stack[i].toString() + '\x1b[39m' // cyan
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
if (caller) {
|
||||
formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
/**
|
||||
* Format call site location.
|
||||
*/
|
||||
|
||||
function formatLocation (callSite) {
|
||||
return relative(basePath, callSite[0]) +
|
||||
':' + callSite[1] +
|
||||
':' + callSite[2]
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the stack as array of call sites.
|
||||
*/
|
||||
|
||||
function getStack () {
|
||||
var limit = Error.stackTraceLimit
|
||||
var obj = {}
|
||||
var prep = Error.prepareStackTrace
|
||||
|
||||
Error.prepareStackTrace = prepareObjectStackTrace
|
||||
Error.stackTraceLimit = Math.max(10, limit)
|
||||
|
||||
// capture the stack
|
||||
Error.captureStackTrace(obj)
|
||||
|
||||
// slice this function off the top
|
||||
var stack = obj.stack.slice(1)
|
||||
|
||||
Error.prepareStackTrace = prep
|
||||
Error.stackTraceLimit = limit
|
||||
|
||||
return stack
|
||||
}
|
||||
|
||||
/**
|
||||
* Capture call site stack from v8.
|
||||
*/
|
||||
|
||||
function prepareObjectStackTrace (obj, stack) {
|
||||
return stack
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a wrapped function in a deprecation message.
|
||||
*/
|
||||
|
||||
function wrapfunction (fn, message) {
|
||||
if (typeof fn !== 'function') {
|
||||
throw new TypeError('argument fn must be a function')
|
||||
}
|
||||
|
||||
var args = createArgumentsString(fn.length)
|
||||
var stack = getStack()
|
||||
var site = callSiteLocation(stack[1])
|
||||
|
||||
site.name = fn.name
|
||||
|
||||
// eslint-disable-next-line no-new-func
|
||||
var deprecatedfn = new Function('fn', 'log', 'deprecate', 'message', 'site',
|
||||
'"use strict"\n' +
|
||||
'return function (' + args + ') {' +
|
||||
'log.call(deprecate, message, site)\n' +
|
||||
'return fn.apply(this, arguments)\n' +
|
||||
'}')(fn, log, this, message, site)
|
||||
|
||||
return deprecatedfn
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap property in a deprecation message.
|
||||
*/
|
||||
|
||||
function wrapproperty (obj, prop, message) {
|
||||
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
throw new TypeError('argument obj must be object')
|
||||
}
|
||||
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
||||
|
||||
if (!descriptor) {
|
||||
throw new TypeError('must call property on owner object')
|
||||
}
|
||||
|
||||
if (!descriptor.configurable) {
|
||||
throw new TypeError('property must be configurable')
|
||||
}
|
||||
|
||||
var deprecate = this
|
||||
var stack = getStack()
|
||||
var site = callSiteLocation(stack[1])
|
||||
|
||||
// set site name
|
||||
site.name = prop
|
||||
|
||||
// convert data descriptor
|
||||
if ('value' in descriptor) {
|
||||
descriptor = convertDataDescriptorToAccessor(obj, prop, message)
|
||||
}
|
||||
|
||||
var get = descriptor.get
|
||||
var set = descriptor.set
|
||||
|
||||
// wrap getter
|
||||
if (typeof get === 'function') {
|
||||
descriptor.get = function getter () {
|
||||
log.call(deprecate, message, site)
|
||||
return get.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
|
||||
// wrap setter
|
||||
if (typeof set === 'function') {
|
||||
descriptor.set = function setter () {
|
||||
log.call(deprecate, message, site)
|
||||
return set.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
|
||||
Object.defineProperty(obj, prop, descriptor)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create DeprecationError for deprecation
|
||||
*/
|
||||
|
||||
function DeprecationError (namespace, message, stack) {
|
||||
var error = new Error()
|
||||
var stackString
|
||||
|
||||
Object.defineProperty(error, 'constructor', {
|
||||
value: DeprecationError
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'message', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: message,
|
||||
writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'name', {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
value: 'DeprecationError',
|
||||
writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'namespace', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: namespace,
|
||||
writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'stack', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
get: function () {
|
||||
if (stackString !== undefined) {
|
||||
return stackString
|
||||
}
|
||||
|
||||
// prepare stack trace
|
||||
return (stackString = createStackString.call(this, stack))
|
||||
},
|
||||
set: function setter (val) {
|
||||
stackString = val
|
||||
}
|
||||
})
|
||||
|
||||
return error
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
/*!
|
||||
* depd
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = depd
|
||||
|
||||
/**
|
||||
* Create deprecate for namespace in caller.
|
||||
*/
|
||||
|
||||
function depd (namespace) {
|
||||
if (!namespace) {
|
||||
throw new TypeError('argument namespace is required')
|
||||
}
|
||||
|
||||
function deprecate (message) {
|
||||
// no-op in browser
|
||||
}
|
||||
|
||||
deprecate._file = undefined
|
||||
deprecate._ignored = true
|
||||
deprecate._namespace = namespace
|
||||
deprecate._traced = false
|
||||
deprecate._warned = Object.create(null)
|
||||
|
||||
deprecate.function = wrapfunction
|
||||
deprecate.property = wrapproperty
|
||||
|
||||
return deprecate
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a wrapped function in a deprecation message.
|
||||
*
|
||||
* This is a no-op version of the wrapper, which does nothing but call
|
||||
* validation.
|
||||
*/
|
||||
|
||||
function wrapfunction (fn, message) {
|
||||
if (typeof fn !== 'function') {
|
||||
throw new TypeError('argument fn must be a function')
|
||||
}
|
||||
|
||||
return fn
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap property in a deprecation message.
|
||||
*
|
||||
* This is a no-op version of the wrapper, which does nothing but call
|
||||
* validation.
|
||||
*/
|
||||
|
||||
function wrapproperty (obj, prop, message) {
|
||||
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
throw new TypeError('argument obj must be object')
|
||||
}
|
||||
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
||||
|
||||
if (!descriptor) {
|
||||
throw new TypeError('must call property on owner object')
|
||||
}
|
||||
|
||||
if (!descriptor.configurable) {
|
||||
throw new TypeError('property must be configurable')
|
||||
}
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"raw": "depd@2.0.0",
|
||||
"scope": null,
|
||||
"escapedName": "depd",
|
||||
"name": "depd",
|
||||
"rawSpec": "2.0.0",
|
||||
"spec": "2.0.0",
|
||||
"type": "version"
|
||||
},
|
||||
"/Users/gerrit/Documents/dev/nodejs/rentfor.camp/html/RentForCamp/node_modules/helmet"
|
||||
]
|
||||
],
|
||||
"_from": "depd@2.0.0",
|
||||
"_hasShrinkwrap": false,
|
||||
"_id": "depd@2.0.0",
|
||||
"_inCache": true,
|
||||
"_location": "/helmet/depd",
|
||||
"_nodeVersion": "8.12.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "s3://npm-registry-packages",
|
||||
"tmp": "tmp/depd_2.0.0_1540576375784_0.14703351463172942"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "dougwilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
"_npmVersion": "6.4.1",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "depd@2.0.0",
|
||||
"scope": null,
|
||||
"escapedName": "depd",
|
||||
"name": "depd",
|
||||
"rawSpec": "2.0.0",
|
||||
"spec": "2.0.0",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/helmet"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
|
||||
"_shasum": "b696163cc757560d09cf22cc8fad1571b79e76df",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "depd@2.0.0",
|
||||
"_where": "/Users/gerrit/Documents/dev/nodejs/rentfor.camp/html/RentForCamp/node_modules/helmet",
|
||||
"author": {
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
"browser": "lib/browser/index.js",
|
||||
"bugs": {
|
||||
"url": "https://github.com/dougwilson/nodejs-depd/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Deprecate all the things",
|
||||
"devDependencies": {
|
||||
"beautify-benchmark": "0.2.4",
|
||||
"benchmark": "2.1.4",
|
||||
"eslint": "5.7.0",
|
||||
"eslint-config-standard": "12.0.0",
|
||||
"eslint-plugin-import": "2.14.0",
|
||||
"eslint-plugin-markdown": "1.0.0-beta.7",
|
||||
"eslint-plugin-node": "7.0.1",
|
||||
"eslint-plugin-promise": "4.0.1",
|
||||
"eslint-plugin-standard": "4.0.0",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "5.2.0",
|
||||
"safe-buffer": "5.1.2",
|
||||
"uid-safe": "2.1.5"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
|
||||
"shasum": "b696163cc757560d09cf22cc8fad1571b79e76df",
|
||||
"tarball": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
|
||||
"fileCount": 6,
|
||||
"unpackedSize": 27117,
|
||||
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb01R4CRA9TVsSAnZWagAArWcP/jPqhJPVwB4A7UlP7Z79\nKmkIJRegTXb8sBTkFdL8t5TDikX47CViz3qWSktGdJnwY4q/GnLHeOr/+eq6\nXVvkSKLrpOdmDBYbf7DxVepxbWOLVSCAshlnw6XPXhcqOKd2smn1CPA/hgRj\n26YvwMECmyIlcE5RgubUvN4qqOyMhGF7muWjCbqRq3qcGK7hXUqEnrlHxHsY\ndKCnzRw0HbfxYX2QynmyRL1Y9ynQuq2ucTDxuhQf78ElkHAsbSYaEks9unYG\nWGhU8zH4TGOcLrmJ6GsKhZk22JvnxCg3zwgqLwks2EFiG1iojPD4EkjZgcnJ\nt8meOu2nT8JCa6fNpPMWUpYO1aUKmhoOb5KGyMhSsNX/DND+ndSu0kOP9gU1\nCetsBqRTHHH3jUK/NmyAvzMO0X8mk/FxzI+NTqKQKt8r2/Y5IW4A6oDkaRkr\nPSu1s1DpT5mw9gHBA7K0YKuVr6HwQVnd/1io+OyUmNarjXm2lMaXucpZG3+Q\ncWpj4FyrD0vf+/bV9LKTXee3qAJ9UEGNvhJAKUrGTR8vtdM6uMxLnsBe42hR\nsRM2dJ8KnMujdw+lH+sgjtqcYP/G1Gz2cRtfbVWTrc/olODQPBpu2ycIY0nc\ncejka3bMbVHzYaY7+ho/9SfbE/6x9LRlmcHSEiPzUHRSpYY3pskktQDM0bBo\nm15/\r\n=BUpb\r\n-----END PGP SIGNATURE-----\r\n"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
},
|
||||
"gitHead": "6d59c85d093092e65ec77033576417d743079fa0",
|
||||
"homepage": "https://github.com/dougwilson/nodejs-depd#readme",
|
||||
"keywords": [
|
||||
"deprecate",
|
||||
"deprecated"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "dougwilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
}
|
||||
],
|
||||
"name": "depd",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/dougwilson/nodejs-depd.git"
|
||||
},
|
||||
"scripts": {
|
||||
"bench": "node benchmark/index.js",
|
||||
"lint": "eslint --plugin markdown --ext js,md .",
|
||||
"test": "mocha --reporter spec --bail test/",
|
||||
"test-ci": "istanbul cover --print=none node_modules/mocha/bin/_mocha -- --reporter spec test/ && istanbul report lcovonly text-summary",
|
||||
"test-cov": "istanbul cover --print=none node_modules/mocha/bin/_mocha -- --reporter dot test/ && istanbul report lcov text-summary"
|
||||
},
|
||||
"version": "2.0.0"
|
||||
}
|
||||
+147
@@ -0,0 +1,147 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"raw": "helmet",
|
||||
"scope": null,
|
||||
"escapedName": "helmet",
|
||||
"name": "helmet",
|
||||
"rawSpec": "",
|
||||
"spec": "latest",
|
||||
"type": "tag"
|
||||
},
|
||||
"/Users/gerrit/Documents/dev/nodejs/rentfor.camp/html/RentForCamp"
|
||||
]
|
||||
],
|
||||
"_from": "helmet@latest",
|
||||
"_hasShrinkwrap": false,
|
||||
"_id": "helmet@3.15.1",
|
||||
"_inCache": true,
|
||||
"_location": "/helmet",
|
||||
"_nodeVersion": "11.9.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "s3://npm-registry-packages",
|
||||
"tmp": "tmp/helmet_3.15.1_1549820553436_0.5799217996177721"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "evanhahn",
|
||||
"email": "me@evanhahn.com"
|
||||
},
|
||||
"_npmVersion": "6.5.0",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "helmet",
|
||||
"scope": null,
|
||||
"escapedName": "helmet",
|
||||
"name": "helmet",
|
||||
"rawSpec": "",
|
||||
"spec": "latest",
|
||||
"type": "tag"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/helmet/-/helmet-3.15.1.tgz",
|
||||
"_shasum": "2c80d1a59138b6f23929605afca4b1c88b3298ec",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "helmet",
|
||||
"_where": "/Users/gerrit/Documents/dev/nodejs/rentfor.camp/html/RentForCamp",
|
||||
"author": {
|
||||
"name": "Adam Baldwin",
|
||||
"email": "baldwin@andyet.net",
|
||||
"url": "http://andyet.net/team/baldwin"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/helmetjs/helmet/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Evan Hahn",
|
||||
"email": "me@evanhahn.com",
|
||||
"url": "https://evanhahn.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"depd": "2.0.0",
|
||||
"dns-prefetch-control": "0.1.0",
|
||||
"dont-sniff-mimetype": "1.0.0",
|
||||
"expect-ct": "0.1.1",
|
||||
"feature-policy": "0.2.0",
|
||||
"frameguard": "3.0.0",
|
||||
"helmet-crossdomain": "0.3.0",
|
||||
"helmet-csp": "2.7.1",
|
||||
"hide-powered-by": "1.0.0",
|
||||
"hpkp": "2.0.0",
|
||||
"hsts": "2.1.0",
|
||||
"ienoopen": "1.0.0",
|
||||
"nocache": "2.0.0",
|
||||
"referrer-policy": "1.1.0",
|
||||
"x-xss-protection": "1.1.0"
|
||||
},
|
||||
"description": "help secure Express/Connect apps with various HTTP headers",
|
||||
"devDependencies": {
|
||||
"connect": "^3.6.6",
|
||||
"mocha": "^5.2.0",
|
||||
"sinon": "^7.2.3",
|
||||
"standard": "^12.0.1",
|
||||
"supertest": "^3.4.2"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"integrity": "sha512-hgoNe/sjKlKNvJ3g9Gz149H14BjMMWOCmW/DTXl7IfyKGtIK37GePwZrHNfr4aPXdKVyXcTj26RgRFbPKDy9lw==",
|
||||
"shasum": "2c80d1a59138b6f23929605afca4b1c88b3298ec",
|
||||
"tarball": "https://registry.npmjs.org/helmet/-/helmet-3.15.1.tgz",
|
||||
"fileCount": 6,
|
||||
"unpackedSize": 19323,
|
||||
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcYGKKCRA9TVsSAnZWagAAP6wP/irm1S8g7/KIJR3g1Zk6\nTxxBFaruK2UdPYPkW/qmVGmcUHYU5d/naQJfdXZgrYqLG4f6mRPTFDDt0JPJ\n63514exGudOfHq2jFxvj/r1mRYpo87cy1vNoj1qQa+8l52m/tMK0fvbqsORq\nsJ0dYb9OASe23S+4FFPJg8cY0NnX8RSFvLs0y3iiYY16B6IrFalffmsvC5Kq\nUr0M6Fw4te//KMQkLhmFSv/uigIqYQlC4ga3PJuzNg4vvoK1v/LJAjnNru//\nnHSEKpH1+5V/sxm3ZMMGy2YVJ8aIdq01Nu6NrIvfwdK6QhZtbBdsHYAwqglJ\ncbAPgvCwyqjZnTTPkygY7xKMV5rSnaosuJImrahJXvBWDCCRUE1G1sQZzCub\nvqITdGo0SoJ9uhxy15K+mDx4kf6WK1B7WebgY04NSZVGJMs3POKVqD4K3OeO\nmcwR+asKuaWIjlaxUrBcFaGtgylpjt8MdF/Z5Zz5jFicsGNlHl5WzBopVV/y\nkJbs9NsUv1+72DJ/iY8yCyYODF/xPgHeQWsNsQkH/socwLKnwY1l++/TNVPq\nq69U4QJbYEXeZ9sAEKGuoUEhVG1B9FoWEiRfcpBUbV82+iwLpHvamnDXY/1g\nC7zuXagIZlsAYTXiU9uVR5Np+e4ijnJPvX2SF2LNChmqF4cntBS3XlLlIU8N\nxKZK\r\n=e1gq\r\n-----END PGP SIGNATURE-----\r\n"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10.0"
|
||||
},
|
||||
"gitHead": "f545a949646ae291f65e286989e5508504e29cb2",
|
||||
"homepage": "https://helmetjs.github.io/",
|
||||
"keywords": [
|
||||
"security",
|
||||
"headers",
|
||||
"express",
|
||||
"connect",
|
||||
"x-frame-options",
|
||||
"x-powered-by",
|
||||
"csp",
|
||||
"hsts",
|
||||
"clickjack"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "adam_baldwin",
|
||||
"email": "baldwin@andyet.net"
|
||||
},
|
||||
{
|
||||
"name": "evanhahn",
|
||||
"email": "me@evanhahn.com"
|
||||
}
|
||||
],
|
||||
"name": "helmet",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/helmetjs/helmet.git"
|
||||
},
|
||||
"scripts": {
|
||||
"pretest": "standard --fix",
|
||||
"test": "mocha"
|
||||
},
|
||||
"standard": {
|
||||
"globals": [
|
||||
"describe",
|
||||
"it",
|
||||
"beforeEach",
|
||||
"afterEach"
|
||||
]
|
||||
},
|
||||
"version": "3.15.1"
|
||||
}
|
||||
Reference in New Issue
Block a user