cblage / Elixir Json
Licence: bsd-3-clause
Native JSON library for Elixir
Stars: ✭ 216
Programming Languages
elixir
2628 projects
Projects that are alternatives of or similar to Elixir Json
Encoding
Go package containing implementations of efficient encoding, decoding, and validation APIs.
Stars: ✭ 705 (+226.39%)
Mutual labels: json, encoding, decoding
Serpent
A protocol to serialize Swift structs and classes for encoding and decoding.
Stars: ✭ 281 (+30.09%)
Mutual labels: json, encoding, decoding
Codability
Useful helpers for working with Codable types in Swift
Stars: ✭ 125 (-42.13%)
Mutual labels: json, encoding, decoding
Jsonlab
JSONLab: a native JSON/UBJSON/MassagePack encoder/decoder for MATLAB/Octave
Stars: ✭ 202 (-6.48%)
Mutual labels: json, encoding, decoding
Ldpc
C and MATLAB implementation for LDPC encoding and decoding
Stars: ✭ 76 (-64.81%)
Mutual labels: encoding, decoding
Fast ber
A C++11 ASN.1 BER Encoding and Decoding Library
Stars: ✭ 54 (-75%)
Mutual labels: encoding, decoding
Binary
Generic and fast binary serializer for Go
Stars: ✭ 86 (-60.19%)
Mutual labels: encoding, decoding
Vxg.media.sdk.android
Market leading Android SDK with encoding, streaming & playback functionality
Stars: ✭ 119 (-44.91%)
Mutual labels: encoding, decoding
Anycodable
Type-erased wrappers for Encodable, Decodable, and Codable values
Stars: ✭ 811 (+275.46%)
Mutual labels: encoding, decoding
Libbrotli
meta project to build libraries from the brotli source code
Stars: ✭ 110 (-49.07%)
Mutual labels: encoding, decoding
X509
A PHP library for X.509 public key certificates, attribute certificates, certification requests and certification path validation.
Stars: ✭ 27 (-87.5%)
Mutual labels: encoding, decoding
Bitmatch
A Rust crate that allows you to match, bind, and pack the individual bits of integers.
Stars: ✭ 82 (-62.04%)
Mutual labels: encoding, decoding
Stegify
🔍 Go tool for LSB steganography, capable of hiding any file within an image.
Stars: ✭ 927 (+329.17%)
Mutual labels: encoding, decoding
Unbox
[Deprecated] The easy to use Swift JSON decoder
Stars: ✭ 1,985 (+818.98%)
Mutual labels: json, decoding
Ffmpeg Video Player
An FFmpeg and SDL Tutorial.
Stars: ✭ 149 (-31.02%)
Mutual labels: encoding, decoding
Go.geojson
Encoding and decoding GeoJSON <-> Go
Stars: ✭ 172 (-20.37%)
Mutual labels: encoding, decoding
Himotoki
A type-safe JSON decoding library purely written in Swift
Stars: ✭ 786 (+263.89%)
Mutual labels: json, decoding
Elixir JSON
This library provides a natively implemented JSON encoder and decoder for Elixir.
You can find the package in hex.pm and the documentation in hexdocs.pm.
All contributions are welcome!
Installing
Simply add {:json, "~> 1.4"}
to your project's mix.exs
and run mix deps.get
.
Usage
Encoding an Elixir type
@doc "
JSON encode an Elixir list
"
list = [key: "this will be a value"]
is_list(list)
# true
list[:key]
# "this will be a value"
{status, result} = JSON.encode(list)
# {:ok, "{\"key\":\"this will be a value\"}"}
String.length(result)
# 41
Decoding a list from a string that contains JSON
@doc "
JSON decode a string into an Elixir list
"
json_input = "{\"key\":\"this will be a value\"}"
{status, list} = JSON.decode(json_input)
{:ok, %{"key" => "this will be a value"}}
list[:key]
# nil
list["key"]
# "this will be a value"
At any time, you can turn on verbose logging for this library only. To do so, head to config file of your application and add below lines:
use Mix.Config
config :logger, level: :debug
config :json, log_level: :debug
Note that, changing only :logger
level to :info
, :warn
or :error
will silent :json
too.
License
The Elixir JSON library is available under the BSD 3-Clause aka "BSD New" license
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].