本文整理汇总了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('');
});