Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wapm-packages/fortune
A fortune teller written in Rust
https://github.com/wapm-packages/fortune
Last synced: 6 days ago
JSON representation
A fortune teller written in Rust
- Host: GitHub
- URL: https://github.com/wapm-packages/fortune
- Owner: wapm-packages
- Created: 2019-05-08T01:22:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-02T03:34:03.000Z (about 5 years ago)
- Last Synced: 2024-08-02T06:11:31.472Z (3 months ago)
- Language: Rust
- Size: 419 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-wasi - fortune
README
# fortune
`fortune` is a program that displays a pseudorandom message from a database of quotations that first appeared in Version 7 Unix.[1][irrelevant citation] The most common version on modern systems is the BSD fortune, originally written by Ken Arnold.[2] Distributions of fortune are usually bundled with a collection of themed files, containing sayings like those found on fortune cookies (hence the name), quotations from famous people, jokes, or poetry.
You can install fortune with:
```shell
wapm install -g fortune
```## Running
```bash
$ fortune
Opportunity knocks, but doesn't always answer to its name.
-- Mason Cooley
```Print help
```shell
$ fortune -h
available commands:
-h this screen right here.
-o output short,medium or long quotes only.
```## Building from Source
First, you will need the WASI target installed in your Rust system:
```shell
rustup target add wasm32-wasi
```Once WASI is available, you can build the WebAssembly binary by yourself with:
```shell
cargo build --release --target wasm32-wasi
```This will create a new file located at `target/wasm32-wasi/release/fortune.wasm`.
When the wasm file is created you can upload it to wapm or execute it with wasmer:
```shell
wapm publish
# OR
wasmer run target/wasm32-wasi/release/fortune.wasm
```You can also build a native executable with
```shell
cargo build
```