Skip to content

v1.0.0

Latest
Compare
Choose a tag to compare
@pine pine released this 24 Dec 09:31
· 1 commit to main since this release
82f8f04

Breaking changes

Use named export instead of CJS default exports

To update self-ip from v0.3.7 to v1.0.0, your code needs to be changed.

v0.3.7 or earlier

const ip = require('self-ip')

ip()
// ==> { v4: ['192.0.0.2'], v6: ['ffff::abcd:1234:1234:5678'] }

ip.v4()
// ==> ['192.0.0.2']

ip.v6()
// ==> ['ffff::abcd:1234:1234:5678']

v1.0.0

ESModules

import { ip, ipv4, ipv6 } from 'self-ip'

ip()
// ==> { v4: ['192.0.0.2'], v6: ['ffff::abcd:1234:1234:5678'] }

ipv4()
// ==> ['192.0.0.2']

ipv6()
// ==> ['ffff::abcd:1234:1234:5678']

CommonJS

const { ip, ipv4, ipv6 } = require('self-ip')

ip()
// ==> { v4: ['192.0.0.2'], v6: ['ffff::abcd:1234:1234:5678'] }

ipv4()
// ==> ['192.0.0.2']

ipv6()
// ==> ['ffff::abcd:1234:1234:5678']

Major changes

  • Supports TypeScript
  • Supports both CommonJS and ESModules