Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for WASIX and published it to Wasmer! #132

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ resolver = "2"

[profile.release]
strip = true
codegen-units = 1
opt-level = 'z'
lto = true
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ jaq should work on any system supported by Rust.
If it does not, please file an issue.


You can also use [Wasmer](https://wasmer.io) to run `jaq` without an
installation required, using the [jaq/jaq package](https://wasmer.io/jaq/jaq):

$ echo '{"a": 1, "b": 2}' | wasmer run jaq/jaq '.a'

$ seq 1000 | wasmer run jaq/jaq -- -n 'foreach inputs as $x (0; . + $x)'


## Binaries

You may also install jaq using [homebrew](https://formulae.brew.sh/formula/jaq) on macOS or Linux:
Expand Down
7 changes: 7 additions & 0 deletions build-wasmer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# You'll need to have Cargo WASIX installed (`cargo install cargo-wasix`)
cargo wasix build --release --no-default-features

# Then, for publishing
# wasmer publish
17 changes: 17 additions & 0 deletions wasmer.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = 'jaq/jaq'
version = '0.1.3'
description = 'Just another JSON query tool'
readme = "README.md"
repository = "https://github.com/01mf02/jaq"

# See more keys and definitions at https://docs.wasmer.io/registry/manifest

[[module]]
name = 'jaq'
source = 'target/wasm32-wasmer-wasi/release/jaq.wasm'
abi = 'wasi'

[[command]]
name = 'jaq'
module = 'jaq'