0.0.1 • Published 7 years ago

please-update v0.0.1

Weekly downloads
10
License
ISC
Repository
github
Last release
7 years ago

Notify when you release a new version

Example message

npm install please-update

Build Status Coverage Status

Why even?

Cool CLI tools will notify users when a new version releases so they can update. Please Update makes your CLI tool cool, fool.

Note: Programs that run longer than it takes for an HTTPS request can use this too.

Usage

import update from 'please-update'
import pkg from './package.json'

update({
  package: pkg.name,
  version: pkg.version
}).then(() => {
  /* message printed if an update is available */
})

Considerations

The is-ci library detects if a command runs on CI servers. If so, no message prints.

The default message will contain emoji when supported.

Documentation

Here are all the supported options.

PropertyTypeDefaultDescription
packagestringrequiredThe package name
versionstringrequiredThe current, local package version
preferGlobalbooleanfalseWhether to show the global install command
includeTaggedVersionsbooleanfalseWhether to count tagged versions (betas, alphas) as versions
persistCheckbooleantrueDelegate to Please Update the task of remembering the last check time for an update
checkIntervalnumber24 hoursNumber of milliseconds to wait before checking for an update again
lastChecknumber0The last check time in milliseconds. Needed if persistCheck is false.
displayFn(info: object) -> voidbuilt-inFunction passed all the data necessary to print an update warning.
preventUpdatebooleanisCIWhether to never check or display a warning
silenceErrorsbooleantrueWhether to ignore an error if the NPM registry is down

Contributing

Contributions are incredibly welcome as long as they are standardly applicable and pass the tests (or break bad ones). Tests are in AVA.

# running tests
npm run test

Follow me on Twitter for updates or for the lolz and please check out my other repositories if I have earned it. I thank you for reading.