Let developers know when there is a new release of your package in their next development runtime.
Out-of-the-box providers will only send you version notifications from your application's dependencies, and not from dependencies of your dependencies. Notifications can be disabled in production environments by using the environment variable
You can also specify custom resolvers, so you don't have to rely on NPM's availability.
This is a Node.js module. Therefore, beforehand, you need to download and install Node.js.
Assuming that you have already used the
npm init command, run:
$ npm install version-notifier --save
You can call
version-notifier anytime on your runtime, but it is recommended to call it as soon as your app starts. For example, in your
index.js, in your root directory:
var checkVersion =
The first argument must always be the root directory of your app.
How to configure
You can specify a different provider through
versionNotifier.provider on your
package.json. Out-of-the-box providers:
Or you can create your very own version provider by the time you call
Custom version providers
checkVersion(appRootDirectory, customProvider, log)
The root directory of your application. If your main file is already in the root directory, just use
__dirname here. Otherwise, you must use specify how to go to your root directory still using
__dirname. For example, if you are calling
version-notifier inside a subfolder of your root directory, you must use
path.join(__dirname, '..') to get the relative path of your root directory.
I used root directory here multiples times because getting the right directory for your app is a must for a fully working environment. Using
__dirname, your project can be used as a dependency in other projects.
You can use
version-notifier with totally different environments from NPM, with support for alternative dependency checking:
Or if you are still using
package.json for your project, you can just use a function:
Versions ideally follow semver, but it is not a rule since you can create your own custom providers.
Custom logging function for the results.
Created and developed by Arthur Arioli Bergamaschi.
Licensed under MIT.
version-notifieris an experiment to improve development environments and it is still in alpha. Methods and behavior can change along the way.