JSPM

ip2buf

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9981
  • Score
    100M100P100Q123759F
  • License MIT

convert ip address to buffer

Package Exports

  • ip2buf

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ip2buf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ip2buf

travis npm license downloads

Convert ip address to buffer

Usage

const ip2buf = require('ip2buf')

ip2buf('8.8.8.8') // [0x8, 0x8, 0x8, 0x8]
ip2buf('2001::')  // [0x20, 0x01, 0, ...]

API

  • [default] function(ip: string): Buffer

convert ipv4 or ipv6 to buffer

  • v4(ip: string): Buffer

convert ipv4 to buffer

  • v6(ip: string): Buffer

convert ipv6 to buffer

License

MIT, 2016 (c) Dmitry Tsvettsikh