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

bonjour-service

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bonjour-service

A Bonjour/Zeroconf implementation in TypeScript

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.8M
increased by11.19%
Maintainers
1
Weekly downloads
 
Created

What is bonjour-service?

The bonjour-service npm package is a Node.js implementation of multicast DNS service discovery, a way of using standard DNS protocols to enable devices on the same local network to discover each other. It allows for the advertisement and discovery of services such as HTTP servers, printers, and other devices or services available on the local network without the need for manual configuration.

What are bonjour-service's main functionalities?

Advertise a service

This feature allows you to advertise a service on the local network. In this example, a web server is advertised using the HTTP protocol on port 3000.

const bonjour = require('bonjour-service')();

bonjour.publish({ name: 'My Web Server', type: 'http', port: 3000 });

Discover services

This feature enables the discovery of services advertised on the local network. The example code searches for services of the type 'http' and logs any that are found.

const bonjour = require('bonjour-service')();

bonjour.find({ type: 'http' }, function (service) {
  console.log('Found an HTTP server:', service);
});

Unpublish all services

This feature allows for the removal of all advertised services from the network. It's useful for cleanup, especially when shutting down an application that has advertised multiple services.

const bonjour = require('bonjour-service')();

// After services have been published
bonjour.unpublishAll(() => {
  console.log('All services have been unpublished.');
});

Other packages similar to bonjour-service

Keywords

FAQs

Package last updated on 18 Nov 2024

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