當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript node-notifier.notify函數代碼示例

本文整理匯總了TypeScript中node-notifier.notify函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript notify函數的具體用法?TypeScript notify怎麽用?TypeScript notify使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了notify函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: return

 return (
   err: Error,
   stats: webpack.compiler.Stats
 ) => {
   const customStats: CustomStats = webpackStatsDecorator(stats);
   const jsonStats = stats.toJson();
   if (err) {
     debug(chalk.red(`${debugPrefix(_name)}COMPILE ERRORS...`));
     debug(err);
     notifier.notify({
       title: 'Webpack compile errors!',
       message: err,
     });
     return reject(err);
   } else if (stats.hasErrors()) {
     debug(chalk.red(`${debugPrefix(_name)}COMPILE ERRORS...`));
     debug(jsonStats.errors);
     notifier.notify({
       title: 'Webpack compile errors!',
       message: jsonStats.errors,
     });
     return reject(new Error(jsonStats.errors));
   } else if (stats.hasWarnings()) {
     debug(chalk.yellow(`${debugPrefix(_name)}COMPILE WARNINGS...`));
     debug(jsonStats.warnings);
     return reject(new Error(jsonStats.warnings));
   }
   resolve(customStats);
 };
開發者ID:ArtemGovorov,項目名稱:reactjs-hackathon-kit,代碼行數:29,代碼來源:webpack-compiler.ts

示例2: function

 .on('end', function(){
   console.timeEnd('compilation done')
   if (lastTsErrorMsg) {
     notifier.notify({title: 'Server Compilation Errors (' + errorCount + ')', message: lastTsErrorMsg.replace(removeColorsReg, '')})
     lastTsErrorMsg = null; errorCount = 0;
   } else {
     notifier.notify({title: 'Server',message:'Compilation finished'})
   }
 })
開發者ID:Zir01,項目名稱:swag-ts-ng,代碼行數:9,代碼來源:gulpfile.ts

示例3: notify

function notify(msg?: string) {
  if (!notifier || !msg) return
  notifier.notify({
    title: 'tmux-weather',
    message: msg,
  })
}
開發者ID:dickeyxxx,項目名稱:tmux-weather,代碼行數:7,代碼來源:tmux-weather.ts

示例4: errorNotification

 private errorNotification(err, str, req) {
   let title = 'Error in ' + req.method + ' ' + req.url;
   notifier.notify({
     title: title,
     message: str
   });
 }
開發者ID:thehachez,項目名稱:maduk,代碼行數:7,代碼來源:app.ts

示例5: extractChannelTitle

			res.on("end", () => {
				let title: string = extractChannelTitle(body);
				let broadcasting: boolean = checkBroadcasting(body);
				if (broadcasting) {
					if (lastChannelBroadcastings[url] === undefined ||
						lastChannelBroadcastings[url] === false) {
						lastChannelBroadcastings[url] = true;
						notifier.notify({
							title: title,
							message: url,
							icon: __dirname + "/../browser/notification.png",
							sound: true,
							wait: true,
						});
						notifier.on("click", (notifierObject: NodeNotifier, options: Notification) => {
							electron.shell.openExternal(options.message + '/live');
						});
					}
				} else {
					lastChannelBroadcastings[url] = false;
				}
				updateTrayIcon();
				if (mainWindow !== undefined) {
					mainWindow.webContents.send("updateChannelStatus", JSON.stringify({
						url: url,
						title: title,
						broadcasting: broadcasting,
					}));
				}
			});
開發者ID:data9824,項目名稱:SavannaAlert,代碼行數:30,代碼來源:main.ts

示例6: require

 app.listen(config.localPort, () => {
     // 開發模式彈窗,告知已重啟 node 服務
     if (process.env.NODE_ENV !== 'production') {
         const notifier = require('node-notifier')
         notifier.notify(`server start on port: ${config.localPort}`)
     }
 })
開發者ID:ascoders,項目名稱:wokugame,代碼行數:7,代碼來源:index.ts

示例7: errorNotification

function errorNotification(err:Error,str:string,req:Request,res:Response){
    const title='Error in'+req.method+''+req.url;
    notifier.notify({
       title:title,
        message:str
    });
};
開發者ID:guoyu07,項目名稱:react-node-cms,代碼行數:7,代碼來源:error-parser.ts

