How to use the iplocation.default function in iplocation

To help you get started, we’ve selected a few iplocation 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 umaar / wiki-globe / index.js View on Github external
import {spawn} from 'child_process';
import httpModule from 'http';

import config from 'config';
import express from 'express';
import prettyTime from 'pretty-time';
import LRU from 'lru-cache';
import iplocationModule from 'iplocation';
import EventSource from 'eventsource';
import isIp from 'is-ip';
import socketIO from 'socket.io';

import knex from './db/connection.js';

const iplocation = iplocationModule.default;

const expressPort = config.get('port');

const app = express();
const http = httpModule.Server(app); // eslint-disable-line new-cap
const io = socketIO(http, {path: '/globe/socket.io'});

const IPAPIKey = config.get('IPAPIKey');
const ipAPIURL = `https://api.ipstack.com/*?access_key=${IPAPIKey}`;
const wikimediaStreamURL = 'https://stream.wikimedia.org/v2/stream/recentchange';

const locationCache = new LRU(5000);

const maxDBItems = config.get('maxDBItems');

const stats = {

iplocation

Get ip location information.

MIT
Latest version published 5 years ago

Package Health Score

54 / 100
Full package analysis

Popular iplocation functions