ScyllaDB University Live | Free Virtual Training Event
Learn more
ScyllaDB Documentation Logo Documentation
  • Deployments
    • Cloud
    • Server
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
    • Supported Driver Versions
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Install
Search Ask AI
ScyllaDB Docs ScyllaDB Node.js Driver API Reference Modules types InetAddress

InetAddress¶

types~InetAddress(buffer)

Represents an IP address.

Constructor¶

new InetAddress(buffer)

Creates an instance of InetAddress.

Parameters:
Name Type Description
buffer Buffer

The buffer containing the IPv4 or IPv6 address.

Source

types/inet-address.js, line 11

Throws:

If the buffer is not a valid IPv4 or IPv6 address.

Type
Error

Members¶

(readonly) buffer :Array

Immutable buffer that represents the IP address

Type:
  • Array

Source

types/inet-address.js, line 74

(readonly) length :Number

Returns the length of the underlying buffer

Type:
  • Number

Source

types/inet-address.js, line 48

(readonly) version :Number

Returns the Ip version (4 or 6)

Type:
  • Number

Source

types/inet-address.js, line 61

Methods¶

equals(other) → {Boolean}

Compares 2 addresses and returns true if the underlying bytes are the same

Parameters:
Name Type Description
other InetAddress

Source

types/inet-address.js, line 163

Returns:
Type
Boolean

getBuffer() → {Buffer}

Returns the underlying buffer

Source

types/inet-address.js, line 177

Returns:
Type
Buffer

inspect() → {string}

Provide the name of the constructor and the string representation

Source

types/inet-address.js, line 185

Returns:
Type
string

toJSON() → {String}

Returns the string representation. Method used by the native JSON.stringify() to serialize this instance.

Source

types/inet-address.js, line 269

Returns:
Type
String

toString(encodingopt) → {String}

Returns the string representation of the IP address.

For v4 IP addresses, a string in the form of d.d.d.d is returned.

For v6 IP addresses, a string in the form of x:x:x:x:x:x:x:x is returned, where the 'x's are the hexadecimal values of the eight 16-bit pieces of the address, according to rfc5952. In cases where there is more than one field of only zeros, it can be shortened. For example, 2001:0db8:0:0:0:1:0:1 will be expressed as 2001:0db8::1:0:1.

Parameters:
Name Type Attributes Description
encoding String <optional>

Source

types/inet-address.js, line 202

Returns:
Type
String

(static) fromString(value) → {InetAddress}

Converts a string representation of an IP address to an InetAddress instance.

This function accepts both IPv4 and IPv6 addresses, which may include an embedded IPv4 address.

Parameters:
Name Type Description
value string

Source

types/inet-address.js, line 92

Throws:
  • If the input string is not a valid IPv4 or IPv6 address.
Type
TypeError
Returns:
Type
InetAddress

Was this page helpful?

PREVIOUS
Duration
NEXT
Integer
  • Create an issue
  • Edit this page

On this page

  • InetAddress
    • Constructor
    • Members
    • Methods
ScyllaDB Node.js Driver
Search Ask AI
  • main
    • main
  • API Reference
    • Modules
      • auth
        • AuthProvider
        • Authenticator
        • PlainTextAuthProvider
      • concurrent
      • datastax
      • errors
        • ArgumentError
        • AuthenticationError
        • BusyConnectionError
        • DriverInternalError
        • NoHostAvailableError
        • NotSupportedError
        • OperationTimedOutError
        • ResponseError
      • geometry
      • mapping
        • DefaultTableMappings
        • Mapper
        • ModelBatchItem
        • ModelMapper
        • Result
        • UnderscoreCqlToCamelCaseMappings
        • TableMappings
      • metadata
        • Aggregate
        • ClientState
        • ColumnMetadata
        • Index
        • KeyspaceMetadata
        • MaterializedView
        • Metadata
        • SchemaFunction
        • Strategy
        • TableMetadata
        • UdtField
        • UserDefinedType
      • metrics
        • DefaultMetrics
        • ClientMetrics
      • policies
        • addressResolution
          • AddressTranslator
          • EC2MultiRegionTranslator
          • MappingAddressTranslator
        • loadBalancing
          • AllowListPolicy
          • DCAwareRoundRobinPolicy
          • DefaultLoadBalancingPolicy
          • LegacyDefaultLoadBalancingPolicy
          • LoadBalancingConfig
          • LoadBalancingPolicy
          • RoundRobinPolicy
          • TokenAwarePolicy
        • reconnection
          • ConstantReconnectionPolicy
          • ExponentialReconnectionPolicy
          • ReconnectionPolicy
        • retry
          • FallthroughRetryPolicy
          • RetryPolicy
        • speculativeExecution
          • ConstantSpeculativeExecutionPolicy
          • NoSpeculativeExecutionPolicy
          • SpeculativeExecutionPolicy
        • timestampGeneration
          • MonotonicTimestampGenerator
          • TimestampGenerator
      • tracker
        • RequestLogger
        • RequestTracker
      • types
        • Duration
        • InetAddress
        • Integer
        • LocalDate
        • Long
        • ResultSet
        • ResultStream
        • Row
        • TimeUuid
        • Vector
    • Classes
      • AddressResolver
      • ByteOrderedToken
      • Client
      • Encoder
      • EncoderMembers
      • ExecutionOptions
      • ExecutionProfile
      • FrameReader
      • HashSet
      • Host
      • HostMap
      • LineString
      • Murmur3Token
      • Point
      • Polygon
      • PreparedInfo
      • RandomToken
      • SslOptions
      • Token
      • TokenRange
    • Interfaces
    • Events
    • Global Functions and Constants
Docs Tutorials University Contact Us About Us
© 2026 ScyllaDB | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 14 May 2026.
Powered by Sphinx 9.1.0 & ScyllaDB Theme 1.9.2