8ball 中文文档教程

发布于 9年前 浏览 26 项目主页 更新于 3年前

The Magic 8 Ball

Magic 8 Ball 是一种用于算命或寻求建议的玩具。

install:

$ npm i --save 8ball

usage:

const eightball = require('8ball')()
console.log(`do you need a new lease on life? ${eightball}`)
// do you need a new lease on life? it is decidedly so

cli:

8球还是????

$ npm i -g 8ball
$ 8ball 'will i be pretty?'
reply hazy, try again
$ 'will i be rich?'
concentrate and ask again

也接受标准输入:

$ echo 'will i be rich' | ????
please ask a question

(标准输入中没有 ? 匹配)

requirements:

node >=4

The Magic 8 Ball

The Magic 8 Ball is a toy used for fortune-telling or seeking advice.

install:

$ npm i --save 8ball

usage:

const eightball = require('8ball')()
console.log(`do you need a new lease on life? ${eightball}`)
// do you need a new lease on life? it is decidedly so

cli:

8ball or ????

$ npm i -g 8ball
$ 8ball 'will i be pretty?'
reply hazy, try again
$ ???? 'will i be rich?'
concentrate and ask again

also accepts stdin:

$ echo 'will i be rich' | ????
please ask a question

(no ? match in stdin)

requirements:

node >=4

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文