Thanks to visit codestin.com
Credit goes to github.com

Skip to content

wader/tar.jq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

tar.jq

tar archive creator for jq.

Usage

The tar(g) functions takes filter g as argument that should output zero or more file objects with the required keys name and data. See source code for other optional keys.

# -n means don't read any input files
# -j raw string output any skip new lines
# -L . add current directory to library path so that include("tar") includes tar.jq
$ jq -nj -L . 'include "tar"; tar(
    {name: "hello.txt", data: "world\n"},
    {name: "test.json", data: ({hello: "world"} | tojson)}
)' | tar x
-rw-r--r--  0 user   group       5  1 Jan  1970 hello.txt
-rw-r--r--  0 user   group      17  1 Jan  1970 test.json
$ cat hello.txt
world
$ cat file.json
{"hello":"world"}

License

Copyright (c) 2025 Mattias Wadman

tar.jq is distributed under the terms of the MIT License.

See the LICENSE file for license details.

About

tar archive creator for jq

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages