当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript underline.magenta方法代码示例

本文整理汇总了TypeScript中chalk.underline.magenta方法的典型用法代码示例。如果您正苦于以下问题:TypeScript underline.magenta方法的具体用法?TypeScript underline.magenta怎么用?TypeScript underline.magenta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在chalk.underline的用法示例。


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

示例1: parseInt

    server.listen(port, hostname, () => {
      const address = server.address();
      const actualPort = typeof address === 'string' ? port : address.port;
      const self = cluster.isMaster
        ? isDev
          ? `server (pid=${process.pid})`
          : 'server'
        : `worker ${process.env.POSTGRAPHILE_WORKER_NUMBER} (pid=${process.pid})`;
      const versionString = `v${manifest.version}`;
      if (cluster.isMaster || process.env.POSTGRAPHILE_WORKER_NUMBER === '1') {
        console.log('');
        console.log(
          `PostGraphile ${versionString} ${self} listening on port ${chalk.underline(
            actualPort.toString(),
          )} 🚀`,
        );
        console.log('');
        const {
          host: rawPgHost,
          port: rawPgPort,
          database: pgDatabase,
          user: pgUser,
          password: pgPassword,
        } = pgConfig;
        // Not using default because want to handle the empty string also.
        const pgHost = rawPgHost || 'localhost';
        const pgPort = (rawPgPort && parseInt(String(rawPgPort), 10)) || 5432;
        const safeConnectionString = isDemo
          ? 'postgraphile_demo'
          : `postgres://${pgUser ? pgUser : ''}${pgPassword ? ':[SECRET]' : ''}${
              pgUser || pgPassword ? '@' : ''
            }${pgUser || pgPassword || pgHost !== 'localhost' || pgPort !== 5432 ? pgHost : ''}${
              pgPort !== 5432 ? `:${pgConfig.port || 5432}` : ''
            }${pgDatabase ? `/${pgDatabase}` : ''}`;

        const information: Array<string> = pluginHook(
          'cli:greeting',
          [
            `GraphQL API:         ${chalk.underline.bold.blue(
              `http://${hostname}:${actualPort}${graphqlRoute}`,
            )}` +
              (postgraphileOptions.subscriptions
                ? ` (${postgraphileOptions.live ? 'live ' : ''}subscriptions enabled)`
                : ''),
            !disableGraphiql &&
              `GraphiQL GUI/IDE:    ${chalk.underline.bold.blue(
                `http://${hostname}:${actualPort}${graphiqlRoute}`,
              )}` +
                (postgraphileOptions.enhanceGraphiql ||
                postgraphileOptions.live ||
                postgraphileOptions.subscriptions
                  ? ''
                  : ` (enhance with '--enhance-graphiql')`),
            `Postgres connection: ${chalk.underline.magenta(safeConnectionString)}${
              postgraphileOptions.watchPg ? ' (watching)' : ''
            }`,
            `Postgres schema(s):  ${schemas.map(schema => chalk.magenta(schema)).join(', ')}`,
            `Documentation:       ${chalk.underline(
              `https://graphile.org/postgraphile/introduction/`,
            )}`,
            extractedPlugins.length === 0
              ? `Join ${chalk.bold(
                  sponsor,
                )} in supporting PostGraphile development: ${chalk.underline.bold.blue(
                  `https://graphile.org/sponsor/`,
                )}`
              : null,
          ],
          {
            options: postgraphileOptions,
            middleware,
            port: actualPort,
            chalk,
          },
        ).filter(isString);
        console.log(information.map(msg => `  ‣ ${msg}`).join('\n'));

        console.log('');
        console.log(chalk.gray('* * *'));
      } else {
        console.log(
          `PostGraphile ${versionString} ${self} listening on port ${chalk.underline(
            actualPort.toString(),
          )} 🚀`,
        );
      }
      console.log('');
    });
开发者ID:calebmer,项目名称:postgraphql,代码行数:88,代码来源:cli.ts


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