forked from enviPath/enviPy
Current Dev State
This commit is contained in:
31
static/js/ketcher2/node_modules/internal-ip/cli.js
generated
vendored
Executable file
31
static/js/ketcher2/node_modules/internal-ip/cli.js
generated
vendored
Executable file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env node
|
||||
/* eslint-disable no-nested-ternary */
|
||||
'use strict';
|
||||
var meow = require('meow');
|
||||
var internalIp = require('./');
|
||||
|
||||
var cli = meow({
|
||||
help: [
|
||||
'Usage',
|
||||
' $ internal-ip',
|
||||
'',
|
||||
'Options',
|
||||
' -4, --ipv4 Return the IPv4 address (default)',
|
||||
' -6, --ipv6 Return the IPv6 address',
|
||||
'',
|
||||
'Examples',
|
||||
' $ internal-ip',
|
||||
' 192.168.0.123',
|
||||
' $ internal-ip --ipv6',
|
||||
' fe80::200:f8ff:fe21:67cf'
|
||||
]
|
||||
}, {
|
||||
alias: {
|
||||
4: 'ipv4',
|
||||
6: 'ipv6'
|
||||
}
|
||||
});
|
||||
|
||||
var fn = cli.flags.ipv4 ? 'v4' : cli.flags.ipv6 ? 'v6' : 'v4';
|
||||
|
||||
console.log(internalIp[fn]());
|
||||
41
static/js/ketcher2/node_modules/internal-ip/index.js
generated
vendored
Normal file
41
static/js/ketcher2/node_modules/internal-ip/index.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
'use strict';
|
||||
var os = require('os');
|
||||
|
||||
var type = {
|
||||
v4: {
|
||||
def: '127.0.0.1',
|
||||
family: 'IPv4'
|
||||
},
|
||||
v6: {
|
||||
def: '::1',
|
||||
family: 'IPv6'
|
||||
}
|
||||
};
|
||||
|
||||
function internalIp(version) {
|
||||
var options = type[version];
|
||||
var ret = options.def;
|
||||
var interfaces = os.networkInterfaces();
|
||||
|
||||
Object.keys(interfaces).forEach(function (el) {
|
||||
interfaces[el].forEach(function (el2) {
|
||||
if (!el2.internal && el2.family === options.family) {
|
||||
ret = el2.address;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
function v4() {
|
||||
return internalIp('v4');
|
||||
}
|
||||
|
||||
function v6() {
|
||||
return internalIp('v6');
|
||||
}
|
||||
|
||||
module.exports = v4;
|
||||
module.exports.v4 = v4;
|
||||
module.exports.v6 = v6;
|
||||
21
static/js/ketcher2/node_modules/internal-ip/license
generated
vendored
Normal file
21
static/js/ketcher2/node_modules/internal-ip/license
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
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.
|
||||
77
static/js/ketcher2/node_modules/internal-ip/package.json
generated
vendored
Normal file
77
static/js/ketcher2/node_modules/internal-ip/package.json
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
{
|
||||
"_from": "internal-ip@^1.0.1",
|
||||
"_id": "internal-ip@1.2.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-rp+/k7mEh4eF1QqN4bNWlWBYz1w=",
|
||||
"_location": "/internal-ip",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "internal-ip@^1.0.1",
|
||||
"name": "internal-ip",
|
||||
"escapedName": "internal-ip",
|
||||
"rawSpec": "^1.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/budo"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-1.2.0.tgz",
|
||||
"_shasum": "ae9fbf93b984878785d50a8de1b356956058cf5c",
|
||||
"_spec": "internal-ip@^1.0.1",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/budo",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bin": {
|
||||
"internal-ip": "cli.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/internal-ip/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"meow": "^3.3.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Get your internal IPv4 or IPv6 address",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"is-ip": "^1.0.0",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"cli.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/internal-ip#readme",
|
||||
"keywords": [
|
||||
"cli-app",
|
||||
"cli",
|
||||
"bin",
|
||||
"ip",
|
||||
"ipv4",
|
||||
"ipv6",
|
||||
"address",
|
||||
"internal",
|
||||
"local",
|
||||
"machine"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "internal-ip",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/internal-ip.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "1.2.0"
|
||||
}
|
||||
54
static/js/ketcher2/node_modules/internal-ip/readme.md
generated
vendored
Normal file
54
static/js/ketcher2/node_modules/internal-ip/readme.md
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
# internal-ip [](https://travis-ci.org/sindresorhus/internal-ip)
|
||||
|
||||
> Get your internal IPv4 or IPv6 address
|
||||
|
||||
|
||||
## CLI
|
||||
|
||||
```
|
||||
$ npm install --global internal-ip
|
||||
```
|
||||
|
||||
```
|
||||
$ internal-ip --help
|
||||
|
||||
Usage
|
||||
$ internal-ip
|
||||
|
||||
Options
|
||||
-4, --ipv4 Return the IPv4 address (default)
|
||||
-6, --ipv6 Return the IPv6 address
|
||||
|
||||
Example
|
||||
$ internal-ip
|
||||
192.168.0.123
|
||||
$ internal-ip -6
|
||||
fe80::200:f8ff:fe21:67cf
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
```
|
||||
$ npm install --save internal-ip
|
||||
```
|
||||
|
||||
```js
|
||||
var internalIp = require('internal-ip');
|
||||
|
||||
internalIp.v4();
|
||||
//=> '192.168.0.123'
|
||||
|
||||
internalIp.v6();
|
||||
//=> 'fe80::200:f8ff:fe21:67cf'
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
See [public-ip](https://github.com/sindresorhus/public-ip) or [ipify](https://github.com/sindresorhus/ipify) to get your external IP address.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
Reference in New Issue
Block a user