| Crates.io | fact-wasm-core |
| lib.rs | fact-wasm-core |
| version | 1.0.0 |
| created_at | 2025-08-01 03:56:29.232273+00 |
| updated_at | 2025-08-01 03:56:29.232273+00 |
| description | FACT WASM Core - High-performance WebAssembly cognitive processing engine with advanced caching and template optimization |
| homepage | https://github.com/ruvnet/FACT |
| repository | https://github.com/ruvnet/FACT |
| max_upload_size | |
| id | 1776079 |
| size | 480,346 |
A high-performance cognitive template processing engine written in Rust with WebAssembly support.
cargo add fact
cargo install fact --features cli
wasm-pack build --target web
use fact::{FastCache, QueryProcessor};
fn main() {
// Create a cache instance
let mut cache = FastCache::new();
// Create a query processor
let processor = QueryProcessor::new();
// Process a query
let result = processor.process("your query here");
// Cache the result
cache.put("your query here".to_string(), result.clone());
// Retrieve from cache
if let Some(cached) = cache.get(&"your query here".to_string()) {
println!("Cached result: {}", cached);
}
}
# Process a query
fact query "What is the weather today?"
# Show cache statistics
fact cache stats
# Clear cache
fact cache clear
# Run benchmarks
fact benchmark --iterations 10000
# Show performance statistics
fact stats --detailed
import init, { FastCache, QueryProcessor } from './pkg/fact.js';
async function main() {
// Initialize WASM module
await init();
// Create instances
const cache = new FastCache();
const processor = new QueryProcessor();
// Process query
const result = processor.process("your query");
// Use cache
cache.put("key", "value");
const cached = cache.get("key");
}
main();
FACT achieves exceptional performance through:
rustc-hash and smallvecwasm32-unknown-unknown targetcurl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh# Clone the repository
git clone https://github.com/ruvnet/FACT
cd FACT/wasm
# Build WASM for web (recommended)
./build-wasm.sh
# Or manual build
wasm-pack build --target web --out-dir pkg --release
# Build Rust library
cargo build --release
# Build with CLI support
cargo build --release --features cli
# Run tests
cargo test
# Web target (default)
wasm-pack build --target web --out-dir pkg/web
# Node.js target
wasm-pack build --target nodejs --out-dir pkg/nodejs
# Bundler target
wasm-pack build --target bundler --out-dir pkg/bundler
# Run unit tests
cargo test
# Run benchmarks
cargo bench
# Run WASM tests
wasm-pack test --headless --firefox
Contributions are welcome! Please read our Contributing Guide for details.
MIT License - see LICENSE for details.