0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

53
web/node_modules/internal-ip/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,53 @@
interface v6 {
/**
* @returns The IPv6 address of the internet-facing interface, as determined from the default gateway. When the address cannot be determined for any reason, `null` will be returned.
*
* @example
*
* console.log(await internalIp.v6());
* //=> 'fe80::1'
*/
(): Promise<string>;
/**
* @returns The IPv6 address of the internet-facing interface, as determined from the default gateway. When the address cannot be determined for any reason, `null` will be returned.
*
* @example
*
* console.log(internalIp.v6.sync());
* //=> 'fe80::1'
*/
sync(): string;
}
interface v4 {
/**
* @returns The IPv4 address of the internet-facing interface, as determined from the default gateway. When the address cannot be determined for any reason, `null` will be returned.
*
* @example
*
* console.log(await internalIp.v4())
* //=> '10.0.0.79'
*/
(): Promise<string>;
/**
* @returns The IPv4 address of the internet-facing interface, as determined from the default gateway. When the address cannot be determined for any reason, `null` will be returned.
*
* @example
*
* console.log(internalIp.v4.sync())
* //=> '10.0.0.79'
*/
sync(): string;
}
declare const internalIp: {
v6: v6;
v4: v4;
// TODO: Remove this for the next major release
default: typeof internalIp;
};
export = internalIp;

51
web/node_modules/internal-ip/index.js generated vendored Normal file
View file

@ -0,0 +1,51 @@
'use strict';
const os = require('os');
const defaultGateway = require('default-gateway');
const ipaddr = require('ipaddr.js');
function findIp(gateway) {
const interfaces = os.networkInterfaces();
const gatewayIp = ipaddr.parse(gateway);
let ip;
// Look for the matching interface in all local interfaces
Object.keys(interfaces).some(name => {
return interfaces[name].some(addr => {
const prefix = ipaddr.parse(addr.netmask).prefixLengthFromSubnetMask();
const net = ipaddr.parseCIDR(`${addr.address}/${prefix}`);
if (net[0] && net[0].kind() === gatewayIp.kind() && gatewayIp.match(net)) {
ip = net[0].toString();
}
return Boolean(ip);
});
});
return ip;
}
function promise(family) {
return defaultGateway[family]().then(result => {
return findIp(result.gateway) || null;
}).catch(() => null);
}
function sync(family) {
try {
const result = defaultGateway[family].sync();
return findIp(result.gateway) || null;
} catch (error) {
return null;
}
}
const internalIp = {};
internalIp.v6 = () => promise('v6');
internalIp.v4 = () => promise('v4');
internalIp.v6.sync = () => sync('v6');
internalIp.v4.sync = () => sync('v4');
module.exports = internalIp;
// TODO: Remove this for the next major release
module.exports.default = internalIp;

9
web/node_modules/internal-ip/license generated vendored Normal file
View file

@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
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.

43
web/node_modules/internal-ip/package.json generated vendored Normal file
View file

@ -0,0 +1,43 @@
{
"name": "internal-ip",
"version": "4.3.0",
"description": "Get your internal IP address",
"license": "MIT",
"repository": "sindresorhus/internal-ip",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=6"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"ip",
"ipv6",
"ipv4",
"address",
"internal",
"local",
"machine",
"system",
"net",
"gateway"
],
"dependencies": {
"default-gateway": "^4.2.0",
"ipaddr.js": "^1.9.0"
},
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}

47
web/node_modules/internal-ip/readme.md generated vendored Normal file
View file

@ -0,0 +1,47 @@
# internal-ip [![Build Status](https://travis-ci.org/sindresorhus/internal-ip.svg?branch=master)](https://travis-ci.org/sindresorhus/internal-ip)
> Get your internal IP address
## Install
```
$ npm install internal-ip
```
## Usage
```js
const internalIp = require('internal-ip');
(async () => {
console.log(await internalIp.v6());
//=> 'fe80::1'
console.log(await internalIp.v4());
//=> '10.0.0.79'
})();
console.log(internalIp.v6.sync())
//=> 'fe80::1'
console.log(internalIp.v4.sync())
//=> '10.0.0.79'
```
The module returns the address of the internet-facing interface, as determined from the default gateway. When the address cannot be determined for any reason, `null` will be returned.
The module relies on operating systems tools. On Linux and Android, the `ip` command must be available, which depending on distribution might not be installed by default. It is usually provided by the `iproute2` package.
## Related
- [internal-ip-cli](https://github.com/sindresorhus/internal-ip-cli) - CLI for this module
- [public-ip](https://github.com/sindresorhus/public-ip) - Get your public IP address
- [default-gateway](https://github.com/silverwind/default-gateway) - Get your default gateway address
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)