# redis-geo

> redis geo-ip lokup

Latest version **0.1.1** (published 2013-09-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install redis-geo
pnpm add redis-geo
yarn add redis-geo
bun add redis-geo
```

Provides the command `redis-geo`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2013-09-30 |
| First published | 2013-09-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Garrett Johnson |
| Maintainers | gjohnson |
| Keywords | redis, geo, geo-ip, maxmind |

## Links

- npm: https://www.npmjs.com/package/redis-geo
- Repository: git@github.com:gjohnson/redis-geo
- Issues: https://github.com/gjohnson/redis-geo/issues
- npm.io page: https://npm.io/package/redis-geo

## Dependencies (3)

- [csv](https://npm.io/package/csv.md) ~0.3.6
- [redis](https://npm.io/package/redis.md) ~0.8.5
- [commander](https://npm.io/package/commander.md) ~2.0.0

## Recent versions

- 0.1.1 (latest) — 2013-09-30
- 0.1.0 — 2013-09-27
- 0.0.2 — 2013-09-27
- 0.0.1 — 2013-09-27

## README

# redis-geo

GeoIp backed by redis. Port of examples provided by [Redis in Action](http://www.manning.com/carlson/). Buy the book!

## Module Usage

```js
var redis = require('redis').createClient();
var geoip = require('redis-geo')(redis);

geoip('71.75.248.222', function (err, info) {
  if (err) throw err;
  console.log(info);
});
```

Example output:

```js
{
  country: 'US',
  state: 'NC',
  city: 'Waxhaw',
  zip: '28173',
  lat: '34.9273',
  lng: '-80.7278',
  metro: '517',
  areacode: '704'
}
```

## Importing Data

First import the block via the csv dump.

```sh
$ redis-geo import-blocks /to/to/blocks.csv
```

Next, import the locations.

```sh
$ redis-geo import-locations path/to/locations.csv
```

## Options

```sh
$ redis-geo --help

  Usage: redis-geo [options] [command]

  Commands:

    import-blocks <file>   imports the location blocks
    import-locations <file> imports the location details by city
    lookup <ip>            looks up the geo data for the ip

  Options:

    -h, --help                   output usage information
    -V, --version                output the version number
    -p, --port [port]             redis port
    -h, --host [host]            redis host
    -n, --namespace [namespace]  namespace in redis
```

## TODO:

  - hashkey sharding for memory optimizations

## License

MIT

---
_Source: https://npm.io/package/redis-geo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
