Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
CoffeeScript-Object-Notation Parser. Same as JSON but for CoffeeScript objects.
Everyone knows JSON, it's the thing that looks like this:
{
"abc": [
"a",
"b",
"c"
],
"a": {
"b": "c"
}
}
But with the invention of CoffeeScript you can also write the same thing in CSON which looks like this:
{
# an array
abc: [
'a'
'b'
'c'
]
# an object
a:
b: 'c'
}
Which is far more lenient than JSON, nicer to write and read, you don't have to quote everything, you have comments, and won't fail if you forget a comma.
Install CSON
npm install cson
With Node.js in JavaScript
// Include CSON
CSON = require('cson');
// Parse a file path
CSON.parseFile('data.cson', function(err,obj){}); // async
result = CSON.parseFileSync('data.cson'); // sync
// Parse a String
CSON.parse(src, function(err,obj){}); // async
result = CSON.parseSync(src); // sync
// Stringify an object to CSON
CSON.stringify(obj, function(err,str){}); // async
result = CSON.stringifySync(obj); // sync
With Node.js in CoffeeScript
# Include CSON
CSON = require('cson')
# Parse a file path
CSON.parseFile 'data.cson', (err,obj) -> # async
result = CSON.parseFile('data.cson') # sync
# Parse a string
CSON.parse src, (err,obj) -> # async
result = CSON.parseSync(src) # sync
# Stringify an object to CSON
CSON.stringify data, (err,str) -> # async
result = CSON.stringifySync(obj) # sync
Via the command line (requires a global installation of CSON via npm install -g cson
)
# JSON file to CSON String
json2cson filePath > out.cson
# CSON file to JSON String
cson2json filePath > out.json
You can discover the version history inside the History.md file
Licensed under the incredibly permissive MIT License
Copyright © 2012 Bevry Pty Ltd
Copyright © 2011 Benjamin Lupton
Sincerely, thank you. Lots of love from the CSON Team
v1.4.1 2013 March 16
npm-shrinkwrap.json
that ensures js2coffee
uses coffee-script
1.4.0FAQs
CoffeeScript-Object-Notation Parser. Same as JSON but for CoffeeScript objects.
The npm package cson receives a total of 52,465 weekly downloads. As such, cson popularity was classified as popular.
We found that cson demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.