• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript update-notifier类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中update-notifier的典型用法代码示例。如果您正苦于以下问题:TypeScript update-notifier类的具体用法?TypeScript update-notifier怎么用?TypeScript update-notifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了update-notifier类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: listPluggings

import {
  getGraphQLProjectConfig,
  GraphQLProjectConfig,
  GraphQLConfig,
  getGraphQLConfig,
  ConfigNotFoundError,
  resolveEnvsInValues,
} from 'graphql-config'
import * as updateNotifier from 'update-notifier'
const pkg = require('../package.json')
import 'source-map-support/register'

export * from './types'
export * from './utils'

updateNotifier({ pkg }).notify()

function listPluggings(dir: string): string[] {
  return readdirSync(dir)
    .filter(moduleName => moduleName.startsWith('graphql-cli-'))
    .map(moduleName => joinPaths(dir, moduleName))
}

export function installCommands() {
  const plugins = _(npmPaths())
    .filter(existsSync)
    .map(listPluggings)
    .flatten()
    .uniq()
    .value() as string[]
开发者ID:koddsson,项目名称:graphql-cli,代码行数:30,代码来源:index.ts


示例2: require

import * as fs from "fs";
import * as path from "path";
import * as jsyaml from "js-yaml";
import * as updateNotifier from "update-notifier";

import { start } from "./index";
import { ConfigRaw } from "./controller/configRaw";
import { ReportLevel } from "./model/compilerModel";
import { Exec, target2builder } from "./utils/utils";

/* tslint:disable:no-require-imports */
let pkg = require("../package.json");
/* tslint:enable:no-require-imports */

let notifier = updateNotifier({
    packageName: pkg.name,
    packageVersion: pkg.version
});
if (notifier.update) {
    notifier.notify();
}

let packageJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, "../package.json"), "utf8"));

import * as commandpost from "commandpost";

interface RootOpts {
    reviewfile: string[];
    base: string[];
}

let root = commandpost
开发者ID:vvakame,项目名称:review.js,代码行数:32,代码来源:cli.ts


示例3: require

 */

// Be mindful of adding imports here, as this is on the hot path of all
// commands.

import * as logging from 'plylog';
import * as updateNotifier from 'update-notifier';
import {PolymerCli} from './polymer-cli';

const packageJson = require('../package.json');
const logger = logging.getLogger('cli.main');

// Update Notifier: Asynchronously check for package updates and, if needed,
// notify on the next time the CLI is run.
// See https://github.com/yeoman/update-notifier#how for info on how this works.
updateNotifier({pkg: packageJson}).notify();

(async () => {
  const args = process.argv.slice(2);
  const cli = new PolymerCli(args);
  try {
    const result = await cli.run();
    if (result && result.constructor &&
        result.constructor.name === 'CommandResult') {
      process.exit(result.exitCode);
    }
  } catch (err) {
    logger.error('cli runtime exception: ' + err);
    if (err.stack) {
      logger.error(err.stack);
    }
开发者ID:MehdiRaash,项目名称:tools,代码行数:31,代码来源:run.ts


示例4: notifyVersion

export function notifyVersion(pkg) {
    var notifier = updateNotifier({ pkg })

    if (notifier.update) {
        notifier.notify()
    }
}
开发者ID:gamerson,项目名称:gh,代码行数:7,代码来源:base.ts


示例5: constructor

 constructor({ config }: { config?: RunOptions } = {}) {
   if (!config) {
     config = {
       mock: false,
     }
   }
   const parentFilename = module.parent!.parent!
     ? module.parent!.parent!.filename
     : module.parent!.filename
   if (!config.initPath) {
     config.initPath = parentFilename
   }
   if (!config.root) {
     const findUp = require('find-up')
     config.root = path.dirname(
       findUp.sync('package.json', {
         cwd: parentFilename,
       }),
     )
   }
   this.config = new Config(config)
   this.notifier = updateNotifier({
     pkg: this.config.pjson,
     updateCheckInterval: 1,
   })
   this.initRaven()
 }
开发者ID:dhruvcodeword,项目名称:prisma,代码行数:27,代码来源:CLI.ts


示例6: setupUpdateNotifier

export default function setupUpdateNotifier(pkg: any, updateCheckInterval: number = 0) {
	const notifier = updateNotifier({ pkg, updateCheckInterval });
	notifier.notify();
}
开发者ID:dojo,项目名称:cli,代码行数:4,代码来源:updateNotifier.ts


示例7: require

// Commands
import deployCommand from './commands/deploy';
import loginCommand from './commands/login';
import logoutCommand from './commands/logout';

import { extraHelp, logCodeSandbox } from './utils/log';

import packageInfo = require('../package.json');

console.log();
logCodeSandbox();
console.log();

program.version(packageInfo.version);

program.on('--help', extraHelp);

// Register commands
deployCommand(program);
loginCommand(program);
logoutCommand(program);

program.parse(process.argv);

if (!process.argv.slice(2).length) {
  program.outputHelp();
}

updateNotifier({ pkg: packageInfo }).notify();
开发者ID:ghoullier,项目名称:codesandbox-cli,代码行数:29,代码来源:index.ts


示例8: parseInt

        }

        if (messages.tip && messages.tip.message) {
            console.log(chalk.green(messages.tip.message));
        }
        console.log("");
    }
};

console.log("");
console.log(chalk.green("BST: v" + Global.version() + "  Node: " + process.version));

updateNotifier({
    pkg: {
        name: "bespoken-tools",
        version: Global.version(),
    },
    updateCheckInterval: 0
}).notify({
    defer: false,
    isGlobal: true,
});

let Logger = "BST";

let nodeMajorVersion = parseInt(process.version.substr(1, 2));

if (nodeMajorVersion < 4) {
    LoggingHelper.error(Logger, "!!!!Node version must be >= 4!!!!");
    LoggingHelper.error(Logger, "Please install to use bst");
    LoggingHelper.prepareForFileLoggingAndDisableConsole("bst-debug.log");
开发者ID:bespoken,项目名称:bst,代码行数:31,代码来源:bst.ts



注:本文中的update-notifier类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript urijs类代码示例发布时间:2022-05-28
下一篇:
TypeScript tree-kill类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap