nomasystems/njson
65.4
Adequate · 17 September 2026
979
lines of production code
Erlang
primary language
1
measurement over time
What this system is
This system is the njson library, a JSON encoding and decoding tool for Erlang/Elixir that provides strict typing and robust error handling. It exposes public APIs for decoding and encoding JSON data, returning standardized result tuples to allow callers to gracefully manage invalid inputs and malformed output. The implementation includes comprehensive support for edge cases such as UTF-8 BOMs, emojis, and ASCII control character escaping, backed by an expanded suite of property-based and unit tests.
Behavioural changes
Benchmark suite updates comparison libraries and iteration counts
The benchmarking tool now includes Thoas as a comparison target, replacing Jason in both decode and encode performance tests. The number of iterations for each benchmark run has been reduced from 1000 to 100, and the output formatting has been adjusted to display raw total times instead of rounded averages per iteration. Additionally, the NJson encode function is now called with the 'false' argument instead of 'true'.
bench · high confidence
Major API overhaul with strict typing and error handling
The njson library has been updated to version 2.0.0, introducing a significant behavioral change to its public API. The \decode/1\ function now returns a standardized \{ok, Json}\ tuple or a detailed \decode\_error()\ tuple instead of returning \undefined\ for empty input or bare results, and it explicitly ignores UTF-8 BOMs. The \encode/1\ and \encode/2\ functions now return \{ok, Binary}\ or \encode\_error()\ tuples, allowing callers to handle invalid keys, values, maps, or lists gracefully rather than producing malformed output. New type specifications (\njson:t/0\, \decode\_error/0\, \encode\_error/0\) are exported to support static analysis and stricter type checking.
src · high confidence
Updated documentation, benchmark dependencies, and coverage thresholds
The README has been rewritten to highlight new features such as binary key support and improved error handling, while also updating usage examples to reflect the current API behavior. Benchmark comparisons now include the 'thoas' library and exclude 'jason', with updated performance figures. Additionally, the project's test coverage requirement has been lowered from 95% to 75% for both standard and CI test runs, and dependency URLs have been standardized to use HTTPS.
(repo-wide) · high confidence
Test coverage
Expanded property tests for JSON character escaping; Expanded test coverage for JSON decoding, encoding, and error handling.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 65.
Lenses
- Code Health 100
- Architecture 69
- Maturity 59
- Readiness 61
- Security 92
Changes since last survey
- 27 commits — 15 feature/other, 12 fixes
By area
- (root) — 8 commits
- src/njson_decoder.erl — 8 commits
- src/njson.erl — 4 commits
- (repo) — 3 commits
- src/njson_encoder.erl — 2 commits
- .github/workflows — 1 commit
- src/njson.app.src — 1 commit
Notable commits
- fix: Merge pull request #22 from nomasystems/fix/escape-only-the-characters-that-need-to-be-escaped
- fix: Merge pull request #5 from nomasystems/fix/4-crash-when-decoding-some-emojis
- fix: fix(#20): escape only the characters that need to be escaped
- fix: fix(#20): escape only the characters that need to be escaped
- fix: fix(#20): escape only the characters that need to be escaped
- fix: fix(#20): escape only the characters that need to be escaped
- fix: fix: Solves issue #4. Crash when decoding some emojis.
- fix: fix: bad ended README code block. (#14)
- fix: fix: empty binary is an invalid json. (#23)
- fix: fix: error when incomplete strings. (#15)
- fix: fix: njson:t() can also be undefined (#11)
- fix: fix: undefined management in encoding (#3)
- change: Initial commit
- change: Merge pull request #8 from nomasystems/chore/support-utf8-bom
- change: Refactor: big update with monad like results, better errors, complete specs, performance, etc
- change: build: 2.0.0 (#17)
- change: chore: refine types (#10)
- change: chore: support utf8 bom. I always forget fmt.
- change: chore: support/ignore utf8 bom on decoding.
- change: chore: types (#1)
- …and 7 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
nomasystems/njson was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 17 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 541754472e8d9713fe8a320a7007c15015095c45 — the exact code this score is about.
- Scored under rubric-2026.09.12 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-f94092f054c1.