{"id":34174868,"url":"https://github.com/dhawalhost/nqjson","last_synced_at":"2026-03-10T09:39:53.970Z","repository":{"id":312764123,"uuid":"1048235006","full_name":"dhawalhost/nqjson","owner":"dhawalhost","description":"nqjson - Next-gen Query JSON library for Go with powerful path queries and modifier","archived":false,"fork":false,"pushed_at":"2026-01-11T18:13:42.000Z","size":870,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-11T20:29:41.760Z","etag":null,"topics":["golang","json","json-path","parser","query"],"latest_commit_sha":null,"homepage":"https://nqjson.dhawalhost.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhawalhost.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG_NEW_FEATURES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-01T06:22:31.000Z","updated_at":"2026-01-11T18:07:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"e6766dc4-0362-49a7-8543-a41b92601710","html_url":"https://github.com/dhawalhost/nqjson","commit_stats":null,"previous_names":["dhawalhost/njson","dhawalhost/nqjson"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/dhawalhost/nqjson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhawalhost%2Fnqjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhawalhost%2Fnqjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhawalhost%2Fnqjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhawalhost%2Fnqjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhawalhost","download_url":"https://codeload.github.com/dhawalhost/nqjson/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhawalhost%2Fnqjson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30328891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","json","json-path","parser","query"],"created_at":"2025-12-15T12:02:47.523Z","updated_at":"2026-03-10T09:39:53.945Z","avatar_url":"https://github.com/dhawalhost.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NQJSON\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/dhawalhost/nqjson)](https://goreportcard.com/report/github.com/dhawalhost/nqjson) [![GoDoc](https://godoc.org/github.com/dhawalhost/nqjson?status.svg)](https://godoc.org/github.com/dhawalhost/nqjson) [![Static Badge](https://img.shields.io/badge/nqjson-playground-blue)](https://dhawalhost.github.io/nqjson-playground/)\n\n**nqjson** is a high-performance JSON manipulation library for Go that delivers **blazing-fast operations** with **zero allocations** on critical paths. Built for modern applications requiring extreme performance, minimal memory overhead, and advanced JSON processing capabilities.\n\n## ⚡ Why nqjson?\n\n### 🚀 **Zero-Allocation Performance**\n- **0 allocations** on simple GET operations\n- **No GC pressure** - Perfect for high-throughput systems\n- **Predictable latency** - No GC pauses in critical paths\n- **Memory efficient** - Minimal overhead even with complex queries\n\n### 🎯 **Powerful Features**\n- **Multipath Queries** - Get multiple values in one call: `user.name,user.email,user.age`\n- **Query Syntax** - Powerful array filtering: `#(age\u003e30)` (first match), `#(age\u003e30)#` (all matches)\n- **25+ Modifiers** - `@reverse`, `@sort`, `@sortby`, `@group`, `@map`, `@uniqueby`, `@sum`, `@avg`, `@min`, `@max`, `@pretty`, `@ugly`, `@valid`, `@this`, and more\n- **Wildcards** - Multi-char `*` and single-char `?` wildcards: `child*.name`, `item?.value`\n- **Path Caching** - 2-5x speedup with `GetCached()` for hot paths\n- **JSON Lines Support** - Native newline-delimited JSON processing with `..#`\n- **Path Escape Helpers** - Auto-escape special characters: `BuildEscapedPath()`, `EscapePathSegment()`\n- **Escape Sequences** - Manual escaping for keys with dots/colons: `fav\\.movie`, `user\\:name`\n- **Unicode Support** - Full UTF-8 support, Unicode keys work without escaping: `user_æøå`\n- **Complete CRUD** - GET, SET, DELETE with atomic operations\n\n### 💪 **Production Ready**\n- **Thread-safe** - Concurrent access without locks\n- **Battle-tested** - 73.9% test coverage with 168 comprehensive tests\n- **Zero dependencies** - No external runtime dependencies\n- **Type-safe** - Automatic type conversion with validation\n\n## 🌟 Key Features\n\n### 📊 Advanced Query Operations\n\n```go\n// Multipath - Get multiple fields in one call\nresult := nqjson.Get(json, \"user.name,user.email,user.age,user.status\")\n// Returns: [\"John Doe\",\"john@example.com\",30,\"active\"]\n\n// Statistical aggregations\ntotals := nqjson.Get(json, \"orders.#.amount|@sum\")      // Sum all amounts\naverage := nqjson.Get(json, \"ratings.#.score|@avg\")     // Average rating\nhighest := nqjson.Get(json, \"products.#.price|@max\")    // Highest price\n\n// Advanced transformations (jq-style)\ngrouped := nqjson.Get(json, \"users|@group:city\")        // Group by city\nsorted := nqjson.Get(json, \"users|@sortby:age\")         // Sort objects by age\nprojected := nqjson.Get(json, \"users|@map:name;email\")  // Project specific fields\nunique := nqjson.Get(json, \"users|@uniqueby:dept\")      // Unique by department\n```\n\n### 🔍 Flexible Path Expressions\n\n```go\n// Dot notation\ncity := nqjson.Get(json, \"address.city\")\n\n// Array indexing (multiple styles)\nfirst := nqjson.Get(json, \"items.0\")        // First element\nlast := nqjson.Get(json, \"items.3\")         // Fourth element\nbracket := nqjson.Get(json, \"items[2]\")     // Bracket notation\nlength := nqjson.Get(json, \"items.#\")       // Array length\n\n// Array appending (SET operations)\njson, _ = nqjson.Set(json, \"items.-1\", \"new\")      // Append using -1\njson, _ = nqjson.Set(json, \"items[-1]\", \"another\") // Bracket notation append\n\n// Wildcards (* and ?)\nallNames := nqjson.Get(json, \"users.*.name\")       // All user names\nallEmails := nqjson.Get(json, \"users.#.email\")     // Array iteration\nchildMatch := nqjson.Get(json, \"child*.first\")     // Match children, child1, etc.\nsingleChar := nqjson.Get(json, \"item?.value\")      // Match item1, itemA, etc.\n\n// Query syntax - First match #(condition)\nadult := nqjson.Get(json, \"users.#(age\u003e=18).name\")       // First adult's name\nactive := nqjson.Get(json, \"users.#(status==\\\"active\\\")\") // First active user\n\n// Query syntax - All matches #(condition)#\nallAdults := nqjson.Get(json, \"users.#(age\u003e=18)#.name\")  // All adult names\nallActive := nqjson.Get(json, \"users.#(active==true)#\")  // All active users\n\n// Pattern matching in queries\njNames := nqjson.Get(json, \"users.#(name%\\\"J*\\\")#.email\") // Users with J names\n```\n\n### ⚙️ Complete CRUD Operations\n\n```go\n// GET - Zero-allocation reads\nvalue := nqjson.Get(json, \"user.profile.email\")\n\n// SET - Atomic updates\nupdated, _ := nqjson.Set(json, \"user.status\", \"active\")\n\n// DELETE - Safe removal\ncleaned, _ := nqjson.Delete(json, \"user.temp_data\")\n\n// BATCH - Multiple operations\nresults := nqjson.GetMany(json, \"name\", \"email\", \"age\")\n```\n\n### 🎨 Data Transformations\n\n```go\n// Sort arrays\nsorted := nqjson.Get(json, \"scores|@sort\")              // Ascending\nreversed := nqjson.Get(json, \"scores|@sort|@reverse\")   // Descending\n\n// Extract unique values\nunique := nqjson.Get(json, \"categories|@distinct\")\n\n// Statistical operations\nsum := nqjson.Get(json, \"values|@sum\")\navg := nqjson.Get(json, \"values|@avg\")\nmin := nqjson.Get(json, \"values|@min\")\nmax := nqjson.Get(json, \"values|@max\")\n\n// Array manipulation\nfirst := nqjson.Get(json, \"items|@first\")\nlast := nqjson.Get(json, \"items|@last\")\nflattened := nqjson.Get(json, \"nested.arrays|@flatten\")\nkeys := nqjson.Get(json, \"user|@keys\")                  // Object keys\nvalues := nqjson.Get(json, \"user|@values\")              // Object values\n\n// Advanced transformations for object arrays\ngrouped := nqjson.Get(json, \"users|@group:city\")         // Group by field\nsortedBy := nqjson.Get(json, \"users|@sortby:age\")        // Sort objects by field\nmapped := nqjson.Get(json, \"users|@map:name;email\")      // Project fields (use ; separator)\nuniqueBy := nqjson.Get(json, \"users|@uniqueby:dept\")     // Unique by field\n\n// Modifier chaining with path continuation\nfirstReversed := nqjson.Get(json, \"children|@reverse|0\") // First of reversed\n\n// JSON formatting modifiers\npretty := nqjson.Get(json, \"@pretty\")                    // Pretty print\nugly := nqjson.Get(json, \"@ugly\")                        // Minify\nvalid := nqjson.Get(json, \"@valid\")                      // Validate JSON\nidentity := nqjson.Get(json, \"@this\")                    // Return unchanged\n\n// jq-style utility modifiers\nsliced := nqjson.Get(json, \"items|@slice:1:3\")           // Slice array [1:3)\nhasField := nqjson.Get(json, \"user|@has:email\")          // Check field exists\ncontains := nqjson.Get(json, \"tags|@contains:urgent\")    // Array/string contains\nsplit := nqjson.Get(json, \"path|@split:/\")               // Split string\nstartsWith := nqjson.Get(json, \"name|@startswith:Dr.\")   // String prefix check\nentries := nqjson.Get(json, \"config|@entries\")           // Object → [{key,value}]\nfromEntries := nqjson.Get(json, \"pairs|@fromentries\")    // [{key,value}] → Object\nanyTrue := nqjson.Get(json, \"flags|@any\")                // Any element truthy\nallTrue := nqjson.Get(json, \"flags|@all\")                // All elements truthy\n```\n\n### ⚡ Performance Optimization\n\n```go\n// Path caching for hot paths (2-5x faster)\nresult := nqjson.GetCached(json, \"frequently.accessed.path\")\n\n// Batch operations\nresults := nqjson.GetMany(json, \n    \"user.name\",\n    \"user.email\", \n    \"user.status\",\n    \"user.lastLogin\",\n)\n\n// Zero-copy string access\nif result.Type == nqjson.TypeString {\n    // Use Raw for zero allocations\n    rawValue := result.Raw\n}\n```\n\n## 📈 Performance\n\n### Benchmark Results\n\n| Operation | Time | Allocations | Memory |\n|-----------|------|-------------|--------|\n| Simple GET | 86 ns/op | 0 allocs/op | 0 B/op |\n| Nested GET (4 levels) | 224 ns/op | 0 allocs/op | 0 B/op |\n| Deep GET (8 levels) | 365 ns/op | 0 allocs/op | 0 B/op |\n| Array access (middle) | 10.8 μs/op | 0 allocs/op | 0 B/op |\n| Multipath (5 fields) | 4.7 μs/op | 4 allocs/op | 880 B/op |\n| Simple SET | 1.01 μs/op | 2 allocs/op | 592 B/op |\n| Simple DELETE | 244 ns/op | 1 alloc/op | 248 B/op |\n\n**Key Advantages:**\n- ✅ Zero allocations on all simple GET operations\n- ✅ No GC pressure for read-heavy workloads\n- ✅ Predictable performance under load\n- ✅ Excellent scalability for high-throughput systems\n\n## 📖 Documentation\n\n- **[Installation Guide](INSTALL.md)** - Step-by-step installation and setup\n- **[API Reference](API.md)** - Complete API documentation with examples\n- **[Path Syntax Guide](SYNTAX.md)** - Comprehensive path expression reference\n- **[Examples](EXAMPLES.md)** - Real-world usage patterns and recipes\n- **[Performance Benchmarks](BENCHMARKS.md)** - Detailed performance analysis\n- **[Performance Summary](PERFORMANCE_SUMMARY.md)** - Production optimization guide\n\n## 📦 Installation\n\n```bash\ngo get github.com/dhawalhost/nqjson\n```\n\n## 🧩 Go Version Compatibility\n\nnqjson is compatible with \u003e= 1.23.10\n\n- **Go 1.23.10+**:\n  ```bash\n  go get github.com/dhawalhost/nqjson@latest\n  ```\n\nThe public API remains consistent across versions.\n\n## � Quick Start\n\n### Simple GET Operations\n\n```go\nimport \"github.com/dhawalhost/nqjson\"\n\njson := []byte(`{\n    \"name\": \"John Doe\",\n    \"age\": 30,\n    \"skills\": [\"Go\", \"Python\", \"JavaScript\"],\n    \"address\": {\n        \"city\": \"New York\",\n        \"coordinates\": {\"lat\": 40.7128, \"lng\": -74.0060}\n    }\n}`)\n\n// Zero-allocation field access\nname := nqjson.Get(json, \"name\")\nfmt.Println(name.String())  // John Doe\n\n// Deep nested access\nlat := nqjson.Get(json, \"address.coordinates.lat\")\nfmt.Println(lat.Float())  // 40.7128\n\n// Array access\nskill := nqjson.Get(json, \"skills.0\")\nfmt.Println(skill.String())  // Go\n```\n\n### Multipath Queries (Unique to nqjson!)\n\n```go\njson := []byte(`{\n    \"user\": {\n        \"name\": \"Alice\",\n        \"email\": \"alice@example.com\",\n        \"age\": 28,\n        \"status\": \"active\"\n    }\n}`)\n\n// Get multiple fields in ONE call - Super efficient!\nresult := nqjson.Get(json, \"user.name,user.email,user.age,user.status\")\nfmt.Println(result.String())\n// [\"Alice\",\"alice@example.com\",28,\"active\"]\n```\n\n### Advanced Modifiers\n\n```go\njson := []byte(`{\n    \"scores\": [85, 92, 78, 95, 88, 92, 85],\n    \"sales\": [1200, 1500, 980, 2100, 1800]\n}`)\n\n// Statistical operations\nsum := nqjson.Get(json, \"sales|@sum\")\nfmt.Println(\"Total:\", sum.Float())  // 7580\n\navg := nqjson.Get(json, \"scores|@avg\")\nfmt.Println(\"Average:\", avg.Float())  // 87.857\n\n// Unique and sorted values\nunique := nqjson.Get(json, \"scores|@distinct|@sort\")\nfmt.Println(unique.String())  // [78,85,88,92,95]\n\n// Min/Max operations\nhighest := nqjson.Get(json, \"scores|@max\")  // 95\nlowest := nqjson.Get(json, \"scores|@min\")   // 78\n```\n\n### SET and DELETE Operations\n\n```go\njson := []byte(`{\"name\": \"John\", \"age\": 30}`)\n\n// Update field\njson, _ = nqjson.Set(json, \"age\", 31)\n\n// Add nested field (auto-creates structure!)\njson, _ = nqjson.Set(json, \"address.city\", \"Boston\")\n\n// Delete field\njson, _ = nqjson.Delete(json, \"age\")\n\nfmt.Println(string(json))\n// {\"name\":\"John\",\"address\":{\"city\":\"Boston\"}}\n```\n\n### Complex Filtering\n\n```go\njson := []byte(`{\n    \"products\": [\n        {\"name\": \"Laptop\", \"price\": 999, \"stock\": 15},\n        {\"name\": \"Mouse\", \"price\": 25, \"stock\": 150},\n        {\"name\": \"Keyboard\", \"price\": 75, \"stock\": 80},\n        {\"name\": \"Monitor\", \"price\": 299, \"stock\": 45}\n    ]\n}`)\n\n// Filter by condition\nexpensive := nqjson.Get(json, \"products.#(price\u003e100).name\")\nfmt.Println(expensive.String())  // [\"Laptop\",\"Monitor\"]\n\n// Calculate total value\ntotalValue := nqjson.Get(json, \"products.#.price|@sum\")\nfmt.Println(\"Total:\", totalValue.Float())  // 1398\n```\n\n### Path Escaping for Special Characters\n\n```go\n// When keys contain special characters (., @, *, etc.), use escape helpers\njson := []byte(`{}`)\n\n// Automatic escaping with BuildEscapedPath\npath := nqjson.BuildEscapedPath(\"config\", \"user@domain.com\", \"settings\")\njson, _ = nqjson.Set(json, path, \"active\")\nresult := nqjson.Get(json, path)\nfmt.Println(result.String())  // \"active\"\n\n// Escape individual segments\nkey := nqjson.EscapePathSegment(\"file.name\")  // Returns: file\\.name\njson, _ = nqjson.Set(json, \"data.\" + key, \"document.pdf\")\n\n// Unicode characters work without escaping\njson, _ = nqjson.Set(json, \"user_æøå\", \"Norwegian data\")\nresult = nqjson.Get(json, \"user_æøå\")\nfmt.Println(result.String())  // \"Norwegian data\"\n\n// Numeric keys as object properties (use : prefix)\njson, _ = nqjson.Set(json, \"data.:123\", \"numeric key\")\nresult = nqjson.Get(json, \"data.:123\")\n```\n\n**Special characters that require escaping:**  \n`\\ . : | @ * ? # , ( ) = ! \u003c \u003e ~`\n\n**Note:** Leading colon (`:`) for numeric object keys is preserved. Unicode characters never need escaping.\n\n## 📖 API Reference\n\n### GET Operations\n\n#### `Get(json []byte, path string) Result`\n\nRetrieves a value from JSON using a path expression.\n\n```go\njson := []byte(`{\"users\": [{\"name\": \"Alice\"}, {\"name\": \"Bob\"}]}`)\n\n// Get single value\nname := nqjson.Get(json, \"users.0.name\")\nfmt.Println(name.String()) // Alice\n\n// Check if value exists\nif name.Exists() {\n    fmt.Println(\"User found\")\n}\n\n// Type-safe conversions\nage := nqjson.Get(json, \"users.0.age\")\nif age.Exists() {\n    fmt.Println(\"Age:\", age.Int())\n} else {\n    fmt.Println(\"Age not found\")\n}\n```\n\n#### `GetMany(json []byte, paths ...string) []Result`\n\nRetrieves multiple values in a single operation.\n\n```go\njson := []byte(`{\"name\": \"John\", \"age\": 30, \"city\": \"NYC\"}`)\n\nresults := nqjson.GetMany(json, \"name\", \"age\", \"city\")\nfor i, result := range results {\n    fmt.Printf(\"Field %d: %s\\n\", i, result.String())\n}\n```\n\n### SET Operations\n\n#### `Set(json []byte, path string, value interface{}) ([]byte, error)`\n\nSets a value at the specified path.\n\n```go\njson := []byte(`{\"users\": []}`)\n\n// Add to array\nresult, err := nqjson.Set(json, \"users.-1\", map[string]interface{}{\n    \"name\": \"Alice\",\n    \"age\":  25,\n})\n\n// Update nested value\nresult, err = nqjson.Set(result, \"users.0.active\", true)\n```\n\n#### `SetWithOptions(json []byte, path string, value interface{}, options *SetOptions) ([]byte, error)`\n\nSets a value with advanced options.\n\n```go\noptions := \u0026nqjson.SetOptions{\n    MergeObjects: true,\n    MergeArrays:  false,\n}\n\nresult, err := nqjson.SetWithOptions(json, \"config\", newConfig, options)\n```\n\n#### `Delete(json []byte, path string) ([]byte, error)`\n\nRemoves a value at the specified path.\n\n```go\njson := []byte(`{\"name\": \"John\", \"age\": 30, \"temp\": \"delete_me\"}`)\n\nresult, err := nqjson.Delete(json, \"temp\")\n// Result: {\"name\": \"John\", \"age\": 30}\n```\n\n### Path Expressions\n\nnqjson supports powerful path expressions:\n\n```go\njson := []byte(`{\n    \"store\": {\n        \"books\": [\n            {\"title\": \"Go Programming\", \"price\": 29.99, \"tags\": [\"programming\", \"go\"]},\n            {\"title\": \"Python Guide\", \"price\": 24.99, \"tags\": [\"programming\", \"python\"]},\n            {\"title\": \"Web Design\", \"price\": 19.99, \"tags\": [\"design\", \"web\"]}\n        ]\n    }\n}`)\n\n// Array indexing\nfirstBook := nqjson.Get(json, \"store.books.0.title\")\n\n// Array filtering\nexpensiveBooks := nqjson.Get(json, \"store.books.#(price\u003e25).title\")\n\n// Wildcard matching\nallPrices := nqjson.Get(json, \"store.books.#.price\")\n\n// Complex expressions\nprogrammingBooks := nqjson.Get(json, \"store.books.#(tags.#(#==\\\"programming\\\")).title\")\n```\n\n### Result Types\n\nThe `Result` type provides type-safe access to values:\n\n```go\nresult := nqjson.Get(json, \"some.path\")\n\n// Check existence\nif result.Exists() {\n    // Type conversion methods\n    str := result.String()\n    num := result.Float()\n    integer := result.Int()\n    boolean := result.Bool()\n    \n    // Get underlying type\n    switch result.Type {\n    case nqjson.TypeString:\n        fmt.Println(\"String value:\", result.String())\n    case nqjson.TypeNumber:\n        fmt.Println(\"Number value:\", result.Float())\n    case nqjson.TypeBool:\n        fmt.Println(\"Boolean value:\", result.Bool())\n    case nqjson.TypeArray:\n        fmt.Println(\"Array with\", len(result.Array()), \"elements\")\n    case nqjson.TypeObject:\n        fmt.Println(\"Object value:\", result.Map())\n    }\n}\n```\n\n## 🎯 Advanced Usage\n\n### Batch Processing\n\n```go\n// Process multiple operations efficiently\njson := []byte(`{\"users\": [], \"config\": {}}`)\n\n// Compile paths for reuse (performance optimization)\nuserPath, _ := nqjson.CompileSetPath(\"users.-1\")\nconfigPath, _ := nqjson.CompileSetPath(\"config.theme\")\n\n// Use compiled paths\nresult, _ := nqjson.SetWithCompiledPath(json, userPath, newUser, nil)\nresult, _ = nqjson.SetWithCompiledPath(result, configPath, \"dark\", nil)\n```\n\n### Error Handling\n\n```go\nresult, err := nqjson.Set(json, \"invalid..path\", value)\nif err != nil {\n    switch err {\n    case nqjson.ErrInvalidPath:\n        fmt.Println(\"Path syntax error\")\n    case nqjson.ErrInvalidJSON:\n        fmt.Println(\"Invalid JSON input\")\n    default:\n        fmt.Println(\"Operation failed:\", err)\n    }\n}\n```\n\n### Memory Optimization\n\n```go\n// For high-performance scenarios, reuse byte slices\nvar buffer []byte\n\njson := getData()\nresult := nqjson.Get(json, \"important.field\")\n\n// Avoid string allocations when possible\nif result.Type == nqjson.TypeString {\n    // Use result.Raw for zero-copy access\n    rawBytes := result.Raw\n    // Process rawBytes directly\n}\n```\n\n## 🔍 Performance Tips\n\n1. **Use byte slices**: Work with `[]byte` instead of strings when possible\n2. **Compile paths**: For repeated operations, use `CompileSetPath` and `SetWithCompiledPath`\n3. **Batch operations**: Use `GetMany` for multiple field access\n4. **Zero-copy**: Use `Result.Raw` for string values to avoid allocations\n5. **Preallocate**: When building JSON, preallocate result slices\n\n## 📊 Benchmarks\n\nnqjson benchmarks are in a **separate Go module** (`benchmark/`) with **zero impact** on your dependencies.\n\n```bash\n# Navigate to benchmark directory\ncd benchmark\n\n# Run all benchmarks\ngo test -bench=. -benchmem\n\n# Run specific categories\ngo test -bench=BenchmarkGet -benchmem        # GET operations\ngo test -bench=BenchmarkSet -benchmem        # SET operations\ngo test -bench=MultiPath -benchmem           # Multipath queries\ngo test -bench=Modifier -benchmem            # Extended modifiers\n```\n\n**Why separate module?** The benchmark directory has its own `go.mod` file. This means:\n- ✅ Main nqjson library has **ZERO dependencies**\n- ✅ Benchmark dependencies (gjson/sjson) completely isolated\n- ✅ Your `go.mod` stays clean when you install nqjson\n\nFor detailed performance analysis, see [BENCHMARKS.md](BENCHMARKS.md).\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -am 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🎯 Use Cases\n\n**nqjson is perfect for:**\n\n- 🚀 **High-throughput APIs** - Zero allocations = no GC pressure\n- 📊 **Data Processing Pipelines** - Advanced modifiers for transformations\n- 🔥 **Real-time Systems** - Predictable latency without GC pauses\n- 📱 **Microservices** - Lightweight with zero dependencies\n- 🎮 **Gaming Backends** - Performance-critical JSON operations\n- 📈 **Analytics Systems** - Statistical aggregations built-in\n- 🔍 **Log Processing** - Native JSON Lines support\n\n## 🌟 Why Choose nqjson?\n\n1. **Zero Allocations** - No memory overhead on hot paths\n2. **Advanced Features** - Multipath, aggregations, and more\n3. **Production Ready** - Battle-tested with high test coverage\n4. **Developer Friendly** - Intuitive API with comprehensive docs\n5. **Type Safe** - Automatic type conversion with validation\n6. **Zero Dependencies** - Minimal attack surface, easy deployment\n\n## 🙏 Acknowledgments\n\nBuilt with performance, memory efficiency, and developer experience as primary goals. Optimized for modern Go applications and microservices architecture.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhawalhost%2Fnqjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhawalhost%2Fnqjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhawalhost%2Fnqjson/lists"}