1.0.3 • Published 1 year ago

mime-updatecheck v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Mime UpdateChecker

npm NPM

Check with github if package is up to date.

📝 Table of Contents

🧐 About

Check with Github if package is up to date with package.json or release.

🏁 Getting Started

Prerequisites

What things you need to install the software and how to install them.

Node v16+
Package.json
Github Repo

Installing

Install the package with npm

npm i mime-updatecheck

🎈 Usage

Declare the class

const { Updater, Providers } = require("mime-updatecheck");
const updater = new Updater("./package.json" /*or require("./package.json")*/, {
  provider: Providers.Github,
  github: { owner: "UserOrOrganization", repository: "Repository to check" },
});

Add events

updater.on("update", (data) => {
  console.log("New update: " + data);
  /*
    data: {version: String, latestVersion: String, setupURL: String} setupURL only on Github Release
    */
});
updater.on("noUpdate", () => {
  console.log("No update available");
});

And check for update

// ...
updater.check(); /*.then(console.log)*/

Your update checker is setuped !
Full code:

// Declare
const { Updater, Providers } = require("mime-updatecheck");
const updater = new Updater("./package.json" /*or require("./package.json")*/, {
  provider: Providers.Github,
  github: { owner: "UserOrOrganization", repository: "Repository to check" },
});

// Listen for events
updater.on("update", (data) => {
  console.log("New update: " + data);
});
updater.on("noUpdate", () => {
  console.log("No update available");
});

// Check for update
updater.check();

⛏️ Built Using

✍️ Authors

See also the list of contributors who participated in this project.

1.0.2

1 year ago

1.0.1

1 year ago

1.0.3

1 year ago

1.0.0

2 years ago