示例8: notify

        private static notify(message: string, icon: string): angular.IPromise<void> {
            notifier.notify({
                title: 'jmxhealth',
                message: message,
                icon: path.join(process.cwd(), 'icons', icon),
                sound: true,
                wait: true
            });

            var defered = Q.defer<void>();

            notifier.on('click', function(notifierObject, options) {
                console.log(notifierObject);
                console.log(options);

                defered.resolve();
            });

            notifier.on('timeout', function(notifierObject, options) {
                console.log(notifierObject);
                console.log(options);

                defered.reject();
            });


            return defered.promise;
        }
開發者ID:furti,項目名稱:jmxhealth,代碼行數:28,代碼來源:Notify.ts

示例9: toggleProxy

async function toggleProxy() {

    const httpProxy: IHTTP_ProxyConf = getHttpProxy();

    // let settingsTmpDir = (process.platform == 'win32' ? process.env.TMP : process.env.TMPDIR);
    let settingsTmpDir = os.tmpdir();
    let settingsTmpFile = path.join(settingsTmpDir, path.basename(settingsPath + '.tmp.' + Math.random()));

    // debug
    // console.log(settingsTmpDir);
    // console.log(settingsTmpFile);

    let line: string;
    let array = await fs.readFileSync(settingsPath, 'utf8').toString().split("\n");

    // Backup to extensionPath
    let backupTmpFile = path.join(vscode.extensions.getExtension("satokaz.vscode-toggleproxy").extensionPath, path.basename(settingsPath + '.tmp'));
    if(fs.statSync(settingsPath).size !== 0){
        await fs.writeFileSync(backupTmpFile, array.join('\n'));
    }

    for (line in array) {
        const matchResult = regExpMatchHttpProxy(array[line]);

        // console.log('matchResult =', matchResult)

        if (matchResult !== null) {
            if (!matchResult.http_proxyEnabled) {
                // should enable proxy
                array[line] = array[line].replace(/\/\/\W/, "");
                vscode.window.setStatusBarMessage('Enabled http.proxy', 2000);
            } else {
                // should disable proxy
                array[line] = array[line].replace(/^/, "// ");
                vscode.window.setStatusBarMessage('Disabled http.proxy', 2000);
            }
        }
    }

    await fs.writeFileSync(settingsTmpFile, array.join('\n'));
    // copy tmp settings file to vscode settings
    // console.log("fs.writeFileSync(settingsPath, fs.readFileSync(settingsTmpFile,\"utf-8\"), 'utf8');")
    await fs.writeFileSync(settingsPath, await fs.readFileSync(settingsTmpFile,"utf-8"));
    // console.log("fs.unlink(settingsTmpFile);");
    await fs.unlink(settingsTmpFile);

    // node-notifier
    if (vscode.workspace.getConfiguration('toggleproxy')['notifier'] === true) {
            notifier.notify({
            'title': 'Visual Studio Code - Proxy Notification',
            'message': !httpProxy.http_proxyEnabled ? 'Proxy Enabled: ' + httpProxy.http_proxy : 'Proxy Disabled',
            'appName': 'Visual Studio Code',
            'icon': path.join(vscode.extensions.getExtension("satokaz.vscode-toggleproxy").extensionPath, path.join('images', 'octicon-globe_128_0_7c05c9_none.png')) ,
            timeout: 5
        });
    }
    vscode.workspace.onDidChangeConfiguration(e => configureHttpRequest());
    return void 0;
}
開發者ID:satokaz,項目名稱:vscode-toggleProxy,代碼行數:59,代碼來源:extension.ts

示例10: showNotification

function showNotification(notificationObject: NotificationObject) {
    const { title, subtitle, message, url, authorIconPath } = notificationObject;
    notifier.notify({
        url,
        title,
        subtitle,
        message,
        icon: authorIconPath || DEFAULT_ICON_PATH,
        wait: false
    });
}
開發者ID:adasq,項目名稱:gerrit-native-notifications,代碼行數:11,代碼來源:to-native-notification.ts


注:本文中的node-notifier.notify函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。