All Projects → bevry → Cson

bevry / Cson

Licence: other
CoffeeScript-Object-Notation. Same as JSON but for CoffeeScript objects.

Programming Languages

coffeescript
4710 projects

Projects that are alternatives of or similar to Cson

Json in type
Fast json encoder in rust, that encodes the structure of JSON values in their types
Stars: ✭ 80 (-93.71%)
Mutual labels:  json
Js2excel
😌 😃 👿 A simple module for excel and json converts each other, which works in the browser.
Stars: ✭ 83 (-93.47%)
Mutual labels:  json
Rpushbullet
R interface to the awesome Pushbullet service
Stars: ✭ 84 (-93.39%)
Mutual labels:  json
Google Sheet S3
Google Apps Script that publishes a Google Sheet to Amazon S3 as a JSON file. Auto-updates on edit & maintains data types. Creates an array of objects keyed by column header.
Stars: ✭ 81 (-93.63%)
Mutual labels:  json
Mongoose Patch History
Mongoose plugin that saves a history of JSON patch operations for all documents belonging to a schema in an associated 'patches' collection
Stars: ✭ 82 (-93.55%)
Mutual labels:  json
Redisjson
RedisJSON - a JSON data type for Redis
Stars: ✭ 1,239 (-2.52%)
Mutual labels:  json
Json Stat
JSON-stat Toolkit version 0
Stars: ✭ 79 (-93.78%)
Mutual labels:  json
Dbwebapi
(Migrated from CodePlex) DbWebApi is a .Net library that implement an entirely generic Web API (RESTful) for HTTP clients to call database (Oracle & SQL Server) stored procedures or functions in a managed way out-of-the-box without any configuration or coding.
Stars: ✭ 84 (-93.39%)
Mutual labels:  json
Internettools
XPath/XQuery 3.1 interpreter for Pascal with compatibility modes for XPath 2.0/XQuery 1.0/3.0, custom and JSONiq extensions, XML/HTML parsers and classes for HTTP/S requests
Stars: ✭ 82 (-93.55%)
Mutual labels:  json
Jaydiff
A JSON diff utility
Stars: ✭ 84 (-93.39%)
Mutual labels:  json
Waargonaut
JSON decoding/encoding/manipulation library.
Stars: ✭ 82 (-93.55%)
Mutual labels:  json
Entityframework.commontools
Extensions, Auditing, Concurrency Checks, JSON properties and Transaction Logs for EntityFramework and EFCore
Stars: ✭ 82 (-93.55%)
Mutual labels:  json
Dahomey.json
The main purpose of this library is to bring missing features to the official .Net namespace System.Text.Json
Stars: ✭ 84 (-93.39%)
Mutual labels:  json
Bitcoin Scraper
💲 bitcoin chart history scraper
Stars: ✭ 80 (-93.71%)
Mutual labels:  json
Countries
Countries - ISO 3166 (ISO3166-1, ISO3166, Digit, Alpha-2 and Alpha-3) countries codes and names (on eng and rus), ISO 4217 currency designators, ITU-T E.164 IDD calling phone codes, countries capitals, UN M.49 regions codes, ccTLD countries domains, IOC/NOC and FIFA letters codes, VERY FAST, NO maps[], NO slices[], NO init() funcs, NO external links/files/data, NO interface{}, NO specific dependencies, Databases/JSON/GOB/XML/CSV compatible, Emoji countries flags and currencies support, full support ISO-3166-1, ISO-4217, ITU-T E.164, Unicode CLDR and ccTLD standarts.
Stars: ✭ 85 (-93.31%)
Mutual labels:  json
Emfjson Jackson
JSON Binding for Eclipse Modeling Framework
Stars: ✭ 79 (-93.78%)
Mutual labels:  json
Blooddy crypto
ActionScript (AS3) library for processing binary data. This library contains MD5, SHA-1, SHA-2 ( SHA-224 и SHA-256 ), Base64, CRC32 algorithms, JSON encoder & decoder as well as PNG and JPEG encoders.
Stars: ✭ 83 (-93.47%)
Mutual labels:  json
Diagram Vue
A editable SVG-based diagram component for Vue
Stars: ✭ 86 (-93.23%)
Mutual labels:  json
Coin registry
A global registry of JSON formatted files on 1500+ cryptocurrency tokens. Provides information like chat rooms, communities, explorers, and contact information on each coin. Used by https://blockmodo.com, DEXs, developers, and exchanges.
Stars: ✭ 85 (-93.31%)
Mutual labels:  json
Cesium
cesium demo,cesium 研究过程中资料整理,包括: 1、示例,提供常规的cesium示例以及综合性的业务示例 2、工具,整理研究过程中写的一些数据获取、处理、分析的工具,例如网络3dtiles数据爬虫工具、b3dm 转 gltf工具 3、插件,根据研究过程中cesium感觉使用不方便的地方,添加插件,包括针对显示控件的汉化中文语言插件等
Stars: ✭ 84 (-93.39%)
Mutual labels:  json

CSON

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

CoffeeScript-Object-Notation. Same as JSON but for CoffeeScript objects.

Projects using CSON.

Projects using CSON Parser directly.

Since v2, this CSON package is a higher-level wrapper around the lower-level CSON Parser.

What is CSON?

