1.0.7 • Published 2 years ago

telize-node v1.0.7

Weekly downloads
2
License
MIT
Repository
-
Last release
2 years ago

⚠️ This package has been deprecated.

telize-node Logo

An asynchronous client library for Telize API.

NPM Package Version NPM Package Downloads NPM Package License

Installation

npm install telize-node

Quick Start

The quickest way to get started is by executing following code:

var telize = require('telize-node')();

telize.getIP(function (error, ip) {
  if (!error) {
    console.log(ip);
  } else {
    console.error(error);
  }
});

If everything went well, you'll see your current IP address in the console:

46.19.37.108

Documentation

getIP

Requests current IP address.

Example

Requests current IP address.

telize.getIP(function (error, ip) {
  if (!error) {
    console.log(ip);
  } else {
    console.error(error);
  }
});

Errors

When errors occur, you receive an error object with default properties as a first argument of the callback.


getGeoIP

Requests Geo IP data.

Examples

Requests GeoIP data for current IP address.

telize.getGeoIP(function (error, data) {
  if (!error) {
    console.log(data);
  } else {
    console.error(error);
  }
});

Requests GeoIP data for manually set IPv4 address.

telize.getGeoIP('46.19.37.108', function (error, data) {
  if (!error) {
    console.log(data);
  } else {
    console.error(error);
  }
});

Requests GeoIP data for manually set IPv6 address.

telize.getGeoIP('2a02:2770::21a:4aff:feb3:2ee', function (error, data) {
  if (!error) {
    console.log(data);
  } else {
    console.error(error);
  }
});

Errors

When errors occur, you receive an error object with default properties as a first argument of the callback.

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ npm test

License

Distributed under the MIT License.

1.0.7

2 years ago

1.0.6

8 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago