https://github.com/luckymarmot/jqkit
An Objective-C wrapper for jqlib https://stedolan.github.io/jq/
https://github.com/luckymarmot/jqkit
jq json
Last synced: about 2 months ago
JSON representation
An Objective-C wrapper for jqlib https://stedolan.github.io/jq/
- Host: GitHub
- URL: https://github.com/luckymarmot/jqkit
- Owner: luckymarmot
- License: mit
- Created: 2019-08-26T19:11:50.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-02-15T18:54:32.000Z (over 5 years ago)
- Last Synced: 2025-02-15T13:01:48.952Z (over 1 year ago)
- Topics: jq, json
- Language: Objective-C
- Homepage:
- Size: 3.6 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jqKit
An Objective-C wrapper for jqlib, the C library behind [jq](https://stedolan.github.io/jq/) (a lightweight and flexible JSON processor).
⚠️ Works only on macOS 10.10+
## Installation
Via Cocoapods:
```shell
pod 'macOSjqKit'
```
## Usage
```objc
NSString* program = @"."; // the jq filter
NSData* jsonData = [NSJSONSerialization dataWithJSONObject:@{@"foo":@0, @"bar":@42} options:kNilOptions error:NULL];
// filter
NSArray* results = [LMJqFilter filterWithProgram:program data:jsonData error:NULL];
// enumerate the results
[results enumerateObjectsUsingBlock:^(NSData * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
NSLog(@"result = %@", [[NSString alloc] initWithData:obj encoding:NSUTF8StringEncoding]);
}];
```
## Development
### Build `libjq` and `oniguruma`
```shell
make
```
### Influences
* [JQKit](https://github.com/fleitz/JQKit)
* [pyjq](https://github.com/doloopwhile/pyjq)
## License
Copyright 2019 Paw. MIT License.