Socket
Socket
Sign inDemoInstall

chrome-dns

Package Overview
Dependencies
2
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

chrome-dns

Use the Node `dns` API in Chrome Apps


Version published
Maintainers
1
Weekly downloads
4,859
decreased by-2.45%

Weekly downloads

Readme

Source

chrome-dns npm downloads javascript style guide

Use the Node dns API in Chrome Apps

This module lets you use the Node.js dns API in Chrome Packaged Apps.

The chrome.dns API for Chrome Apps is not documented, but it still available. You need the "dns" permission in your manifest.

As of August 2019, it appears that the API is only available if you use Chrome Dev channel or Canary channel.

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

This module is used by the Chrome App build of webtorrent, which is used in Brave Browser.

install

npm install chrome-dns

methods

Use node's dns API. Example:

var dns = require('chrome-dns')

dns.lookup('feross.org', (err, address, family) => {
  if (err) {
    console.error(err)
    return
  }

  console.org(`feross.org has the IPv${family} address of ${address}`)
})

See nodejs.org for full API documentation: dns

contribute

To run tests, use npm test && npm run test-browser. The tests will run TCP and UDP servers and launch a few different Chrome Packaged Apps with browserified client code. The tests currently require Chrome Canary.

license

MIT. Copyright (c) Feross Aboukhadijeh

Keywords

FAQs

Last updated on 10 Aug 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc