JSV (JSON CSV) - A simple data system with JST templates, JB databases, and JQL queries
npm install jsv-systemJSV System - JSON CSV Database
A simple, file-based data system with JST templates, JB databases, and JQL queries.
š Quick Start
``bashInstall globally
npm install -g jsv-system
š What is JSV?
JSV is a three-file system for managing data:
1. .jst - JSON Source Template (human writes this)
2. .jb - JSON Bytecode (system stores this)
3. .jsv - JSON CSV Export (Excel opens this)
⨠Features
Ā· ā
Simple JST syntax - Write data like key: value
Ā· ā
JB databases - Optimized, indexed storage
Ā· ā
JQL queries - Simple path-based queries
Ā· ā
Excel export - .jsv files open in Excel
Ā· ā
No servers - Everything is file-based
Ā· ā
Schema validation - Type checking built-in
š JST Syntax Example
`jst
import requireddatabase{
name: "users"
version: "1.0"
}
required{
*
}
schema{
id: {type: "int", primary: true, auto: true}
name: {type: "string", required: true}
email: {type: "string", unique: true}
age: {type: "int", min: 0, max: 150}
active: {type: "bool", default: true}
}
data{
{name: "Alice", email: "alice@example.com", age: 30}
{name: "Bob", email: "bob@example.com", age: 25}
}
`š ļø Installation
`bash
Global installation (recommended)
npm install -g jsv-systemLocal installation
npm install jsv-systemDevelopment installation
git clone https://github.com/JSV-net/jsv-system.git
cd jsv-system
npm install
npm link
`š» Usage
Initialize a Project
`bash
jsv init myproject
cd myproject
`Compile JST to JB
`bash
jsv compile users.jst
Creates: .jsv/databases/users.jb
`Query with JQL
`bash
Get all users
jsv query "QUERY users.data"Filter users
jsv query "QUERY users.data WHERE age > 25"Count records
jsv query "COUNT users.data WHERE active = true"
`Export to JSV/CSV
`bash
jsv export users.jb users.csv
Creates: exports/users.csv (opens in Excel)
`Interactive Shell
`bash
jsv shell
Enter interactive mode
`š JQL Query Language
Basic Queries
`jql
QUERY users.data
QUERY products.data WHERE price < 100
COUNT orders.data WHERE status = "shipped"
`Path Queries
`jql
QUERY users.data[0] # Get first user
QUERY users.indexes.name.Alice # Find by index
QUERY users.data GET name, email # Select specific fields
`Conditions
`jql
WHERE age > 25
WHERE name = "Alice" AND active = true
WHERE price BETWEEN 10 AND 100
WHERE email LIKE "%@gmail.com"
`š File Structure
`
myproject/
āāā data.jst # Your JST files
āāā .jsv/ # System folder (auto-created)
ā āāā databases/
ā āāā data.jb # Compiled databases
āāā exports/
āāā data.jsv # Exported files (Excel-ready)
`š§ Commands
Command Description
jsv init [name] Create new project
jsv compile Compile JST to JB
jsv query "" Run JQL query
jsv export [output] Export to JSV/CSV
jsv shell Start interactive shell
jsv help [command] Show help
š Example: Inventory System
inventory.jst:
`jst
import requireddatabase{ name: "inventory" }
required{ * }
schema{
sku: {type: "string", primary: true}
name: {type: "string"}
price: {type: "float", min: 0}
stock: {type: "int", min: 0}
category: {type: "string"}
}
data{
{sku: "A100", name: "Laptop", price: 999.99, stock: 10, category: "electronics"}
{sku: "B200", name: "Mouse", price: 25.50, stock: 50, category: "electronics"}
}
`Commands:
`bash
jsv compile inventory.jst
jsv query "QUERY inventory.data WHERE category = 'electronics'"
jsv query "QUERY inventory.data WHERE stock < 20"
jsv export inventory.jb low-stock.csv
``šÆ Use Cases
Ā· Small businesses - Inventory, customers, invoices
Ā· Researchers - Experiment data, surveys
Ā· Teachers - Student records, grades
Ā· Developers - App configuration, local caching
Ā· Analysts - Data cleaning before Excel/PowerBI
š¦ Data Types
Type Example Description
int {age: 25} Integer numbers
float {price: 19.99} Decimal numbers
string {name: "Alice"} Text
bool {active: true} Boolean
timestamp {created: auto} Date/time
json {meta: {}} JSON objects/arrays
ā” Performance
Ā· Compression - JB files are 30-50% smaller than JSON
Ā· Indexing - Queries use indexes for 100x faster lookups
Ā· Memory - Only loads required data, not entire files
Ā· Export - Direct streaming to CSV format
š Data Safety
Ā· Automatic backups - Configurable backup system
Ā· Validation - Schema validation on compile
Ā· Checksums - Data integrity verification
Ā· Atomic writes - Prevents corruption
ā FAQ
Q: Do I need a database server?
A: No! JSV is completely file-based. No servers, no installations.
Q: Can I open JSV files in Excel?
A: Yes! .jsv files are CSV with metadata comments. Excel ignores # lines.
Q: How is this different from JSON/CSV?
A: JSV adds schema validation, indexing, and queries while keeping file simplicity.
Q: Can multiple users access the same JB file?
A: Yes, but for production use, implement file locking or use as read-only.
Q: Is there a GUI?
A: Currently CLI only, but web GUI is planned.
š§ Roadmap
Ā· Web-based GUI
Ā· Real-time collaboration
Ā· Cloud sync
Ā· Plugins/extensions
Ā· Mobile app
š License
MIT License - see LICENSE file
š¤ Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests
5. Submit a pull request
š Bug Reports
Please report bugs on the GitHub Issues page.
š Support
Ā· š Documentation
Ā· š¬ Discord Community
Ā· š¦ Twitter
---
Made with ā¤ļø for people who love data but hate complexity.