本文整理汇总了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;未经允许,请勿转载。 |
请发表评论