npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

resolvmon

v0.2.4

Published

Automatically updates Node DNS resolver configuration if resolv.conf changes

Downloads

78

Readme

node-resolvmon

Build Status npm version Flattr this git repo

NPM NPM

Automatically updates Node DNS resolver configuration if resolv.conf changes.

Watches /etc/resolv.conf (or similar) for changes and updates Node DNS resolver accordingly. Detects if resolv.conf is created, deleted, renamed or modified.

Why?

Current versions of Node.js or io.js do not update their DNS resolver configuration after application has been started. This is due to DNS client library (c-ares) lacking support for reinitialization or monitoring of system setting changes.

If the system DNS resolver is unconfigured at the time of application startup or the configuration is modified afterwards, Node engine does not keep up with the changes.

This module allows monitoring of /etc/resolv.conf file and updates the runtime DNS resolver configuration of the Node application without restarting it.

Node Compatibility

Supports Node.js v0.12.0+ and io.js v1.0.0+

Node.js version v0.10 or earlier are not supported due to the lack of dns.setServers() function.

Please let me know if you have problems running it on a later version of Node or have platform-specific problems.

Installation

Install resolvmon using npm:

$ npm install resolvmon

Or get resolvmon directly from: https://github.com/imyller/node-resolvmon

Synopsis

Basic


// import the module and start monitoring

var resolvmon = require('resolvmon').start();

Advanced


// import the module

var resolvmon = require('resolvmon');

// listen for error events

resolvmon.on('error', function (err) {
	console.error(err);
});

// listen for update events

resolvmon.on('update', function (nameservers) {
	console.dir(nameservers);
});

// trigger manual update

resolvmon.update();

// start monitoring

resolvmon.start();

Testing

$ npm test

Contributing

You can find the repository at: https://github.com/imyller/node-resolvmon

Issues/Feature Requests can be submitted at: https://github.com/imyller/node-resolvmon/issues

I'd really like to hear your feedback, and I'd love to receive your pull-requests!

Copyright

Copyright 2015-2016 Ilkka Myller. This software is licensed under the MIT License, see LICENSE for details.