Giter Site home page Giter Site logo

slon's Introduction

SLON

Introduction

SLON (Single Line Object Notation) is a small modification to JSON (JavaScript Object Notation) to make it easier, and less painfull, for humans to quickly read data on a single line (e.g. on a notification, on a small text line, etc...). In a sense it's like YAML but in a single line.

Example of a weather notification using SLON:

The current conditions are (condition: Moderate Rain, temp: 12.2, feelsLike: 14, sunLight: true, date: 2023-02-05/12:34:45.678)

The same using JSON:

The current conditions are {"condition":"Moderate Rain","temp":12.2,"feelsLike":14,"sunLight":true,"date":"2023-02-05/12:34:45.678"}

Changes from JSON

The following table presents the changes from JSON:

Type JSON delimiter SLON delimiter
Map begin { (
Map end } )
Array values delimiter , |

Additionally:

  • dates are simplified from 1234-12-24T12:34:56.123Z to 1234-12-24/12:34:56.123
  • map keys don't need to be quoted unless they contain ":" or quotes
  • string values don't need to be quoted unless they contain "," or quotes
  • preferable use single-quote instead of double-quote

Example with all types

In SLON:

(number: 123.12, boolean: true, null_value: null, array: [1 | 'item' | 3], map: (x: -1, y: 1), date: 1235-01-17/12:34:56.123)

In JSON:

{"number":123.12,"boolean":true,"null_value":null,"array":[1,"item",3],"map":{"x":-1,"y":1},"date":"1235-01-24T12:34:56.123Z"}

slon's People

Contributors

nmaguiar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.