Chisle
코딩 에이전트 플러그인, 20개 실시간 작업에서 기본 모델 52% 활용, 간결한 페르소나와 출력 압축 제공
JSON 텍스트와 R 벡터·리스트를 소규모 함수로 변환하며, yyjson을 내장해 별도 JSON 라이브러리가 필요 없습니다
Converts between JSON text and ordinary R vectors and lists through a small, predictable set of functions, backed by vendored yyjson <https://github.com/ibireme/yyjson> and requiring no system JSON li
개발 도구R · CGitHub @pedrobtz온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
Lightweight JSON Parsing and Serialization
README 전체를 불러오는 중입니다.
README 전문 보기 ↗zujson converts between JSON and ordinary R vectors and lists, using vendored
yyjson sources, so no system JSON library
is required. It exists to serve zuhttp: parsing a response body and building a
request body are the two things it is designed around, which makes it
deliberately narrower than jsonlite, with a type mapping that is fully documented.
Install the released version from CRAN:
install.packages("zujson")
Or the development version from GitHub:
# install.packages("pak")
pak::pak("pedrobtz/zujson")
json_parse() turns JSON into R objects. An array becomes an atomic vector when
its elements agree on a type, and a list when they do not — by default the type
is never coerced away, though simplify = "coerce" opts into R's own promotion
when you would rather have the vector.
library(zujson)
json_parse('{"ok": true, "ids": [1, 2, 3]}')
#> $ok
#> [1] TRUE
#>
#> $ids
#> [1] 1 2 3
json_write() goes the other way. A fully named vector or list becomes an
object, anything else becomes an array.
json_write(list(query = "cats", limit = 10L))
#> [1] "{\"query\":\"cats\",\"limit\":10}"
A response body arrives as raw bytes and a request body should leave as raw bytes, so both directions take and return them without a detour through a string:
json_write_raw(list(q = "cats"))
#> [1] 7b 22 71 22 3a 22 63 61 74 73 22 7d
json_parse(json_write_raw(list(q = "cats")))
#> $q
#> [1] "cats"
json_parse_ndjson() and json_write_ndjson() handle
application/x-ndjson; json_parse_file(), json_parse_raw(),
json_validate() and json_write_ndjson_raw() round out the set. The getting
started article carries
the full type mapping in both directions, the safety limits, and what the
package deliberately does not do.
zujson's tests cover its type mapping, errors and round trips, and run on every
pull request across five platform and R version combinations. Differential
tests use jsonlite as an external oracle, while JSONTestSuite checks 95/95
required acceptances and 188/188 required rejections. Sanitizer and fuzzing
jobs exercise the C boundary and cleanup paths. See
Testing and conformance
for the test map, full results and intentional divergences.