New Version
A package helps you to test if you lock version the right way.
Problem
Have you ever in a situation when one of your dependencies get updated, then it breaks your application. Then you try to lock version of that dependency. But it's hard to verify if your method of locking version is correct. new-version
helps you by regularly update to a new version (currently: weekly), so you can verify if you do it the right way.
Usage
You can use node api or cli to check the current and newest version of package
Using CLI
Add this to your package.json
"scripts": ,
then execute
npm run new-version
or simply
./node_modules/.bin/new-version
Using Node API
NewVersion;
Output:
Current version: 0.0.1
Newest version: 0.0.2
Demo
You can verify if your locking mechanism is configured correctly by including this script in index.js
// index.js { const currentVersion = NewVersion; const newestVersion = await NewVersion; if currentVersion === newestVersion console } ;
API
getCurrentVersion
Return current installed version of new-version
getNewestVersion
Return newest version of new-version
. This is an async function
log
Friendly log current version and newest version of new-version