rbs-timezone

1.1.0 • Public • Published

rbs-timezone

Get ip info by user's ip or proxy. CommonJS support and ES Modules support.

NPM Version

Installation

npm install rbs-timezone --save

Build

npm run build

Usage

// ES6
// import timezone from 'rbs-timezone';
const timezone = require('rbs-timezone');

// Get timezone by default
const opts = null;

// Get timezone with proxy params (timezone info of proxy)
const opts = {
  proxy: 'http://ODuQc79d:GkmAVF3V@116.108.245.71:16011'
  // proxy: 'socks://d6OKt1FU:3NttBdHd@27.68.110.241:14104'
};

// Get timezone with ip params (timezone info of ip)
const opts = {
  ip: '116.108.245.71'
};

const tz = await timezone(opts);
console.log(tz);
// Result: {
//     ip: '2402:800:61b3:da9d:cc4d:a73a:df4e:187c',
//     country: 'VN',
//     stateProv: 'Hanoi',
//     city: 'Hanoi',
//     ll: [ 21.0292, 105.8526 ],
//     timezone: 'Asia/Bangkok',
//     languages: 'vi',
//     accuracy: 100
// }

Release History

1.1.0 - 02/11/2024

  • Updates:
    • Get timezone with ip params.
    • Testing.

1.0.5 - 11/06/2024

  • Fix:
    • Error stateProv read of undefined 0.
    • Readme

1.0.4

  • Fix:

    • Could not get the public IP address (using new list APIs for get ip address).
  • Updates:

    • Testing.
  • 1.0.3

  • 1.0.2

  • 1.0.1

  • 1.0.0

    • Get timezone

Readme

Keywords

none

Package Sidebar

Install

npm i rbs-timezone

Weekly Downloads

0

Version

1.1.0

License

ISC

Unpacked Size

62.8 MB

Total Files

5

Last publish

Collaborators

  • albondie3