$ npm i egg-ip-search --save
// {app_root}/config/plugin.js
exports.ipSearch = {
enable: true,
package: 'egg-ip-search',
};
// {app_root}/controller/xxx.js
const location = await this.ctx.getLocation();
const location = await this.ctx.getLocationByIP('223.71.87.228');
const location = await this.ctx.getLocationByIP('223.71.87.228'); // { province: "北京", city: "北京", isp: "中国移动北京分公司" }
Please open an issue here.