Releases: devlooped/JQSharp
v1.0.1
What's Changed
β¨ Implemented enhancements
π Documentation updates
Full Changelog: v1.0.0...v1.0.1
Sponsors
The following sponsors made this release possible: @clarius, @MFB-Technologies-Inc, @sandrock, @drivenet, @Keflon, @tbolon, @kfrancis, @unoplatform, @rbnswartz, @jfoshee, @Mrxx99, @eajhnsn1, @Jonathan-Hickey, @KenBonny, @SimonCropp, @agileworks-eu, @arsdragonfly, @vezel-dev, @ChilliCream, @4OTC, @DominicSchell, @adalon, @Eule02, @torutek, @mccaffers, @SeikaLogiciel, @wizardness, @latonz.
Thanks π
v1.0.0
π Release Notes β jq# (JQSharp)
A full .NET implementation of the jq filter language for querying and transforming JSON.
β Full Feature Parity with jq
π€ Basic Selectors & Composition
- Identity (
.), field access (.foo,.foo.bar), string/index subscripts (.[string],.[number]) - Slices (
.[n:n]), iterators (.[],.[]?) - Pipe (
|), comma (,), parentheses - Array (
[expr]) and object ({key: value}) constructors - Recursive descent (
..)
π¬ Comments
#line comments with\continuation to the next line
π’ Operators
- Arithmetic:
+,-,*,/,%with type-aware behavior for strings, arrays, and objects - Unary negation:
-expr - Comparison:
==,!=,<,>,<=,>= - Logical:
and,or,not - Alternative:
//β falls back to right-hand side when left isfalseornull
π Conditionals
if-then-elif-else-end
β Optional Operator
?β suppresses errors on any expression
π¦ Literals
null,true,false, numbers, strings (with escape sequences)
ποΈ Builtin Functions
Zero-Argument Builtins
- Generator:
empty - Type introspection:
type,length,utf8bytelength,infinite,nan,isinfinite,isnan,isfinite,isnormal - Type selectors:
arrays,objects,iterables,booleans,numbers,normals,finites,strings,nulls,values,scalars - Object/array:
keys,keys_unsorted,reverse,sort,unique,flatten,add,any,all,min,max,to_entries,from_entries,paths,transpose,combinations - Conversion:
tonumber,tostring,toboolean,tojson,fromjson,explode,implode,ascii_downcase,ascii_upcase - Math:
abs,floor,sqrt - String:
trim,ltrim,rtrim - Other:
recurse,halt,env,builtins,first,last
π Type/Value Testing & Selection
has(key),in,select(expr),contains(element),insideisempty(exp),any(cond),all(cond),any(gen; cond),all(gen; cond)
βοΈ String Operations
startswith(str),endswith(str)ltrimstr(str),rtrimstr(str),trimstr(str)split(str),join(str)
ποΈ Array/Collection Transformation
map(f),map_values(f),with_entries(f)flatten(depth),combinations(n),add(generator)
π Sorting, Grouping & Extrema
sort_by(path),group_by(path),unique_by(path)min_by(path),max_by(path)
π Search & Indexing
index(s),rindex(s),indices(s),bsearch(x)
πΊοΈ Path Expressions & Structural Manipulation
path(expr),paths(filter),pick(pathexps),del(expr)getpath(PATHS),delpaths(PATHS),setpath(PATHS; VALUE)
π Generators & Iteration
range(upto),range(from; upto),range(from; upto; by)limit(n; expr),skip(n; expr),first(expr),last(expr)nth(n),nth(n; expr)while(cond; update),until(cond; next),repeat(exp)recurse(f),recurse(f; cond),walk(f)
β οΈ Error Control
error(message),halt_error(exit_code),$__loc__
π§΅ String Interpolation
\(expr)inside string literals β full support for nested expressions
π‘οΈ try-catch & Error Handling
try EXP catch EXP,try EXP(shorthand),error(0-arg)?operator as syntactic sugar fortry EXP
π Variables & Binding
EXP as $identifier | ...- Destructuring:
. as [$a, $b],. as {$a, $b},. as {key: $var} $ENVvariable
π reduce & foreach
reduce EXP as $var (INIT; UPDATE)foreach EXP as $var (INIT; UPDATE; EXTRACT)
π§© User-Defined Functions
def name: body;def name(f)β filter argumentsdef name($var)β value arguments (syntactic sugar)- Full function scoping, recursion, and multiple definitions by arity
ποΈ Assignment Operators
- Update-assignment:
|= - Plain assignment:
= - Arithmetic update-assignment:
+=,-=,*=,/=,%=,//= - Complex assignments (LHS with iterators,
select, etc.)
π¨ Format Strings & Escaping
@base64,@base64d,@html,@uri,@urid,@csv,@tsv,@sh,@json,@text- Combined format with interpolation:
@foo "string with \(expr)"
π‘ Regular Expressions
test(val),test(regex; flags)match(val),match(regex; flags),capture(val),capture(regex; flags)scan(regex),scan(regex; flags)split(regex; flags),splits(regex),splits(regex; flags)sub(regex; tostr),sub(regex; tostr; flags)gsub(regex; tostr),gsub(regex; tostr; flags)
β Math Functions
- One-input:
acos,acosh,asin,asinh,atan,atanh,cbrt,ceil,cos,cosh,erf,erfc,exp,exp2,expm1,fabs,floor,log,log10,log2,round,sin,sinh,tan,tanh,trunc, and more - Two-input:
atan2,pow,fmax,fmin,fmod,hypot,remainder, and more - Three-input:
fma
π Date Functions
now,todate,fromdate,todateiso8601,fromdateiso8601strptime(fmt),strftime(fmt),strflocaltime(fmt)gmtime,localtime,mktime
π¦ Advanced Control Flow
label $name | ... break $name ...- Destructuring alternative operator
?// - SQL-style operators:
INDEX,IN,JOIN
π‘ JSONL / NDJSON Streaming
- Async streaming support for JSONL and NDJSON input
π¦ Modules
include RelativePathString [<metadata>];β include modules with path resolution and cachingimport RelativePathString as NAME [<metadata>];β import modules as a namespaceimport RelativePathString as $NAME [<metadata>];β import data modules as a variable
Full Changelog: https://github.com/devlooped/JQSharp/commits/v1.0.0-beta
Sponsors
The following sponsors made this release possible: @clarius, @MFB-Technologies-Inc, @sandrock, @drivenet, @Keflon, @tbolon, @kfrancis, @unoplatform, @rbnswartz, @jfoshee, @Mrxx99, @eajhnsn1, @davidjenni, @Jonathan-Hickey, @KenBonny, @SimonCropp, @agileworks-eu, @arsdragonfly, @vezel-dev, @ChilliCream, @4OTC, @DominicSchell, @adalon, @Eule02, @torutek, @mccaffers, @SeikaLogiciel, @wizardness.
Thanks π