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

TypeScript meow.default函数代码示例

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

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



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

示例1: readPkgUp

(async () => {
  const { pkg } = await readPkgUp();
  if (pkg.name !== '@jokeyrhyme/node-init') {
    // package.json is too far up, doesn't belong to this package
    throw new Error('unable to find package.json within node-init');
  }

  updateNotifier({ pkg }).notify();

  updateNodejsNotifier();

  const cli = meow(
    `
  Usage:
      $ node-init [project]

  Options:
      --scope [scope]        set npm @scope prefix
      --check-git-status     stop work if un-versioned changes
      --no-check-git-status  do work even if un-versioned changes

  Examples
      $ node-init
      $ node-init my-project
      $ node-init my-project --scope my-org
  `,
    {
      flags: {
        checkGitStatus: {
          default: true,
          type: 'boolean',
        },
        scope: {
          type: 'string',
        },
      },
    },
  );

  if (!enginesNotify({ pkg })) {
    // no engine trouble, proceed :)
    const { init } = await import('../lib/index.js');

    init(cli.input, cli.flags);
  } else {
    process.exitCode = 1;
  }
})().catch(err => {
开发者ID:jokeyrhyme,项目名称:node-init.js,代码行数:48,代码来源:index.ts


示例2: delay

const argv = meow<IFlags>(
  `
    Usage:
      $ npm ${yellow('<task>')} -- ${yellow('<options>')}

    Tasks:
      run serve               start preview server
      start                   alias of "run serve"
      test                    run tests
      run coverage            generate coverage report
      run build               build the source code

    Options:                                                     [${gray('default value')}]
      common:
        -h, --help            show this help message
        -d, --development     Set NODE_ENV to "development"      [${yellow('false')}]
        -s, --skip-npm-check
      developing:
        -p, --port            port of preview server             [${blue('8888')}]
        -l, --livereload      the hostname to bind & livereload  [${green('"localhost"')}]
        --ping                emulate the network delay (ms)     [${blue('0')}]
        -e, --backend         destination of backend proxy       [${green('"http://localhost:3000"')}]

    For more detail of tasks / options, see code in "dev/gulp" directory.
  `,
  {
    flags: {
      help        : {
        alias: 'h',
      },
      development : {
        alias  : 'd',
        default: DEFAULT_IS_DEVELOPMENT,
        type   : 'boolean',
      },
      skipNpmCheck: {
        alias  : 's',
        default: false,
        type   : 'boolean',
      },
      port        : {
        alias  : 'p',
        default: DEFAULT_PORT,
      },
      livereload  : {
        alias  : 'l',
        default: DEFAULT_LIVERELOAD,
        type   : 'string',
      },
      ping        : {
        default: DEFAULT_PING,
      },
      backend     : {
        alias  : 'e',
        default: DEFAULT_BACKEND,
        type   : 'string',
      },
    },
  },
)
开发者ID:whitetrefoil,项目名称:flickr-simple-reorder,代码行数:60,代码来源:config.ts


示例3: checkArgs

export async function checkArgs(): Promise<string> {
  const cli = meow(
    `
	Usage
    $ arrivals-osx [install|watch]
  Commands
    install             Installs a plist and triggers launchctl
    watch               Immediately invokes the arrivals watch function
    `,
    {
      flags: {}
    }
  );

  return cli.input[0];
}
开发者ID:mshick,项目名称:arrivals-osx,代码行数:16,代码来源:args.ts


示例4: meow

import sourcesConfig from './sources.json';

/* eslint-disable max-len */
const cli = meow(`
    ${chalk.dim.underline('Usage:')}
      ${chalk.dim('$')} ${chalk.green('devcomic')} ${chalk.dim('[')}${chalk.yellow('options')} ${chalk.dim(']')} ${chalk.dim('[')}${chalk.yellow('source')} ${chalk.dim('...]')}

    ${chalk.dim.underline('Sources:')}
      ${chalk.yellow('commitstrip')}
      ${chalk.yellow('xkcd')}
      ${chalk.yellow('hacktoon')}

    ${chalk.dim.underline('Options:')}
      ${chalk.yellow('-p, --preview')}\t${chalk.dim('Opens a preview of the comic image')}

    ${chalk.dim.underline('Examples:')}
      ${chalk.dim('$')} ${chalk.green('devcomic')}
      ${chalk.dim('$')} ${chalk.green('devcomic')} ${chalk.yellow('-p')}
      ${chalk.dim('$')} ${chalk.green('devcomic')} ${chalk.yellow('commitstrip')}
      ${chalk.dim('$')} ${chalk.green('devcomic')} ${chalk.yellow('commitstrip xkcd')}
`, {
    flags: {
        preview: {
            type: 'boolean',
            alias: 'p'
        }
    }
});
/* eslint-enable max-len */

const sources = cli.input.length > 0
开发者ID:arnellebalane,项目名称:devcomic,代码行数:31,代码来源:cli.ts


示例5: main

#!/usr/bin/env node

const meow = require("meow");

import { compare } from "./index";

const cli = meow(`
    Usage
        $ site-comp <url1> <url2> <output-file-name>

    Example
        $ site-comp http://google.com http://bing.com diff.png

`, {
    alias: {
        h: "help"
    }
});

async function main(url1: string, url2: string, outputFileName: string) {
    await compare(url1, url2, outputFileName);
    console.log("Done!");
}

main(cli.input[0], cli.input[1], cli.input[2]);




开发者ID:chuckhendo,项目名称:site-compare,代码行数:25,代码来源:cli.ts


示例6: meow

#!/usr/bin/env node
import '@babel/polyfill';
import meow from 'meow';
import chalk from 'chalk';
import openImage from '.';

const cli = meow(`
    ${chalk.dim.underline('Usage:')}
      ${chalk.dim('$')} ${chalk.green('open-image')} ${chalk.yellow('<image-path>')}

    ${chalk.yellow('<image-path>')} ${chalk.dim('can be a filesystem path or url to the image')}

    ${chalk.dim.underline('Examples:')}
      ${chalk.dim('$')} ${chalk.green('open-image')} ${chalk.yellow('sample-image.jpg')}
      ${chalk.dim('$')} ${chalk.green('open-image')} ${chalk.yellow('http://site.com/image.jpg')}
`);

const imagePath = cli.input[0];
openImage(imagePath);
开发者ID:arnellebalane,项目名称:open-image,代码行数:19,代码来源:cli.ts


示例7: require

const meow = require('meow');
const HTMLparser = require('posthtml-parser');
const TreeRender = require('posthtml-render');
const mkdirp = require('mkdirp');

// @todo optimize tree shaking

const cli = meow({
  help: `
    Usage
      $ inline-css <input>

    Options
      -i --input <required>
      -o? --output?

    Examples
      $ inline-css -i ./test.html
      🌈 unicorns 🌈
`,
  alias: {
    i: 'input',
    o: 'output'
  }
});

interface TreeNode {
  tag: string,
  attrs: any,
  content: Array<string | TreeNode>
}
开发者ID:globallogic-lab,项目名称:inline-external-css,代码行数:31,代码来源:index.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript merge.default函数代码示例发布时间:2022-05-25
下一篇:
TypeScript menu.setApplicationMenu函数代码示例发布时间: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