All Projects → j8r → con

j8r / con

Licence: ISC license
A simple, fast and readable JSON-compatible serialization format

Programming Languages

crystal
512 projects

Projects that are alternatives of or similar to con

FormatEditText
格式化输入框,可用来格式化数字、金额、号码等; FormatEditText can be used as a formatted text input box
Stars: ✭ 121 (+450%)
Mutual labels:  format
docker-crystal
Docker wrapper for the Crystal CLI
Stars: ✭ 13 (-40.91%)
Mutual labels:  crystal-lang
tput.cr
Low-level component for building term/console applications in Crystal
Stars: ✭ 22 (+0%)
Mutual labels:  crystal-lang
cashaddrjs
CashAddr.js: The new Bitcoin Cash address format for Node.js and web browsers.
Stars: ✭ 36 (+63.64%)
Mutual labels:  format
timelite
String date and time utilities 🕙
Stars: ✭ 17 (-22.73%)
Mutual labels:  format
JOpenCTM
Java implementation of the openCTM Mesh compression file format
Stars: ✭ 13 (-40.91%)
Mutual labels:  format
tallboy
Declarative API for drawing unicode/ascii character tables in crystal lang
Stars: ✭ 49 (+122.73%)
Mutual labels:  crystal-lang
table
Produces a string that represents slice data in a text table, inspired by gajus/table.
Stars: ✭ 130 (+490.91%)
Mutual labels:  format
winston-dev-console
Winston@3 console format aimed to improve development UX
Stars: ✭ 88 (+300%)
Mutual labels:  format
react-native-styled-text
Styled Text for React Native
Stars: ✭ 57 (+159.09%)
Mutual labels:  format
phpF
Format PHP code
Stars: ✭ 34 (+54.55%)
Mutual labels:  format
amber-introduction
Introduction to the Amber web framework and its features
Stars: ✭ 53 (+140.91%)
Mutual labels:  crystal-lang
multi auth
Standardized multi-provider OAuth authentication
Stars: ✭ 102 (+363.64%)
Mutual labels:  crystal-lang
walter.cr
Keep your crystal clean!
Stars: ✭ 14 (-36.36%)
Mutual labels:  crystal-lang
googlejavaformat-action
GitHub Action that formats Java files following Google Style guidelines
Stars: ✭ 66 (+200%)
Mutual labels:  format
Truth
A Domain Representation Language
Stars: ✭ 23 (+4.55%)
Mutual labels:  format
format-number
文本框数字格式化
Stars: ✭ 17 (-22.73%)
Mutual labels:  format
romans
A Simple PHP Roman Numerals Library
Stars: ✭ 40 (+81.82%)
Mutual labels:  format
elm-format-number
✨Format numbers as pretty strings
Stars: ✭ 56 (+154.55%)
Mutual labels:  format
ttconv
Subtitle conversion. Converts STL, SRT, TTML and SCC into TTML, WebVTT and SRT.
Stars: ✭ 88 (+300%)
Mutual labels:  format

CON

Build Status ISC

Cretin Object Notation - a simple, fast and readable JSON-compatible serialization format

The specifications is mostly stable, but can be subject to minor changes.

Example

key "string"
pi 3.14
hash {
  enable true
  nothing nil
}
ports [
  22
  1234
  8888
]

Features

  • Backward compatible with JSON
  • Easy to read, fast to parse
  • Simple specifications

Documentation

https://j8r.github.io/con

Specifications

Specification document: SPEC.md

Usage

Add the dependency to your shard.yml:

dependencies:
  con:
    github: j8r/con

This object is a convenient container.

A CON::Any can be converted back to either a CON or JSON serialized String

require "con"

con_any = CON.parse con_data
con_any.to_con

require "json"
con_any.to_json

CON::PullParser can be used to parse more efficiently, if the mapping is known in advance.

See spec for more test examples.

Benchmarks

There are benchmarks comparing CON and the stdlib's JSON implementation

crystal run --release benchmark/*

Some results:

 CON.parse minified 527.25k (  1.90µs) (±13.77%)  1.88kB/op        fastest
   CON.parse pretty 501.42k (  1.99µs) (±15.08%)  1.88kB/op   1.05× slower
JSON.parse minified 487.52k (  2.05µs) (± 9.05%)  2.08kB/op   1.08× slower
  JSON.parse pretty 409.80k (  2.44µs) (± 9.13%)  2.08kB/op   1.29× slower
        #to_con   1.17M (852.99ns) (± 3.51%)  320B/op        fastest
 #to_pretty_con   1.10M (908.96ns) (± 5.76%)  320B/op   1.07× slower
       #to_json 742.97k (  1.35µs) (±14.52%)  576B/op   1.58× slower
#to_pretty_json 612.21k (  1.63µs) (±13.04%)  848B/op   1.91× slower

License

Copyright (c) 2018-2019 Julien Reichardt - ISC 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].