address vs addressparser vs parse-address vs node-postal
Address Parsing Libraries Comparison
1 Year
addressaddressparserparse-addressnode-postal
What's Address Parsing Libraries?

Address parsing libraries are essential tools in web development for processing and managing address data. They help developers extract structured information from unstructured address strings, validate addresses, and format them according to various standards. This functionality is crucial for applications that require accurate address handling, such as e-commerce platforms, delivery services, and any application that interacts with geographical data.

Package Weekly Downloads Trend
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
address9,347,27723762.6 kB138 months agoMIT
addressparser495,34041-09 years agoMIT
parse-address50,101163-246 years agoISC
node-postal15,10122823.5 kB16a year agoMIT
Feature Comparison: address vs addressparser vs parse-address vs node-postal

Parsing Accuracy

  • address:

    The 'address' library provides basic parsing capabilities, focusing on common address formats. While it is user-friendly, it may not handle complex or international addresses as accurately as other libraries.

  • addressparser:

    'addressparser' excels in parsing accuracy, breaking down addresses into structured components such as street, city, state, and postal code. It is designed to handle various address formats, making it a reliable choice for diverse applications.

  • parse-address:

    'parse-address' focuses on parsing US addresses with a decent level of accuracy. It is effective for standard US formats but may struggle with non-standard or international addresses.

  • node-postal:

    'node-postal' is known for its high parsing accuracy and ability to handle international addresses. It leverages the libpostal library, which is optimized for parsing and normalizing addresses from around the world, ensuring precise results.

Internationalization Support

  • address:

    The 'address' library has limited internationalization support, primarily catering to US addresses. It may not be suitable for applications that require comprehensive international address handling.

  • addressparser:

    'addressparser' offers moderate internationalization support, capable of parsing addresses from various countries, though it may not cover all edge cases or formats.

  • parse-address:

    'parse-address' is primarily focused on US addresses and does not support international address formats, making it unsuitable for global applications.

  • node-postal:

    'node-postal' provides extensive internationalization support, making it the best choice for applications that need to parse and validate addresses from multiple countries with high accuracy.

Ease of Use

  • address:

    The 'address' library is designed for simplicity, making it easy to integrate and use for basic address parsing tasks. It is ideal for developers looking for a quick solution without complex setup.

  • addressparser:

    'addressparser' has a slightly steeper learning curve than 'address', but it offers more features for structured parsing. It is still user-friendly for developers familiar with address handling.

  • parse-address:

    'parse-address' is straightforward to use, especially for US address parsing. Its simplicity makes it a good choice for projects that require quick implementation without extensive configuration.

  • node-postal:

    'node-postal' may require more initial setup and understanding due to its advanced features and capabilities. However, it is well-documented, making it accessible for developers willing to invest time in learning.

Performance

  • address:

    The 'address' library performs well for basic parsing tasks but may not be optimized for handling large datasets or high volumes of address processing.

  • addressparser:

    'addressparser' offers good performance for parsing multiple addresses simultaneously, making it suitable for applications that require batch processing of address data.

  • parse-address:

    'parse-address' performs adequately for US addresses but may not be as efficient as 'node-postal' when dealing with large datasets or complex parsing scenarios.

  • node-postal:

    'node-postal' is optimized for performance, capable of handling large volumes of address data efficiently. Its reliance on the libpostal library ensures quick parsing and normalization even for complex addresses.

Maintenance and Community Support

  • address:

    The 'address' library is maintained but has a smaller community compared to others. It may not receive frequent updates or extensive community contributions.

  • addressparser:

    'addressparser' has a moderate level of maintenance and community support, with regular updates and contributions from users, ensuring it stays relevant and functional.

  • parse-address:

    'parse-address' is maintained but has a smaller community. It may not receive as many updates or contributions, which could impact its long-term viability.

  • node-postal:

    'node-postal' benefits from strong community support and regular updates, thanks to its reliance on the well-established libpostal library. It is actively maintained and widely used in various applications.

How to Choose: address vs addressparser vs parse-address vs node-postal
  • address:

    Choose 'address' if you need a straightforward library for parsing and formatting addresses with a focus on simplicity and ease of use. It is suitable for basic address handling without extensive features.

  • addressparser:

    Select 'addressparser' when you require a more robust solution for parsing addresses into structured components. It is particularly useful for applications that need to handle various address formats and ensure accurate parsing.

  • parse-address:

    Use 'parse-address' if you are looking for a lightweight library that focuses on parsing US addresses specifically. It is best for projects that do not require extensive international support but need reliable parsing for US addresses.

  • node-postal:

    Opt for 'node-postal' if you need advanced address parsing capabilities, including international address support and validation. It is ideal for applications that require high accuracy and comprehensive address handling across different countries.

README for address

address

NPM version Node.js CI Test coverage npm download

Get current machine IPv4, IPv6, 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.

  • esm & typescript
import { ip, ipv6, mac } from 'address';

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

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

// vboxnet MAC
mac('vboxnet', function (err, addr) {
  console.log(addr); // '0a:00:27:00:00:00'
});
  • commonjs
const { ip, ipv6, mac } = require('address');

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

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

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

Get all addresses: IPv4, IPv6 and MAC

  • esm & typescript
import { address } from 'address';

address((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', (err, addrs) => {
  console.log(addrs.ip, addrs.ipv6, addrs.mac);
  // '192.168.56.1', null, '0a:00:27:00:00:00'
});
  • commonjs
const { address } = require('address');

address((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', (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

  • esm & typescript
import { getInterfaceAddress } from 'address';

getInterfaceAddress('IPv4', 'eth1');
// { address: '192.168.1.1', family: 'IPv4', mac: '78:ca:39:b0:e6:7d' }
  • commonjs
const { getInterfaceAddress } = require('address');

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

Get DNS servers

  • esm & typescript
import { dns } from 'address';

dns((err, servers) => {
  console.log(servers);
  // ['10.13.2.1', '10.13.2.6']
});
  • commonjs
const { dns } = require('address');

dns((err, servers) => {
  console.log(servers);
  // ['10.13.2.1', '10.13.2.6']
});

Promise style apis

import { address, mac, dns } from 'address/promises';

const addr = await address();
const macAddress = await mac();
const servers = await dns();

License

MIT

Contributors

|
fengmk2

|
alsotang

|
jkelleyrtp

|
slyon

|
mariodu

|
mathieutu

| | :---: | :---: | :---: | :---: | :---: | :---: |
zhangyuheng

|
semantic-release-bot

|
coolme200

|
whxaxes

This project follows the git-contributor spec, auto updated at Fri Sep 22 2023 20:49:32 GMT+0800.