Teon

Teon is Teo extended Json. Teo has data types such as ObjectId, Date, DateTime, Decimal and other types that Json cannot express.

The Teon value is quite trivial in Node.js and Python bindings. Just pass a normal object with the value that Teon supports in Node.js. For Python, a normal dict is used. The rust version has nearly the same API with Rust's famous serde_json library. Most of the times, developers don't need to interact with Teon APIs.

Usage

To declare a Teon object in Node.js, just write a normal object.

const myTeonValue = {
    decimal: Decimal("5.20"),
    int: 5,
    float: 5.20
}

To declare a Teon object in Python, just write a normal dict.

my_teon_value = {
    "decimal": Decimal("5.20"),
    "int": 5,
    "float": 5.20
}

To declare a Teon object in Rust, use the teon! macro.

let my_teon_value = teon!({
    "decimal": BigDecimal::from_str("5").unwrap(),
    "int": 5,
    "float": 5.20
});