Modules@robinpath/ip
ip

@robinpath/ip

0.1.1Node.jsPublic

IP module for RobinPath.

IP

IP module for RobinPath.

Package: @robinpath/ip | Category: Utility | Type: Utility

Authentication

No authentication required. All functions are available immediately.

Use Cases

Use the ip module when you need to:

  • getMyIp -- Use ip.getMyIp to perform this operation
  • geolocate -- Use ip.geolocate to perform this operation
  • geolocateBatch -- Use ip.geolocateBatch to perform this operation
  • isPrivate -- Use ip.isPrivate to perform this operation
  • isValid -- Use ip.isValid to perform this operation

Quick Reference

FunctionDescriptionReturns
getMyIpgetMyIpobject
geolocategeolocateobject
geolocateBatchgeolocateBatchobject
isPrivateisPrivateobject
isValidisValidobject
isIpv4isIpv4object
isIpv6isIpv6object
cidrContainscidrContainsobject
cidrRangecidrRangeobject
subnetInfosubnetInfoobject
reverseDnsreverseDnsobject
checkBlacklistcheckBlacklistobject

Functions

getMyIp

getMyIp

Module: ip | Returns: object -- API response.

ip.getMyIp
ParameterTypeRequiredDescription
inputstringNoInput parameter

geolocate

geolocate

Module: ip | Returns: object -- API response.

ip.geolocate
ParameterTypeRequiredDescription
inputstringNoInput parameter

geolocateBatch

geolocateBatch

Module: ip | Returns: object -- API response.

ip.geolocateBatch
ParameterTypeRequiredDescription
inputstringNoInput parameter

isPrivate

isPrivate

Module: ip | Returns: object -- API response.

ip.isPrivate
ParameterTypeRequiredDescription
inputstringNoInput parameter

isValid

isValid

Module: ip | Returns: object -- API response.

ip.isValid
ParameterTypeRequiredDescription
inputstringNoInput parameter

isIpv4

isIpv4

Module: ip | Returns: object -- API response.

ip.isIpv4
ParameterTypeRequiredDescription
inputstringNoInput parameter

isIpv6

isIpv6

Module: ip | Returns: object -- API response.

ip.isIpv6
ParameterTypeRequiredDescription
inputstringNoInput parameter

cidrContains

cidrContains

Module: ip | Returns: object -- API response.

ip.cidrContains
ParameterTypeRequiredDescription
inputstringNoInput parameter

cidrRange

cidrRange

Module: ip | Returns: object -- API response.

ip.cidrRange
ParameterTypeRequiredDescription
inputstringNoInput parameter

subnetInfo

subnetInfo

Module: ip | Returns: object -- API response.

ip.subnetInfo
ParameterTypeRequiredDescription
inputstringNoInput parameter

reverseDns

reverseDns

Module: ip | Returns: object -- API response.

ip.reverseDns
ParameterTypeRequiredDescription
inputstringNoInput parameter

checkBlacklist

checkBlacklist

Module: ip | Returns: object -- API response.

ip.checkBlacklist
ParameterTypeRequiredDescription
inputstringNoInput parameter

Error Handling

All functions throw on failure. Common errors:

ErrorCause
Ip API error (${res.status}): ${t}Check the error message for details
Ip: "..." not configured. Call ip.setCredentials first.Check the error message for details
@desc "Get my ip and validate result"
do
  set $result as ip.getMyIp
  if $result != null
    print "Success"
  else
    print "No result"
  end
enddo

Recipes

1. List and iterate MyIp

Retrieve all items and loop through them.

@desc "Get my ip and iterate results"
do
  set $result as ip.getMyIp
  each $item in $result
    print $item
  end
enddo

2. Multi-step IP workflow

Chain multiple ip operations together.

@desc "Get my ip, geolocate, and more"
do
  set $r_getMyIp as ip.getMyIp
  set $r_geolocate as ip.geolocate
  set $r_geolocateBatch as ip.geolocateBatch
  print "All operations complete"
enddo

3. Safe getMyIp with validation

Check results before proceeding.

@desc "Get my ip and validate result"
do
  set $result as ip.getMyIp
  if $result != null
    print "Success: " + $result
  else
    print "Operation returned no data"
  end
enddo

Related Modules

  • json -- JSON module for complementary functionality

Versions (1)

VersionTagPublished
0.1.1latest1 months ago
Install
$ robinpath add @robinpath/ip

Collaborators

Dumitru Balaban
Dumitru Balaban
@dumitru
View all @robinpath modules
Version0.1.1
LicenseMIT
Unpacked Size3.7 KB
Versions1
Weekly Downloads26
Total Downloads26
Stars0
Last Publish1 months ago
Created1 months ago

Keywords

Category

utilities