Everyone knows JSON, it's the thing that looks like this:

{
  "greatDocumentaries": [
    "earthlings.com",
    "forksoverknives.com",
    "cowspiracy.com"
  ],
  "importantFacts": {
    "emissions": "Livestock and their byproducts account for at least 32,000 million tons of carbon dioxide (CO2) per year, or 51% of all worldwide greenhouse gas emissions.\nGoodland, R Anhang, J. “Livestock and Climate Change: What if the key actors in climate change were pigs, chickens and cows?”\nWorldWatch, November/December 2009. Worldwatch Institute, Washington, DC, USA. Pp. 10–19.\nhttp://www.worldwatch.org/node/6294",
    "landuse": "Livestock covers 45% of the earth’s total land.\nThornton, Phillip, Mario Herrero, and Polly Ericksen. “Livestock and Climate Change.” Livestock Exchange, no. 3 (2011).\nhttps://cgspace.cgiar.org/bitstream/handle/10568/10601/IssueBrief3.pdf",
    "burger": "One hamburger requires 660 gallons of water to produce – the equivalent of 2 months’ worth of showers.\nCatanese, Christina. “Virtual Water, Real Impacts.” Greenversations: Official Blog of the U.S. EPA. 2012.\nhttp://blog.epa.gov/healthywaters/2012/03/virtual-water-real-impacts-world-water-day-2012/\n“50 Ways to Save Your River.” Friends of the River.\nhttp://www.friendsoftheriver.org/site/PageServer?pagename=50ways",
    "milk": "1,000 gallons of water are required to produce 1 gallon of milk.\n“Water trivia facts.” United States Environmental Protection Agency.\nhttp://water.epa.gov/learn/kids/drinkingwater/water_trivia_facts.cfm#_edn11",
    "more": "http://cowspiracy.com/facts"
  }
}

Now let's write the same thing in CSON:

# Comments!!!

# An Array with no commas!
greatDocumentaries: [
	'earthlings.com'
	'forksoverknives.com'
	'cowspiracy.com'
]

# An Object without braces!
importantFacts:
	# Multi-Line Strings! Without Quote Escaping!
	emissions: '''
		Livestock and their byproducts account for at least 32,000 million tons of carbon dioxide (CO2) per year, or 51% of all worldwide greenhouse gas emissions.
		Goodland, R Anhang, J. “Livestock and Climate Change: What if the key actors in climate change were pigs, chickens and cows?”
		WorldWatch, November/December 2009. Worldwatch Institute, Washington, DC, USA. Pp. 10–19.
		http://www.worldwatch.org/node/6294
		'''

	landuse: '''
		Livestock covers 45% of the earth’s total land.
		Thornton, Phillip, Mario Herrero, and Polly Ericksen. “Livestock and Climate Change.” Livestock Exchange, no. 3 (2011).
		https://cgspace.cgiar.org/bitstream/handle/10568/10601/IssueBrief3.pdf
		'''

	burger: '''
		One hamburger requires 660 gallons of water to produce – the equivalent of 2 months’ worth of showers.
		Catanese, Christina. “Virtual Water, Real Impacts.” Greenversations: Official Blog of the U.S. EPA. 2012.
		http://blog.epa.gov/healthywaters/2012/03/virtual-water-real-impacts-world-water-day-2012/
		“50 Ways to Save Your River.” Friends of the River.
		http://www.friendsoftheriver.org/site/PageServer?pagename=50ways
		'''

	milk: '''
		1,000 gallons of water are required to produce 1 gallon of milk.
		“Water trivia facts.” United States Environmental Protection Agency.
		http://water.epa.gov/learn/kids/drinkingwater/water_trivia_facts.cfm#_edn11
		'''

	more: 'http://cowspiracy.com/facts'

Which is far more lenient than JSON, way nicer to write and read, no need to quote and escape everything, has comments and readable multi-line strings, and won't fail if you forget a comma.

Using CSON

Via the Command Line

Use CSON with the command line with:

# Convert a JSON file into a CSON file
json2cson in.json > out.cson
# Same thing via piping
cat in.json | json2cson > out.cson

# Convert a CSON file into a JSON file
cson2json in.cson > out.json
# Same thing via piping
cat in.cson | cson2json > out.json

Requires a global CSON install: npm install -g cson

Via the API

Include CSON:

var CSON = require('cson')

Each method can be executed without a callback like so:

var result = CSON.createCSONString({a:{b:'c'}}, {/* optional options argument */})
if ( result instanceof Error ) {
	console.log(result.stack)
} else {
	console.log(result)
}

Or via a callback like so:

CSON.createCSONString({a:{b:'c'}}, {/* optional options argument */}, function(err,result){
	console.log(err, result)
})

Executing the method with a callback still executes the method synchronously.

Click the below function names to open more detailed documentation.

Create Strings

Parse Strings

Parse Files

Require Files

Install

npm

Install Globally

  • Install: npm install --global cson
  • Executables: cson2json, json2cson

Install Locally

  • Install: npm install --save cson
  • Executables: npx cson2json, npx json2cson
  • Import: import * as pkg from ('cson')
  • Require: const pkg = require('cson')

Editions

This package is published with the following editions:

History

Discover the release history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

License

Unless stated otherwise all works are:

and licensed under:

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].