在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ipfs-shipyard/ipfs-geoip开源软件地址:https://github.com/ipfs-shipyard/ipfs-geoip开源编程语言:JavaScript 100.0%开源软件介绍:IPFS GeoIP
InstallNPMnpm install --save ipfs-geoip CDNInstead of a local installation (and browserification) you may request a remote copy from jsDelivr: <!-- loading the minified version using jsDelivr -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.min.js"></script> When using prebuilt bundle from CDN, Usageconst geoip = require('ipfs-geoip')
const ipfs = require('ipfs-http-client')()
const exampleIp = '66.6.44.4'
try {
const result = await geoip.lookup(ipfs, exampleIp)
console.log('Result: ', result)
} catch (err) {
console.log('Error: ' + err)
}
try {
const result = await geoip.lookupPretty(ipfs, '/ip4/' + exampleIp)
console.log('Pretty result: %s', result.formatted)
} catch (err) {
console.log('Error: ' + err)
} API
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论