express-fast-ip
v0.1.3
Published
An express middleware for getting fast information about an IP.
Downloads
3
Maintainers
Readme
Express Fast IP
An express module for getting IP information using fast-geoip.
Installation
npm install express-fast-ip
Usage
Typescript
import {ip, ipInfo} from 'express-fast-ip';
import * as express from 'express';
const app = express();
app.use(ip);
app.get('/', function (req, res) {
res.send(req.ipInfo);
});
// It is also possible to fetch ip information programatically
console.log(
await ipInfo(),
);
Javascript
const express = require('express');
const app = express();
const {ip, ipInfo} = require('express-fast-ip');
app.use(ip);
app.get('/', function (req, res) {
res.send(req.ipInfo);
});
// It is also possible to fetch ip information programatically
console.log(
await ipInfo(),
);
Author
Eduardo Nuzzi [email protected]
Contributions
Feel free to contribute to this project.
If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a new feature, please send a pull request.
Credits
Huge thanks to Oyetoke Toby for implementing the code that inspired this lib.