Comparing version 1.2.0 to 1.2.1
1.2.1 / 2022-09-13 | ||
================== | ||
**fixes** | ||
* [[`c316a04`](http://github.com/node-modules/address/commit/c316a044aedeadf438c2c2a7278d51f0861df8af)] - fix: local addresses should be ignored on interface (#32) (Jon Kelley <<jkelleyrtp@gmail.com>>) | ||
**others** | ||
* [[`823b70c`](http://github.com/node-modules/address/commit/823b70c2f53ab96d6e25041aa444436d906c59ef)] - 🤖 TEST: Run test on GitHub action (#27) (fengmk2 <<fengmk2@gmail.com>>) | ||
* [[`2b5fb44`](http://github.com/node-modules/address/commit/2b5fb44ca1ff1a0d64768e8d42845ec377b9e3f8)] - Create codeql-analysis.yml (fengmk2 <<fengmk2@gmail.com>>) | ||
1.2.0 / 2022-04-29 | ||
@@ -3,0 +13,0 @@ ================== |
@@ -89,3 +89,3 @@ 'use strict'; | ||
if (noName) { | ||
// filter 127.0.0.1, get the first ip | ||
// filter all loopback or local addresses | ||
for (var k in interfaces) { | ||
@@ -95,3 +95,4 @@ var items = interfaces[k]; | ||
var item = items[i]; | ||
if (matchName(item.family, family) && item.address !== '127.0.0.1') { | ||
// all 127 addresses are local and should be ignored | ||
if (matchName(item.family, family) && !item.address.startsWith('127.')) { | ||
return item; | ||
@@ -98,0 +99,0 @@ } |
This software is licensed under the MIT License. | ||
Copyright (C) 2013 - 2014 fengmk2 <fengmk2@gmail.com> | ||
Copyright (C) 2015 - 2016 node-modules | ||
Copyright (C) 2015 - present node-modules and other contributors. | ||
@@ -6,0 +6,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
{ | ||
"name": "address", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Get current machine IP, MAC and DNS servers.", | ||
@@ -11,7 +11,4 @@ "main": "lib/address.js", | ||
"scripts": { | ||
"test": "mocha --check-leaks -R spec -t 5000 test/*.test.js", | ||
"test-cov": "istanbul cover node_modules/.bin/_mocha -- --check-leaks -t 5000 test/*.test.js", | ||
"test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- --check-leaks -t 5000 test/*.test.js", | ||
"benchmark": "matcha", | ||
"autod": "autod -w --prefix '^'", | ||
"test": "egg-bin test", | ||
"ci": "egg-bin cov", | ||
"contributors": "git-contributor" | ||
@@ -22,12 +19,7 @@ }, | ||
"@types/node": "^12.7.2", | ||
"beautify-benchmark": "*", | ||
"benchmark": "*", | ||
"egg-bin": "^4.19.0", | ||
"egg-ci": "^2.1.0", | ||
"git-contributor": "^1.1.0", | ||
"istanbul": "*", | ||
"matcha": "*", | ||
"mm": "*", | ||
"mocha": "*", | ||
"pedding": "*", | ||
"runscript": "^1.4.0", | ||
"should": "*", | ||
"typescript": "^3.5.3" | ||
@@ -48,4 +40,9 @@ }, | ||
}, | ||
"ci": { | ||
"version": "14, 16, 18", | ||
"type": "github", | ||
"os": "linux, macos" | ||
}, | ||
"author": "fengmk2 <fengmk2@gmail.com>", | ||
"license": "MIT" | ||
} |
@@ -5,6 +5,4 @@ address | ||
[![NPM version][npm-image]][npm-url] | ||
[![build status][travis-image]][travis-url] | ||
[![Node.js CI](https://github.com/node-modules/address/actions/workflows/nodejs.yml/badge.svg)](https://github.com/node-modules/address/actions/workflows/nodejs.yml) | ||
[![Test coverage][coveralls-image]][coveralls-url] | ||
[![Gittip][gittip-image]][gittip-url] | ||
[![David deps][david-image]][david-url] | ||
[![npm download][download-image]][download-url] | ||
@@ -14,10 +12,4 @@ | ||
[npm-url]: https://npmjs.org/package/address | ||
[travis-image]: https://img.shields.io/travis/node-modules/address.svg?style=flat-square | ||
[travis-url]: https://travis-ci.org/node-modules/address | ||
[coveralls-image]: https://img.shields.io/coveralls/node-modules/address.svg?style=flat-square | ||
[coveralls-url]: https://coveralls.io/r/node-modules/address?branch=master | ||
[gittip-image]: https://img.shields.io/gittip/fengmk2.svg?style=flat-square | ||
[gittip-url]: https://www.gittip.com/fengmk2/ | ||
[david-image]: https://img.shields.io/david/node-modules/address.svg?style=flat-square | ||
[david-url]: https://david-dm.org/node-modules/address | ||
[download-image]: https://img.shields.io/npm/dm/address.svg?style=flat-square | ||
@@ -41,3 +33,3 @@ [download-url]: https://npmjs.org/package/address | ||
```js | ||
var address = require('address'); | ||
const address = require('address'); | ||
@@ -63,3 +55,3 @@ // default interface 'eth' on linux, 'en' on osx. | ||
```js | ||
address(function (err, addrs) { | ||
address((err, addrs) => { | ||
console.log(addrs.ip, addrs.ipv6, addrs.mac); | ||
@@ -69,3 +61,3 @@ // '192.168.0.2', 'fe80::7aca:39ff:feb0:e67d', '78:ca:39:b0:e6:7d' | ||
address('vboxnet', function (err, addrs) { | ||
address('vboxnet', (err, addrs) => { | ||
console.log(addrs.ip, addrs.ipv6, addrs.mac); | ||
@@ -86,3 +78,3 @@ // '192.168.56.1', null, '0a:00:27:00:00:00' | ||
```js | ||
address.dns(function (err, addrs) { | ||
address.dns((err, addrs) => { | ||
console.log(addrs); | ||
@@ -93,16 +85,6 @@ // ['10.13.2.1', '10.13.2.6'] | ||
## benchmark | ||
run `$ npm run benchmark` | ||
``` | ||
18,929 op/s » #ip | ||
17,622 op/s » #ipv6 | ||
16,347 op/s » #mac | ||
11,906 op/s » #dns | ||
``` | ||
## License | ||
[MIT](LICENSE.txt) | ||
<!-- GITCONTRIBUTOR_START --> | ||
@@ -112,8 +94,8 @@ | ||
|[<img src="https://avatars.githubusercontent.com/u/156269?v=4" width="100px;"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/>|[<img src="https://avatars.githubusercontent.com/u/1147375?v=4" width="100px;"/><br/><sub><b>alsotang</b></sub>](https://github.com/alsotang)<br/>|[<img src="https://avatars.githubusercontent.com/u/1409643?v=4" width="100px;"/><br/><sub><b>mariodu</b></sub>](https://github.com/mariodu)<br/>|[<img src="https://avatars.githubusercontent.com/u/11351322?v=4" width="100px;"/><br/><sub><b>mathieutu</b></sub>](https://github.com/mathieutu)<br/>|[<img src="https://avatars.githubusercontent.com/u/2139038?v=4" width="100px;"/><br/><sub><b>zhangyuheng</b></sub>](https://github.com/zhangyuheng)<br/>|[<img src="https://avatars.githubusercontent.com/u/1400114?v=4" width="100px;"/><br/><sub><b>coolme200</b></sub>](https://github.com/coolme200)<br/>| | ||
|[<img src="https://avatars.githubusercontent.com/u/156269?v=4" width="100px;"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/>|[<img src="https://avatars.githubusercontent.com/u/1147375?v=4" width="100px;"/><br/><sub><b>alsotang</b></sub>](https://github.com/alsotang)<br/>|[<img src="https://avatars.githubusercontent.com/u/10237910?v=4" width="100px;"/><br/><sub><b>jkelleyrtp</b></sub>](https://github.com/jkelleyrtp)<br/>|[<img src="https://avatars.githubusercontent.com/u/1409643?v=4" width="100px;"/><br/><sub><b>mariodu</b></sub>](https://github.com/mariodu)<br/>|[<img src="https://avatars.githubusercontent.com/u/11351322?v=4" width="100px;"/><br/><sub><b>mathieutu</b></sub>](https://github.com/mathieutu)<br/>|[<img src="https://avatars.githubusercontent.com/u/2139038?v=4" width="100px;"/><br/><sub><b>zhangyuheng</b></sub>](https://github.com/zhangyuheng)<br/>| | ||
| :---: | :---: | :---: | :---: | :---: | :---: | | ||
[<img src="https://avatars.githubusercontent.com/u/5856440?v=4" width="100px;"/><br/><sub><b>whxaxes</b></sub>](https://github.com/whxaxes)<br/> | ||
[<img src="https://avatars.githubusercontent.com/u/1400114?v=4" width="100px;"/><br/><sub><b>coolme200</b></sub>](https://github.com/coolme200)<br/>|[<img src="https://avatars.githubusercontent.com/u/5856440?v=4" width="100px;"/><br/><sub><b>whxaxes</b></sub>](https://github.com/whxaxes)<br/> | ||
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Fri Apr 29 2022 20:59:23 GMT+0800`. | ||
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Tue Sep 13 2022 09:09:11 GMT+0800`. | ||
<!-- GITCONTRIBUTOR_END --> | ||
<!-- GITCONTRIBUTOR_END --> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15426
7
254
94