Gathering detailed insights and metrics for electron-update-checker-notifier
Gathering detailed insights and metrics for electron-update-checker-notifier
Gathering detailed insights and metrics for electron-update-checker-notifier
Gathering detailed insights and metrics for electron-update-checker-notifier
npm install electron-update-checker-notifier
Typescript
Module System
Min. Node Version
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
3
In English
It's a project that seeks new updates for the app from the GitHub repository and informs the user about these updates. The goal is to keep the user informed about the latest versions of their software and allow for simple and fast updating.
You can choose the language that will be used for log messages and notifications by adding the following option to the updateNotification method call:
1import { updateCheckerNotifier, Language } from 'electron-update-checker-notifier'; 2 3updateCheckerNotifier.language = Language.PT_BR; 4 5updateCheckerNotifier.updateNotification();
1import { UpdateCheckerNotifier, Language } from 'electron-update-checker-notifier'; 2 3const notifier = new UpdateCheckerNotifier(); 4 5notifier.updateNotification({ 6 language: Language.PT_BR, 7});
The currently supported languages are:
1npm install electron-update-checker-notifier
To use UpdateCheckerNotifier, you need to import it and create an instance. Then, you can call the updateNotification() method to check if there are updates available for your app.
1import { UpdateCheckerNotifier } from 'electron-update-checker-notifier'; 2 3const notifier = new UpdateCheckerNotifier(); 4notifier.updateNotification();
You can pass options to the updateNotification() method to customize its behavior.
repository (Optional): Your app repository on GitHub. If not specified, it will use the repository defined in your app's package.json file.
token (Optional): The access token to the GitHub API.
debug (Optional, default: false): Allows checking for updates during development.
enablePreRelease (Optional, default: false): Notify pre-release version.
enableNewVersionAvailableDialog (Optional, default: true): Notifies when there are new versions available, otherwise remains silent.
enableLatestVersionDialog (Optional, default: false): Notifies when you are already running the latest version.
enableErrorDialog (Optional, default: false): Notifies when an error occurs.
language (Optional, default: Language.EN): The language used for log messages and notifications.
logger (Optional): The logger. You can pass a logger such as electron-log, winston, or other with the following interfaces: { info(), warn(), error() }. Set to null if you wish to disable logging.
UpdateCheckerNotifier emits several events that you can listen to for information about the update process.
checking-for-update: Emitted when the update check process begins.
update-available: Emitted when there is a new version available for download.
update-not-available: Emitted when there are no new updates available.
this-is-last-update: Emitted when the update check determines that the current version of your app is the last available version.
error: Emitted when an error occurs during the update check process.
You can listen to these events as follows:
1notifier.on('checking-for-update', () => { 2 console.log('Checking for updates...'); 3}); 4 5notifier.on('update-available', (info: UpdateInfo) => { 6 console.log(`A new version (${info.version}) is available for download!`); 7}); 8 9notifier.on('update-not-available', (info: UpdateInfo) => { 10 console.log('There are no new updates available.'); 11}); 12 13notifier.on('this-is-last-update', (info: UpdateInfo) => { 14 console.log('This is the latest update available.: ', info); 15}); 16 17notifier.on('error', (error: Error) => { 18 console.error(`An error has occurred: ${error}`); 19});
The UpdateInfo object is passed as an argument to the event handler and contains information about the current and latest available version of your application.
Here is a full example of how to use UpdateCheckerNotifier in an Electron application:
1import { updateCheckerNotifier, Language } from 'electron-update-checker-notifier'; 2 3updateCheckerNotifier.repository = 'user/repo' 4updateCheckerNotifier.token = 'my-github-token' 5updateCheckerNotifier.debug = true 6updateCheckerNotifier.enablePreRelease = true 7updateCheckerNotifier.enableNewVersionAvailableDialog = true 8updateCheckerNotifier.enableLatestVersionDialog = true 9updateCheckerNotifier.enableErrorDialog = true 10updateCheckerNotifier.language = Language.PT_BR 11updateCheckerNotifier.logger = log 12 13updateCheckerNotifier.updateNotification();
1import { UpdateCheckerNotifier, Language } from 'electron-update-checker-notifier'; 2 3const notifier = new UpdateCheckerNotifier(); 4 5notifier.updateNotification({ 6 repository: 'user/repo', 7 token: 'my-github-token', 8 debug: true, 9 enablePreRelease = true, 10 enableNewVersionAvailableDialog: true, 11 enableLatestVersionDialog: true, 12 enableErrorDialog: true, 13 language: Language.PT_BR, 14 logger: log, 15}); 16 17notifier.on('update-available', (info: UpdateInfo) => { 18 console.log(`A new version (${info.version}) is available for download!`); 19}); 20 21notifier.on('error', (error: Error) => { 22 console.error(`An error has occurred: ${error}`); 23});
If you want to contribute to this project, follow these steps:
I would like to thank the following developers for the work done on the project electron-update-notifier
Thank you for your dedication and contribution to the community.
This project is licensed under the MIT license. See the LICENSE file for more details.
In Portuguese
É um projeto que busca novas atualizações do aplicativo a partir do repositório do GitHub e notifica o usuário sobre essas atualizações. O objetivo é manter o usuário informado sobre as versões mais recentes de seu software e possibilitar a atualização de maneira simples e rápida.
Você pode escolher o idioma que será utilizado usado para as mensagens de log e notificações adicionando a seguinte opção à chamada do método updateNotification:
1import { updateCheckerNotifier, Language } from 'electron-update-checker-notifier'; 2 3updateCheckerNotifier.language = Language.PT_BR; 4 5updateCheckerNotifier.updateNotification();
1import { UpdateCheckerNotifier, Language } from 'electron-update-checker-notifier'; 2 3const notifier = new UpdateCheckerNotifier(); 4 5notifier.updateNotification({ 6 language: Language.PT_BR, 7});
Os idiomas atualmente suportados são:
1npm install electron-update-checker-notifier
Para usar UpdateCheckerNotifier, você precisa importá-lo e criar uma instância. Em seguida, você pode chamar o método updateNotification() para verificar se há atualizações disponíveis para o seu aplicativo.
1import { UpdateCheckerNotifier } from 'electron-update-checker-notifier'; 2 3const notifier = new UpdateCheckerNotifier(); 4notifier.updateNotification();
Você pode passar opções para o método updateNotification() para personalizar o comportamento.
repository (opcional): O repositório do seu aplicativo no GitHub. Se não for especificado, ele usará o repositório definido no arquivo package.json do seu aplicativo.
token (opcional): O token de acesso à API do GitHub.
debug (opcional, padrão: false): Permite verificar atualizações durante o desenvolvimento.
enablePreRelease (opcional, padrão: false): Notifica versão de pré-lançamento
enableNewVersionAvailableDialog (opcional, padrão: true): Notifica quando houver novas versões disponíveis, caso contrário, permanece silencioso.
enableLatestVersionDialog (opcional, padrão: false): Notifica quando você já está executando a versão mais recente.
enableErrorDialog (opcional, padrão: false): Notifica quando um erro acontecer
language (opcional, padrão: Language.EN): O idioma usado para as mensagens de log e notificações.
logger (opcional): O registrador. Você pode passar um registrador como electron-log, winston ou outro com as seguintes interfaces: { info(), warn(), error() }. Defina como null se você desejar desativar o recurso de log.
UpdateCheckerNotifier emite vários eventos que você pode ouvir para obter informações sobre o processo de atualização.
checking-for-update: Emitido quando o processo de verificação de atualização começa.
update-available: Emitido quando há uma nova versão disponível para download.
update-not-available: Emitido quando não há novas atualizações disponíveis.
this-is-last-update: Emitido quando quando a verificação de atualização determina que a versão atual do seu aplicativo é a última versão disponível.
error: Emitido quando ocorre um erro durante o processo de verificação de atualização.
Você pode ouvir esses eventos da seguinte maneira:
1notifier.on('checking-for-update', () => { 2 console.log('Verificando por atualizações...'); 3}); 4 5notifier.on('update-available', (info: UpdateInfo) => { 6 console.log(`Uma nova versão (${info.version}) está disponível para download!`); 7}); 8 9notifier.on('update-not-available', (info: UpdateInfo) => { 10 console.log('Não há novas atualizações disponíveis.'); 11}); 12 13notifier.on('this-is-last-update', (info: UpdateInfo) => { 14 console.log('Esta é a última atualização disponível: ', info); 15}); 16 17notifier.on('error', (error: Error) => { 18 console.error(`Ocorreu um erro: ${error}`); 19});
O objeto UpdateInfo é passado como um argumento para o manipulador de eventos e contém informações sobre a versão atual e a última versão disponível do seu aplicativo.
Aqui está um exemplo completo de como usar UpdateCheckerNotifier em um aplicativo Electron:
1import { updateCheckerNotifier, Language } from 'electron-update-checker-notifier'; 2 3updateCheckerNotifier.repository = 'user/repo' 4updateCheckerNotifier.token = 'my-github-token' 5updateCheckerNotifier.debug = true 6updateCheckerNotifier.enablePreRelease = true 7updateCheckerNotifier.enableNewVersionAvailableDialog = true 8updateCheckerNotifier.enableLatestVersionDialog = true 9updateCheckerNotifier.enableErrorDialog = true 10updateCheckerNotifier.language = Language.PT_BR 11updateCheckerNotifier.logger = log 12 13updateCheckerNotifier.updateNotification();
1import { UpdateCheckerNotifier, Language } from 'electron-update-checker-notifier'; 2 3const notifier = new UpdateCheckerNotifier(); 4 5notifier.updateNotification({ 6 repository: 'user/repo', 7 token: 'my-github-token', 8 debug: true, 9 enablePreRelease = true, 10 enableNewVersionAvailableDialog: true, 11 enableLatestVersionDialog: true, 12 enableErrorDialog: true, 13 language: Language.PT_BR, 14 logger: log, 15}); 16 17notifier.on('update-available', (info: UpdateInfo) => { 18 console.log(`Uma nova versão (${info.version}) está disponível para download!`); 19}); 20 21notifier.on('error', (error: Error) => { 22 console.error(`Ocorreu um erro: ${error}`); 23});
Se você deseja contribuir para este projeto, siga as seguintes etapas:
Gostaría de agradecer aos seguintes desenvolvedores pelo trabalho realizado no projeto electron-update-notifier:
Obrigado por sua dedicação e contribuição com a comunidade.
Este projeto está licenciado sob a licença MIT. Veja o arquivo LICENSE para mais detalhes.
No vulnerabilities found.