🐛 Update: Added support for the 'find' command in settings.local.json. Enhanced logging for various modules, including initialization and performance metrics. Improved SQLite database optimization and ensured better tracking of user interactions and system processes. 📚
This commit is contained in:
21
network-visualization/node_modules/on-headers/HISTORY.md
generated
vendored
Normal file
21
network-visualization/node_modules/on-headers/HISTORY.md
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
1.0.2 / 2019-02-21
|
||||
==================
|
||||
|
||||
* Fix `res.writeHead` patch missing return value
|
||||
|
||||
1.0.1 / 2015-09-29
|
||||
==================
|
||||
|
||||
* perf: enable strict mode
|
||||
|
||||
1.0.0 / 2014-08-10
|
||||
==================
|
||||
|
||||
* Honor `res.statusCode` change in `listener`
|
||||
* Move to `jshttp` organization
|
||||
* Prevent `arguments`-related de-opt
|
||||
|
||||
0.0.0 / 2014-05-13
|
||||
==================
|
||||
|
||||
* Initial implementation
|
22
network-visualization/node_modules/on-headers/LICENSE
generated
vendored
Normal file
22
network-visualization/node_modules/on-headers/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 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.
|
81
network-visualization/node_modules/on-headers/README.md
generated
vendored
Normal file
81
network-visualization/node_modules/on-headers/README.md
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
# on-headers
|
||||
|
||||
[![NPM Version][npm-version-image]][npm-url]
|
||||
[![NPM Downloads][npm-downloads-image]][npm-url]
|
||||
[![Node.js Version][node-version-image]][node-version-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
Execute a listener when a response is about to write headers.
|
||||
|
||||
## Installation
|
||||
|
||||
This is a [Node.js](https://nodejs.org/en/) module available through the
|
||||
[npm registry](https://www.npmjs.com/). Installation is done using the
|
||||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
||||
|
||||
```sh
|
||||
$ npm install on-headers
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
<!-- eslint-disable no-unused-vars -->
|
||||
|
||||
```js
|
||||
var onHeaders = require('on-headers')
|
||||
```
|
||||
|
||||
### onHeaders(res, listener)
|
||||
|
||||
This will add the listener `listener` to fire when headers are emitted for `res`.
|
||||
The listener is passed the `response` object as it's context (`this`). Headers are
|
||||
considered to be emitted only once, right before they are sent to the client.
|
||||
|
||||
When this is called multiple times on the same `res`, the `listener`s are fired
|
||||
in the reverse order they were added.
|
||||
|
||||
## Examples
|
||||
|
||||
```js
|
||||
var http = require('http')
|
||||
var onHeaders = require('on-headers')
|
||||
|
||||
http
|
||||
.createServer(onRequest)
|
||||
.listen(3000)
|
||||
|
||||
function addPoweredBy () {
|
||||
// set if not set by end of request
|
||||
if (!this.getHeader('X-Powered-By')) {
|
||||
this.setHeader('X-Powered-By', 'Node.js')
|
||||
}
|
||||
}
|
||||
|
||||
function onRequest (req, res) {
|
||||
onHeaders(res, addPoweredBy)
|
||||
|
||||
res.setHeader('Content-Type', 'text/plain')
|
||||
res.end('hello!')
|
||||
}
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
```sh
|
||||
$ npm test
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/on-headers/master
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/on-headers?branch=master
|
||||
[node-version-image]: https://badgen.net/npm/node/on-headers
|
||||
[node-version-url]: https://nodejs.org/en/download
|
||||
[npm-downloads-image]: https://badgen.net/npm/dm/on-headers
|
||||
[npm-url]: https://npmjs.org/package/on-headers
|
||||
[npm-version-image]: https://badgen.net/npm/v/on-headers
|
||||
[travis-image]: https://badgen.net/travis/jshttp/on-headers/master
|
||||
[travis-url]: https://travis-ci.org/jshttp/on-headers
|
132
network-visualization/node_modules/on-headers/index.js
generated
vendored
Normal file
132
network-visualization/node_modules/on-headers/index.js
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
/*!
|
||||
* on-headers
|
||||
* Copyright(c) 2014 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = onHeaders
|
||||
|
||||
/**
|
||||
* Create a replacement writeHead method.
|
||||
*
|
||||
* @param {function} prevWriteHead
|
||||
* @param {function} listener
|
||||
* @private
|
||||
*/
|
||||
|
||||
function createWriteHead (prevWriteHead, listener) {
|
||||
var fired = false
|
||||
|
||||
// return function with core name and argument list
|
||||
return function writeHead (statusCode) {
|
||||
// set headers from arguments
|
||||
var args = setWriteHeadHeaders.apply(this, arguments)
|
||||
|
||||
// fire listener
|
||||
if (!fired) {
|
||||
fired = true
|
||||
listener.call(this)
|
||||
|
||||
// pass-along an updated status code
|
||||
if (typeof args[0] === 'number' && this.statusCode !== args[0]) {
|
||||
args[0] = this.statusCode
|
||||
args.length = 1
|
||||
}
|
||||
}
|
||||
|
||||
return prevWriteHead.apply(this, args)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a listener when a response is about to write headers.
|
||||
*
|
||||
* @param {object} res
|
||||
* @return {function} listener
|
||||
* @public
|
||||
*/
|
||||
|
||||
function onHeaders (res, listener) {
|
||||
if (!res) {
|
||||
throw new TypeError('argument res is required')
|
||||
}
|
||||
|
||||
if (typeof listener !== 'function') {
|
||||
throw new TypeError('argument listener must be a function')
|
||||
}
|
||||
|
||||
res.writeHead = createWriteHead(res.writeHead, listener)
|
||||
}
|
||||
|
||||
/**
|
||||
* Set headers contained in array on the response object.
|
||||
*
|
||||
* @param {object} res
|
||||
* @param {array} headers
|
||||
* @private
|
||||
*/
|
||||
|
||||
function setHeadersFromArray (res, headers) {
|
||||
for (var i = 0; i < headers.length; i++) {
|
||||
res.setHeader(headers[i][0], headers[i][1])
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set headers contained in object on the response object.
|
||||
*
|
||||
* @param {object} res
|
||||
* @param {object} headers
|
||||
* @private
|
||||
*/
|
||||
|
||||
function setHeadersFromObject (res, headers) {
|
||||
var keys = Object.keys(headers)
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
var k = keys[i]
|
||||
if (k) res.setHeader(k, headers[k])
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set headers and other properties on the response object.
|
||||
*
|
||||
* @param {number} statusCode
|
||||
* @private
|
||||
*/
|
||||
|
||||
function setWriteHeadHeaders (statusCode) {
|
||||
var length = arguments.length
|
||||
var headerIndex = length > 1 && typeof arguments[1] === 'string'
|
||||
? 2
|
||||
: 1
|
||||
|
||||
var headers = length >= headerIndex + 1
|
||||
? arguments[headerIndex]
|
||||
: undefined
|
||||
|
||||
this.statusCode = statusCode
|
||||
|
||||
if (Array.isArray(headers)) {
|
||||
// handle array case
|
||||
setHeadersFromArray(this, headers)
|
||||
} else if (headers) {
|
||||
// handle object case
|
||||
setHeadersFromObject(this, headers)
|
||||
}
|
||||
|
||||
// copy leading arguments
|
||||
var args = new Array(Math.min(length, headerIndex))
|
||||
for (var i = 0; i < args.length; i++) {
|
||||
args[i] = arguments[i]
|
||||
}
|
||||
|
||||
return args
|
||||
}
|
42
network-visualization/node_modules/on-headers/package.json
generated
vendored
Normal file
42
network-visualization/node_modules/on-headers/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "on-headers",
|
||||
"description": "Execute a listener when a response is about to write headers",
|
||||
"version": "1.0.2",
|
||||
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"event",
|
||||
"headers",
|
||||
"http",
|
||||
"onheaders"
|
||||
],
|
||||
"repository": "jshttp/on-headers",
|
||||
"devDependencies": {
|
||||
"eslint": "5.14.1",
|
||||
"eslint-config-standard": "12.0.0",
|
||||
"eslint-plugin-import": "2.16.0",
|
||||
"eslint-plugin-markdown": "1.0.0",
|
||||
"eslint-plugin-node": "8.0.1",
|
||||
"eslint-plugin-promise": "4.0.1",
|
||||
"eslint-plugin-standard": "4.0.0",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "6.0.1",
|
||||
"supertest": "3.4.2"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"HISTORY.md",
|
||||
"README.md",
|
||||
"index.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint --plugin markdown --ext js,md .",
|
||||
"test": "mocha --reporter spec --bail --check-leaks test/",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
|
||||
"version": "node scripts/version-history.js && git add HISTORY.md"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user