Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

addr-to-ip-port

Package Overview
Dependencies
Maintainers
9
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

addr-to-ip-port - npm Package Compare versions

Comparing version 1.5.4 to 2.0.0

32

CHANGELOG.md

@@ -0,1 +1,33 @@

# [2.0.0](https://github.com/webtorrent/addr-to-ip-port/compare/v1.5.4...v2.0.0) (2022-11-16)
### chore
* switch to ESM ([#21](https://github.com/webtorrent/addr-to-ip-port/issues/21)) ([104d222](https://github.com/webtorrent/addr-to-ip-port/commit/104d222b18a21d33568c0a73a4623c55a69d2ddb))
### BREAKING CHANGES
* ESM only
* refactor: update to import/export syntax
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
* chore: update package.json for modules and deps
- define exports, nodejs version
- update critical deps
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
* docs: update readme for using esm
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
* Update package.json
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
Co-authored-by: Diego Rodríguez Baquero <github@diegorbaquero.com>
* ESM only
## [1.5.4](https://github.com/webtorrent/addr-to-ip-port/compare/v1.5.3...v1.5.4) (2021-07-30)

@@ -2,0 +34,0 @@

2

index.js

@@ -7,3 +7,3 @@ const ADDR_RE = /^\[?([^\]]+)]?:(\d+)$/ // ipv4/ipv6/hostname + port

// so it will not grow to consume all memory in long-running processes
module.exports = function addrToIPPort (addr) {
export default function addrToIPPort (addr) {
if (cache.size === 100000) cache.clear()

@@ -10,0 +10,0 @@ if (!cache.has(addr)) {

{
"name": "addr-to-ip-port",
"description": "Convert an 'address:port' string to an array [address:string, port:number]",
"version": "1.5.4",
"type": "module",
"version": "2.0.0",
"author": {

@@ -15,7 +16,13 @@ "name": "WebTorrent, LLC",

"devDependencies": {
"@webtorrent/semantic-release-config": "1.0.5",
"@webtorrent/semantic-release-config": "1.0.8",
"benchmark": "2.1.4",
"semantic-release": "17.4.4",
"tape": "5.3.0"
"semantic-release": "19.0.5",
"tape": "5.6.1"
},
"engines": {
"node": ">=12.20.0"
},
"exports": {
"import": "./index.js"
},
"homepage": "https://github.com/webtorrent/addr-to-ip-port",

@@ -22,0 +29,0 @@ "keywords": [

@@ -27,3 +27,3 @@ # addr-to-ip-port [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

```js
const addrToIPPort = require('addr-to-ip-port')
import addrToIPPort from 'addr-to-ip-port'

@@ -30,0 +30,0 @@ addrToIPPort('1.2.3.4:8000') //=> ['1.2.3.4', 8000]

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc