Get ip info by user's ip or proxy. CommonJS support and ES Modules support.
npm install rbs-timezone --save
npm run build
// 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
// }
-
Updates:
- Get timezone with ip params.
- Testing.
-
Fix:
- Error stateProv read of undefined 0.
- Readme
-
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