帮酷LOGO
  • 显示原文与译文双语对照的内容
文章标签:Configurable  tal  
cowsay is a configurable talking cow

  • 源代码名称:cowsay
  • 源代码网址:http://www.github.com/piuccio/cowsay
  • cowsay源代码文档
  • cowsay源代码下载
  • Git URL:
    git://www.github.com/piuccio/cowsay.git
  • Git Clone代码到本地:
    git clone http://www.github.com/piuccio/cowsay
  • Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/piuccio/cowsay
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
  • cowsay
     __________________
     <srsly dude, why?> 
     ------------------
     ^__^
     (oo)_______
     (__) )/
     ||----w |
     || ||

    cowsay是一个配置对话牛,最初用Perl编写,由托尼

    这个项目是原始程序的JavaScript翻译,并试图给 node.js. 带来同样的愚蠢

    安装

    npm install -g cowsay

    用法

    cowsay JavaScript FTW!

    或者

    cowthink node.js is cool

    它的作用与原始cowsay相同,所以请参考 cowsay(1) 或者运行 cowsay -h

     ________
     <indeed> 
     --------
    . ::!!!!!!!:.
    .!!!!!:.. :!!!!!!!!!!!!
     ~~~~!!!!!!.. :!!!!!!!!!UWWW$$$
     :$$NWX!!:. :!!!!!!XUWW$$$$$$$$$P
     $$$$$##WX!:. <!!!!UW$$$$" $$$$$$$$#
     $$$$$ $$$UX :!!UW$$$$$$$$$ 4$$$$$*
     ^$$$B $$$$ $$$$$$$$$$$$ d$$R"
    "*$bd$$$$ '*$$$$$$$$$$$o+#"
    """""""""""

    作为模块的使用

    cowsay可以用作任何其他npm依赖项

    var cowsay = require("cowsay");
    console.log(cowsay.say({
     text :"I'm a moooodule",
     e :"oO",
     T :"U"
    }));
    //or cowsay.think()
     _________________
    ( I'm a moooodule )
     -----------------
     o ^__^
     o (oO)_______
     (__) )/
     U ||----w |
     || ||

    来自标准输入的管道

    echo please repeat | cowsay

    在浏览器中的使用

    cowsay在你的浏览器中也工作,并且它的名称是 rollup/webpack/browserify/you 。

    import { say } from'cowsay';console.log(say({ text:'grazing in the browser' }));

    你可以通过导入相关的对象来自定义奶牛

    import { think, SQUIRREL } from'cowsay';console.log(think({
     text:'grazing in the browser',
     cow:SQUIRREL,
     eyes:'pp',
     tongue:';;',
    }));

    所有的奶牛都包含在包中,但是你可以使用 rollup/webdav树抖动特性来减少 final 包大小。

    浏览器选项

    say({
     text:'hello',
     cow:'', // Template for a cow, get inspiration from `./cows` eyes:'oo', // Select the appearance of the cow's eyes, equivalent to cowsay -e tongue:'L|', // The tongue is configurable similarly to the eyes through -T and tongue_string, equivalent to cowsay -T wrap:false, // If it is specified, the given message will not be word-wrapped. equivalent to cowsay -n wrapLength:40, // Specifies roughly where the message should be wrapped. equivalent to cowsay -W mode:'b', // One of"b","d","g","p","s","t","w","y"});


    文章标签:tal  Configurable  

    Copyright © 2011 HelpLib All rights reserved.    知识分享协议 京ICP备05059198号-3  |  如果智培  |  酷兔英语