How to use ip2location-nodejs - 3 common examples

To help you get started, we’ve selected a few ip2location-nodejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github advertine / node-ip2location / test / bench.js View on Github external
console.log("ip2location dropin:");
console.log("\nIP2Location_get_all()");
test(dropin.IP2Location_get_all);
console.log("\nIP2Location_get_country_short()");
test(dropin.IP2Location_get_country_short);

dropin.IP2Location_init();

console.log();

if (ip2loc) {
  ip2loc.IP2Location_init(file)
  console.log('-------------------');
  console.log("ip2location-nodejs:");
  console.log("\nIP2Location_get_all()");
  test(ip2loc.IP2Location_get_all, true);
  console.log("\nIP2Location_get_country_short()");
  test(ip2loc.IP2Location_get_country_short.bind(ip2loc), true);
}
github advertine / node-ip2location / test / bench.js View on Github external
test(dropin.IP2Location_get_all);
console.log("\nIP2Location_get_country_short()");
test(dropin.IP2Location_get_country_short);

dropin.IP2Location_init();

console.log();

if (ip2loc) {
  ip2loc.IP2Location_init(file)
  console.log('-------------------');
  console.log("ip2location-nodejs:");
  console.log("\nIP2Location_get_all()");
  test(ip2loc.IP2Location_get_all, true);
  console.log("\nIP2Location_get_country_short()");
  test(ip2loc.IP2Location_get_country_short.bind(ip2loc), true);
}
github advertine / node-ip2location / test / bench.js View on Github external
console.log();

dropin.IP2Location_init(file, mode);
console.log('-------------------');
console.log("ip2location dropin:");
console.log("\nIP2Location_get_all()");
test(dropin.IP2Location_get_all);
console.log("\nIP2Location_get_country_short()");
test(dropin.IP2Location_get_country_short);

dropin.IP2Location_init();

console.log();

if (ip2loc) {
  ip2loc.IP2Location_init(file)
  console.log('-------------------');
  console.log("ip2location-nodejs:");
  console.log("\nIP2Location_get_all()");
  test(ip2loc.IP2Location_get_all, true);
  console.log("\nIP2Location_get_country_short()");
  test(ip2loc.IP2Location_get_country_short.bind(ip2loc), true);
}

ip2location-nodejs

IP2Location geolocation component

MIT
Latest version published 1 year ago

Package Health Score

58 / 100
Full package analysis