New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

chrome-portfinder

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chrome-portfinder

Find an open port on the current machine (for Chrome Apps)

  • 0.3.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

chrome-portfinder travis npm downloads javascript style guide

Find an open port on the current machine (for Chrome Apps)

This module lets you find an open port, ala portfinder, but for Chrome Packaged Apps.

Instead of learning the quirks of Chrome's chrome.socket API for networking in Chrome Apps just use the higher-level portfinder API you're familiar with. Then, compile your code with browserify and you're all set!

This module is used by webtorrent.

install

npm install chrome-portfinder

methods

The chrome-portfinder module has a simple interface:

  var portfinder = require('chrome-portfinder')

  portfinder.getPort(function (err, port) {
    //
    // `port` is guarenteed to be a free port
    // in this scope.
    //
  })

By default portfinder will start searching from 8000. To change this simply set portfinder.basePort.

contribute

To run tests, use npm test. The tests will run TCP servers and launch a few different Chrome Packaged Apps with browserified client code. The tests currently assume you have Chrome Canary on Mac. If you're on Windows or Linux, feel free to send a pull request to fix this limitation.

license

MIT. Copyright (c) Feross Aboukhadijeh. Originally forked from portfinder which is also MIT.

Keywords

FAQs

Package last updated on 27 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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