$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
jq at the Shortcuts
Search
cockscomb
December 22, 2022
Programming
1
2k
jq at the Shortcuts
Presented @ potatotips#80
cockscomb
December 22, 2022
Tweet
Share
More Decks by cockscomb
See All by cockscomb
GraphQL放談
cockscomb
4
2.1k
GraphQL Highway
cockscomb
28
8.6k
吉田を支える技術
cockscomb
0
2.4k
コーポレートサイトを静的化してAmplify Consoleにデプロイする
cockscomb
0
3.4k
ユーザインターフェイスと非同期処理
cockscomb
5
2k
GUIアプリケーションの構造と設計
cockscomb
10
10k
イカリング2におけるシングルページアプリケーション
cockscomb
2
7.6k
あなたの知らない UIKit の世界 — UITableView に UITextView を置きたい
cockscomb
1
7.5k
iOSアプリエンジニアのためのAndroidアプリ開発
cockscomb
7
1.9k
Other Decks in Programming
See All in Programming
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
240
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
220
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
130
マスタデータ問題、マイクロサービスでどう解くか
kts
0
110
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
510
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
160
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
410
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
450
TUIライブラリつくってみた / i-just-make-TUI-library
kazto
1
410
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
740
DevFest Android in Korea 2025 - 개발자 커뮤니티를 통해 얻는 가치
wisemuji
0
160
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
18
7.6k
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.7k
Context Engineering - Making Every Token Count
addyosmani
9
540
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
340
Git: the NoSQL Database
bkeepers
PRO
432
66k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
47
33k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
The Pragmatic Product Professional
lauravandoore
37
7.1k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
29
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
400
4 Signs Your Business is Dying
shpigford
186
22k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
86
Transcript
.app jq
id:cockscomb
jq
jq stedolan.github.io/jq/ $ echo '{"foo": "bar"}' | jq '.foo' "bar"
gh Scripting with GitHub CLI | The GitHub Blog $
gh api ... -- jq '.[].login' # = > "user1" # = > "user2" # = > ...
jq JSON
.app
URL
None
jq
Swift jq
gojq itchyny/gojq: Pure Go implementation of jq
golang.org/x/mobile
package binding import ( "github.com/itchyny/gojq" _ "golang.org/x/mobile/bind" ) type Query
struct { query *gojq.Query } func NewQuery(src string) (*Query, error) { query, err := gojq.Parse(src) if err != nil { return nil, err } return &Query{query: query}, nil } func (q *Query) Run(input []byte) (*Iterator, error) { ... }
$ gomobile bind \ -target=ios,iossimulator,macos,maccatalyst \ -iosversion 14 \ -prefix
GOJQ \ -o Frameworks/GOJQBinding.xcframework \ github.com/cockscomb/swift-gojq/binding
import Foundation open class GOJQBindingIterator : NSObject, goSeqRefInterface { public
init() open func next() throws -> Data } open class GOJQBindingQuery : NSObject, goSeqRefInterface { public init?(_ src: String?) open func run(_ input: Data?) throws -> GOJQBindingIterator } public func GOJQBindingNewQuery(_ src: String?, _ error: NSErrorPointer) -> GOJQBindingQuery?
import GOJQBinding enum QueryError: Error { case unknown } public
struct Query { private let binding: GOJQBindingQuery public init(_ query: String) throws { var error: NSError? guard let binding = GOJQBindingNewQuery(query, &error) else { throw error ?? QueryError.unknown } self.binding = binding } public func run(_ input: Data) throws -> AsyncThrowingStream<Data, any Error> { ... } }
None
// swift-tools-version: 5.7 import PackageDescription let package = Package( name:
"SwiftGoJq", platforms: [ .macOS(.v13), .macCatalyst(.v14), .iOS(.v14) ], products: [ .library(name: “SwiftGoJq”, targets: ["SwiftGoJq"]), ], dependencies: [], targets: [ .binaryTarget( name: "GOJQBinding", url: "https://github.com/cockscomb/swift-gojq/releases/download/0.1.0/ GOJQBinding.xcframework.zip", checksum: "1c45710de17fb7020dcfc75105344729725c5e3875e7058e98790e5f4e178162"), .target( name: "SwiftGoJq", dependencies: [ "GOJQBinding", ]), ] )
cockscomb/swift-gojq
None
import AppIntents import AsyncAlgorithms import SwiftGoJq struct JQIntent: AppIntent {
static var title: LocalizedStringResource = "jq" @Parameter(title: "JSON") var input: String @Parameter(title: "Query") var query: String static var parameterSummary: some ParameterSummary { Summary("\(\.$input) | jq '\(\.$query)'") } func perform() async throws -> some IntentResult { let jq = try Query(query) let results = try jq.run(input) let array = try await Array(results) return .result(value: array) } }
None
None
WEB+DB PRESS vol. 1 3 2 iOS 1 6 12/24
3 id:cockscomb id:yutailang 01 19 id:kouki_dan