Giter VIP home page Giter VIP logo

addr-to-ip-port's Introduction

addr-to-ip-port ci npm downloads javascript style guide

Convert an "address:port" string to an array [address:string, port:number]

Uses a cache to prevent excessive array allocations and GC.

Works in node and the browser. This module is used by WebTorrent!

install

npm install addr-to-ip-port

usage

import addrToIPPort from 'addr-to-ip-port'

addrToIPPort('1.2.3.4:8000') //=> ['1.2.3.4', 8000]
addrToIPPort('1.2.3.4:8000') //=> ['1.2.3.4', 8000] (returns the cached object)

license

MIT. Copyright (c) Feross Aboukhadijeh and WebTorrent, LLC.

addr-to-ip-port's People

Contributors

diegorbaquero avatar feross avatar greenkeeper[bot] avatar king-11 avatar renovate-bot avatar renovate[bot] avatar rozifus avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

addr-to-ip-port's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/release.yml
  • actions/checkout v3
  • actions/setup-node v3
  • actions/cache v3
npm
package.json
  • @webtorrent/semantic-release-config 1.0.10
  • benchmark 2.1.4
  • semantic-release 21.1.2
  • tape 5.8.1

  • Check this box to trigger a request for Renovate to run again on this repository

Caching?

Hi

Is there any evidence that the CPU resources for something like '2.3.4.5:1000'.split(':') justify the cache?

There is no dropping from this cache which is why I fear growing memory usage in long-running clients. (My use-case would be a newly implemented Bitlove.org seeder.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.