@esm2cjs/public-ip
v6.0.1
Published
Get your public IP address — very fast!. This is a fork of sindresorhus/public-ip, but with CommonJS support.
Downloads
3,864
Maintainers
Readme
@esm2cjs/public-ip
This is a fork of https://github.com/sindresorhus/public-ip, but automatically patched to support ESM and CommonJS, unlike the original repository. This fork does NOT include browser support, only Node.js.
Install
You can use an npm alias to install this package under the original name:
npm i public-ip@npm:@esm2cjs/public-ip
// package.json
"dependencies": {
"public-ip": "npm:@esm2cjs/public-ip"
}
but npm
might dedupe this incorrectly when other packages depend on the replaced package. If you can, prefer using the scoped package directly:
npm i @esm2cjs/public-ip
// package.json
"dependencies": {
"@esm2cjs/public-ip": "^ver.si.on"
}
Usage
// Using ESM import syntax
import { publicIp, publicIpv4, publicIpv6 } from "@esm2cjs/public-ip";
// Using CommonJS require()
const { publicIp, publicIpv4, publicIpv6 } = require("@esm2cjs/public-ip");
For more details, please see the original repository.
Sponsoring
To support my efforts in maintaining the ESM/CommonJS hybrid, please sponsor here.
To support the original author of the module, please sponsor here.