![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
version-notifier
Advanced tools
Let developers know when there is a new release of your package in their next development runtime.
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 NODE_ENV=production
or NODE_ENV=prod
.
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:
ES6+
import checkVersion from 'version-notifier'
checkVersion(__dirname)
ES5
var checkVersion = require('version-notifier')
checkVersion(__dirname)
The first argument must always be the root directory of your app.
You can specify a different provider through versionNotifier.provider
on your package.json
. Out-of-the-box providers: npm
.
{
"name": "myPackage",
"version": "1.0.0",
"versionNotifier": {
"provider": "npm"
}
}
Or you can create your very own version provider by the time you call version-notifier
:
checkVersion(__dirname, function (packageName, currentVersion, log) {
// your magic
log('I have just checked my custom provider for a new version of ' + packageName + '.')
})
appRootDirectory
Type: string
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.
customProvider
Type: function
or object
You can use version-notifier
with totally different environments from NPM, with support for alternative dependency checking:
{
isDependency: function (parentDependenciesJson: JSON, dependencyName: string) : boolean,
resolver: function (packageName: string, currentVersion: string, log: function) : void
}
Or if you are still using package.json
for your project, you can just use a function:
function (packageName: string, currentVersion: string, log: function) : void
Versions ideally follow semver, but it is not a rule since you can create your own custom providers.
log
Type: function
Custom logging function for the results.
function (err?: Error, message?: string) : void
Created and developed by Arthur Arioli Bergamaschi.
Licensed under MIT.
Disclaimer:
version-notifier
is an experiment to improve development environments and it is still in alpha. Methods and behavior can change along the way.
FAQs
Let developers know when there is a new release of your package in their next development runtime.
The npm package version-notifier receives a total of 0 weekly downloads. As such, version-notifier popularity was classified as not popular.
We found that version-notifier demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.