How to use @maxmind/geoip2-node - 5 common examples

To help you get started, we’ve selected a few @maxmind/geoip2-node 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 maxmind / GeoIP2-node / e2e / ts / index.spec.ts View on Github external
it('exists', async () => {
    expect.assertions(1);
    const response = await Reader.open('../GeoIP2-City-Test.mmdb');
    expect(response.city('175.16.199.1')).toHaveProperty('city.geonameId');
  });
});
github maxmind / GeoIP2-node / e2e / js / index.spec.js View on Github external
it('exists', async () => {
    expect.assertions(1);
    const response = await Reader.open('../GeoIP2-City-Test.mmdb');
    expect(response.city('175.16.199.1')).toHaveProperty('city.geonameId');
  });
});
github maxmind / GeoIP2-node / e2e / js / index.spec.js View on Github external
const WebServiceClient = require('@maxmind/geoip2-node').WebServiceClient;
const Reader = require('@maxmind/geoip2-node').Reader;

describe('WebServiceClient', () => {
  it('exists', () => {
    const client = () => new WebServiceClient('1234', 'foo');

    expect(client).not.toThrowError();
  });
});

describe('Reader', () => {
  it('exists', async () => {
    expect.assertions(1);
    const response = await Reader.open('../GeoIP2-City-Test.mmdb');
    expect(response.city('175.16.199.1')).toHaveProperty('city.geonameId');
  });
});
github maxmind / GeoIP2-node / e2e / js / index.spec.js View on Github external
    const client = () => new WebServiceClient('1234', 'foo');
github maxmind / GeoIP2-node / e2e / ts / index.spec.ts View on Github external
    const client = () => new WebServiceClient('1234', 'foo');

@maxmind/geoip2-node

Node.js API for GeoIP2 webservice client and database reader

Apache-2.0
Latest version published 1 year ago

Package Health Score

67 / 100
Full package analysis