@nnao45/jsq
v0.2.18
Published
JavaScript-Powered JSON Query CLI Tool
Downloads
129
Maintainers
Readme
jsq - JavaScript-Powered JSON Query CLI
🇯🇵 日本語 | 🇺🇸 English | 📚 Documentation
jsq is a secure, jQuery/Lodash-style JSON processor with 110+ built-in methods, multi-core parallel processing, and a beautiful interactive REPL. Process JSON with familiar JavaScript syntax - no external dependencies needed.
✨ Why jsq?
# 🔗 jQuery-style chaining with 110+ built-in methods
cat data.json | jsq '$.users.filter(u => u.active).pluck("name").uniq().upperCase()'
# 🎨 Beautiful interactive REPL with real-time evaluation
curl -H "Accept: application/json" https://api.example.com/data | jsq
# 🔒 Secure VM isolation by default
cat sensitive.json | jsq '$.private' # Safe: No file/network access
# 📝 Intuitive variable declarations
jsq "const names = ['Alice', 'Bob'] | names.map(n => n.toUpperCase())"
# 🚀 parallel processing
cat huge.jsonl | jsq --parallel '$.filter(item => item.active)'🚀 Quick Start
# Install
npm install -g @nnao45/jsq
# Basic usage
echo '{"users": [{"name": "Alice", "active": true}]}' | jsq '$.users.filter(u => u.active)'
# Direct file processing
jsq '$.length' --file data.json
# Interactive REPL
jsq
# Interactive REPL with pipe!
echo '{"users": [{"name": "Alice", "active": true}]}' | jsq 🌟 Key Features
| Feature | Description |
|---------|------------------------------------------------------|
| jQuery-style API | Familiar $.filter(), $.map(), $.pluck() syntax |
| 110+ Built-in Methods | Lodash utilities + RxJS reactive operators included |
| Parallel Processing | Use all CPU cores - 20x faster than jq |
| Interactive REPL | Beautiful real-time evaluation with tab completion |
| Secure VM Isolation | Safe execution by default |
| Multi-Runtime Support | Works with Node.js, Bun, Deno and WASM |
🔧 Dependencies
| Runtime | Version Requirement | |---------|-------------------| | Node.js | ≥ v20.9.0 (LTS) | | Bun (experimental) | ≥ v1.2.0 | | Deno (experimental) | ≥ v2.1 (LTS) |
📚 Documentation
For comprehensive documentation, visit nnao45.github.io/jsq:
💡 Common Use Cases
# Data Analysis
cat sales.json | jsq '$.groupBy(s => s.category).entries().map(([cat, items]) => ({
category: cat,
total: _.sum(items.map(i => i.amount)),
average: _.mean(items.map(i => i.amount))
}))'
# Log Processing (with parallel execution)
cat logs.jsonl | jsq --parallel --stream '$.filter(log => log.level === "error")'
# API Response Transformation
curl api.example.com/users | jsq '$.data.users.map(u => _.pick(u, ["id", "name", "email"]))'
# Real-time Monitoring
jsq '$.servers.filter(s => s.status === "down").length' --file status.json --watch🔄 Migration from jq
| jq | jsq |
|----|-----|
| .users[] \| select(.active) | $.users.filter(u => u.active) |
| .users[] \| .name | $.users.pluck("name") |
| .users \| length | $.users.length() |
| .products \| sort_by(.price) | $.products.sortBy("price") |
🤝 Contributing
Contributions are welcome! See our Contributing Guide.
📄 License
MIT License
🤝 Support & Feedback
Please report bugs and feature requests on GitHub Issues.
@nnao45/jsq revolutionizes JSON processing with a beautiful, interactive interface that makes data exploration enjoyable. By combining the power of jq with JavaScript familiarity and stunning visual design, it's the ultimate tool for developers who value both functionality and aesthetics.

