address

WebJar for address

Лицензия

Лицензия

MIT
Категории

Категории

Github Инструменты разработки Контроль версий
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

github-com-node-modules-address
Последняя версия

Последняя версия

1.1.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

address
WebJar for address
Ссылка на сайт

Ссылка на сайт

https://www.webjars.org
Система контроля версий

Система контроля версий

https://github.com/node-modules/address

Скачать github-com-node-modules-address

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-node-modules-address/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-node-modules-address</artifactId>
    <version>1.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-node-modules-address/
implementation 'org.webjars.npm:github-com-node-modules-address:1.1.2'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-node-modules-address/
implementation ("org.webjars.npm:github-com-node-modules-address:1.1.2")
'org.webjars.npm:github-com-node-modules-address:jar:1.1.2'
<dependency org="org.webjars.npm" name="github-com-node-modules-address" rev="1.1.2">
  <artifact name="github-com-node-modules-address" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-node-modules-address', version='1.1.2')
)
libraryDependencies += "org.webjars.npm" % "github-com-node-modules-address" % "1.1.2"
[org.webjars.npm/github-com-node-modules-address "1.1.2"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

address

NPM version build status Test coverage Gittip David deps npm download

Get current machine IP, MAC and DNS servers.

DNS servers receive from /etc/resolv.conf.

Install

$ npm install address

Usage

Get IP is sync and get MAC is async for now.

var address = require('address');

// default interface 'eth' on linux, 'en' on osx.
address.ip();   // '192.168.0.2'
address.ipv6(); // 'fe80::7aca:39ff:feb0:e67d'
address.mac(function (err, addr) {
  console.log(addr); // '78:ca:39:b0:e6:7d'
});

// local loopback
address.ip('lo'); // '127.0.0.1'

// vboxnet MAC
address.mac('vboxnet', function (err, addr) {
  console.log(addr); // '0a:00:27:00:00:00'
});

Get all addresses: IPv4, IPv6 and MAC

address(function (err, addrs) {
  console.log(addrs.ip, addrs.ipv6, addrs.mac);
  // '192.168.0.2', 'fe80::7aca:39ff:feb0:e67d', '78:ca:39:b0:e6:7d'
});

address('vboxnet', function (err, addrs) {
  console.log(addrs.ip, addrs.ipv6, addrs.mac);
  // '192.168.56.1', null, '0a:00:27:00:00:00'
});

Get an interface info with family

address.interface('IPv4', 'eth1');
// { address: '192.168.1.1', family: 'IPv4', mac: '78:ca:39:b0:e6:7d' }

Get DNS servers

address.dns(function (err, addrs) {
  console.log(addrs);
  // ['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

org.webjars.npm

node_modules

All about node.js modules like your project 'node_modules' dir

Версии библиотеки

Версия
1.1.2