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

TypeScript fancy-log.default函数代码示例

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

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



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

示例1: webpack

 webpack(webpackConfig, (err: Error, stats: any) => {
   if (err != null) {
     throw err
   }
   log('[webpack]:\n', stats.toString('minimal'))
   done()
 })
开发者ID:whitetrefoil,项目名称:flickr-simple-reorder,代码行数:7,代码来源:build.ts


示例2: startProxy

 startProxy(proxyConfig: any) {
   log(`Building proxy to ${config.backendDest}`)
   this.server = httpProxy.createProxyServer(proxyConfig)
   this.server.on('error', log.warn)
   // See https://github.com/nodejitsu/node-http-proxy/issues/180#issuecomment-310550385
   this.server.on('proxyReq', (proxyReq, req) => {
     if (req.body == null) { return }
     const bodyData = JSON.stringify(req.body)
     proxyReq.setHeader('Content-Length', Buffer.byteLength(bodyData))
     proxyReq.write(bodyData)
   })
 }
开发者ID:whitetrefoil,项目名称:flickr-simple-reorder,代码行数:12,代码来源:proxy.ts


示例3: log

    middleware: () => {
      const middleware = [bodyparser.json() as NextHandleFunction]

      if (proxy.server == null) {
        log('No proxy server exists, will use StubAPI mode.')

        const msm = new MSM({
          apiPrefixes  : config.apiPrefixes,
          apiDir       : 'stubapi/',
          lowerCase    : true,
          ping         : config.ping,
          preserveQuery: false,
          logLevel     : 'DEBUG',
        })
        middleware.push(msm.middleware())
      } else {
        log('Existing proxy server found, will use proxy mode.')
        middleware.push(proxyMiddlewareFactory(proxy.server))
      }

      return middleware
    },
开发者ID:whitetrefoil,项目名称:flickr-simple-reorder,代码行数:22,代码来源:backend.ts


示例4: log

    server.on('listening', () => {
      log('Checking Dev Server status...')

      http.get({
        host   : config.livereloadHost,
        port   : config.serverPort,
        timeout: WAIT_FOR_STARTUP_IN_MS,
      }, (res: http.IncomingMessage) => {
        log(`Webpack Dev Server started at port ${config.serverPort}`)
        res.on('data', _.noop)
        res.on('end', done)
      })
        .on('error', (err?: Error) => {
          log.warn('There must be something wrong with webpack dev server:')
          log.warn(err)
          done()
        })
    })
开发者ID:whitetrefoil,项目名称:flickr-simple-reorder,代码行数:18,代码来源:dev-server.ts


示例5: Promise

const runCommand = (
  command: string,
  options: Required<Options>,
  file: Vinyl | null
): Promise<void> => {
  const context = { file, ...options.templateData }
  command = template(command)(context)

  if (options.verbose) {
    fancyLog(`${PLUGIN_NAME}:`, chalk.cyan(command))
  }

  const child = spawn(command, {
    env: options.env,
    cwd: template(options.cwd)(context),
    shell: options.shell,
    stdio: options.quiet ? 'ignore' : 'inherit'
  })

  return new Promise((resolve, reject) => {
    child.on('exit', code => {
      if (code === 0 || options.ignoreErrors) {
        return resolve()
      }

      const context = {
        command,
        file,
        error: { code },
        ...options.templateData
      }

      const message = template(options.errorMessage)(context)

      reject(new PluginError(PLUGIN_NAME, message))
    })
  })
}
开发者ID:sun-zheng-an,项目名称:gulp-shell,代码行数:38,代码来源:index.ts


示例6: root

  },
)

// endregion

// region - Main exports

const rootDir     = path.join(__dirname, '..')
const sourceDir   = DEFAULT_SOURCE_BASE_DIR
const buildingDir = DEFAULT_BUILDING_DIR
const outputDir   = DEFAULT_OUTPUT_DIR

process.env.NODE_ENV  = (argv.flags.development || DEFAULT_IS_DEVELOPMENT) ? 'development' : 'production'
process.env.BABEL_ENV = process.env.NODE_ENV

log(`Initializing project in "${rootDir}" for ${process.env.NODE_ENV} environment.`)

const root: IBuildPathFn = (...pathInRoot) => path.join(rootDir, ...pathInRoot)
const absRoot            = root

const source: IBuildPathFn    = (...pathInSource) => path.join(sourceDir, ...pathInSource)
const absSource: IBuildPathFn = (...pathInSource) => root(sourceDir, ...pathInSource)

const building: IBuildPathFn    = (...pathInBuilding) => path.join(buildingDir, ...pathInBuilding)
const absBuilding: IBuildPathFn = (...pathInBuilding) => root(buildingDir, ...pathInBuilding)

const output: IBuildPathFn    = (...pathInOutput) => path.join(outputDir, ...pathInOutput)
const absOutput: IBuildPathFn = (...pathInOutput) => root(outputDir, ...pathInOutput)

const outputByEnv: IBuildPathFn = (...pathInOutput) => {
  const dir = process.env.NODE_ENV === 'production' ? outputDir : buildingDir
开发者ID:whitetrefoil,项目名称:flickr-simple-reorder,代码行数:31,代码来源:config.ts


示例7: log

 .on('unlink', path => log(chalk.cyan('REM ') + path));
开发者ID:samizdatjs,项目名称:tashmetu-fs,代码行数:1,代码来源:reporter.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript fancy-log.error函数代码示例发布时间:2022-05-25
下一篇:
TypeScript falcor-json-graph.ref函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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