This is the 'native' SQLite JSON1 extension. It's often compiled into SQLite build, but in case your build doesn't include it - I've compiled it separately.
SQLite command-line interface:
sqlite> .load ./json1
sqlite> select json_object("answer", 42);
See How to Install an Extension for usage with IDE, Python, etc.