@@ -2,22 +2,14 @@ address
22=======
33
44[ ![ NPM version] [ npm-image ]] [ npm-url ]
5- [ ![ build status ] [ travis-image ]] [ travis-url ]
5+ [ ![ 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 )
66[ ![ Test coverage] [ coveralls-image ]] [ coveralls-url ]
7- [ ![ Gittip] [ gittip-image ]] [ gittip-url ]
8- [ ![ David deps] [ david-image ]] [ david-url ]
97[ ![ npm download] [ download-image ]] [ download-url ]
108
119[ npm-image ] : https://img.shields.io/npm/v/address.svg?style=flat-square
1210[ npm-url ] : https://npmjs.org/package/address
13- [ travis-image ] : https://img.shields.io/travis/node-modules/address.svg?style=flat-square
14- [ travis-url ] : https://travis-ci.org/node-modules/address
1511[ coveralls-image ] : https://img.shields.io/coveralls/node-modules/address.svg?style=flat-square
1612[ coveralls-url ] : https://coveralls.io/r/node-modules/address?branch=master
17- [ gittip-image ] : https://img.shields.io/gittip/fengmk2.svg?style=flat-square
18- [ gittip-url ] : https://www.gittip.com/fengmk2/
19- [ david-image ] : https://img.shields.io/david/node-modules/address.svg?style=flat-square
20- [ david-url ] : https://david-dm.org/node-modules/address
2113[ download-image ] : https://img.shields.io/npm/dm/address.svg?style=flat-square
2214[ download-url ] : https://npmjs.org/package/address
2315
@@ -36,7 +28,7 @@ $ npm install address
3628Get IP is sync and get MAC is async for now.
3729
3830``` js
39- var address = require (' address' );
31+ const address = require (' address' );
4032
4133// default interface 'eth' on linux, 'en' on osx.
4234address .ip (); // '192.168.0.2'
@@ -57,12 +49,12 @@ address.mac('vboxnet', function (err, addr) {
5749### Get all addresses: IPv4, IPv6 and MAC
5850
5951``` js
60- address (function (err , addrs ) {
52+ address ((err , addrs ) => {
6153 console .log (addrs .ip , addrs .ipv6 , addrs .mac );
6254 // '192.168.0.2', 'fe80::7aca:39ff:feb0:e67d', '78:ca:39:b0:e6:7d'
6355});
6456
65- address (' vboxnet' , function (err , addrs ) {
57+ address (' vboxnet' , (err , addrs ) => {
6658 console .log (addrs .ip , addrs .ipv6 , addrs .mac );
6759 // '192.168.56.1', null, '0a:00:27:00:00:00'
6860});
@@ -78,26 +70,16 @@ address.interface('IPv4', 'eth1');
7870### Get DNS servers
7971
8072``` js
81- address .dns (function (err , addrs ) {
73+ address .dns ((err , addrs ) => {
8274 console .log (addrs);
8375 // ['10.13.2.1', '10.13.2.6']
8476});
8577```
8678
87- ## benchmark
88-
89- run ` $ npm run benchmark `
90-
91- ```
92- 18,929 op/s » #ip
93- 17,622 op/s » #ipv6
94- 16,347 op/s » #mac
95- 11,906 op/s » #dns
96- ```
97-
9879## License
9980
10081[ MIT] ( LICENSE.txt )
82+
10183<!-- GITCONTRIBUTOR_START -->
10284
10385## Contributors
@@ -108,4 +90,4 @@ run `$ npm run benchmark`
10890
10991This project follows the git-contributor [ spec] ( https://github.com/xudafeng/git-contributor ) , auto updated at ` Fri Apr 29 2022 20:59:23 GMT+0800 ` .
11092
111- <!-- GITCONTRIBUTOR_END -->
93+ <!-- GITCONTRIBUTOR_END -->
0 commit comments