New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cson

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cson - npm Package Compare versions

Comparing version 1.4.4 to 1.4.5

cyclic.js

27

out/bin/cson2json.js
// Generated by CoffeeScript 1.6.3
var CSON, argv, filePath, fs, path, result;
(function() {
var CSON, argv, filePath, fs, path, result;
fs = require('fs');
fs = require('fs');
path = require('path');
path = require('path');
CSON = require(path.join(__dirname, '..', 'lib', 'cson'));
CSON = require(path.join(__dirname, '..', 'lib', 'cson'));
argv = process.argv;
argv = process.argv;
if (argv.length !== 3) {
console.log('usage: cson2json filePath');
process.exit(1);
}
if (argv.length !== 3) {
console.log('usage: cson2json filePath');
process.exit(1);
}
filePath = argv[2];
filePath = argv[2];
result = JSON.stringify(CSON.parseFileSync(filePath));
result = JSON.stringify(CSON.parseFileSync(filePath));
console.log(result);
console.log(result);
}).call(this);
// Generated by CoffeeScript 1.6.3
var CSON, argv, filePath, fs, path, result;
(function() {
var CSON, argv, filePath, fs, path, result;
fs = require('fs');
fs = require('fs');
path = require('path');
path = require('path');
CSON = require(path.join(__dirname, '..', 'lib', 'cson'));
CSON = require(path.join(__dirname, '..', 'lib', 'cson'));
argv = process.argv;
argv = process.argv;
if (argv.length !== 3) {
console.log('usage: json2cson filePath');
process.exit(1);
}
if (argv.length !== 3) {
console.log('usage: json2cson filePath');
process.exit(1);
}
filePath = argv[2];
filePath = argv[2];
result = CSON.stringifySync(CSON.parseFileSync(filePath));
result = CSON.stringifySync(CSON.parseFileSync(filePath));
console.log(result);
console.log(result);
}).call(this);
// Generated by CoffeeScript 1.6.3
var CSON, coffee, extractOpts, fsUtil, js2coffee, pathUtil, requireFreshSafe, wait;
(function() {
var CSON, coffee, extractOpts, fsUtil, js2coffee, pathUtil, requireFreshSafe, wait;
coffee = require('coffee-script');
coffee = require('coffee-script');
js2coffee = require('js2coffee');
js2coffee = require('js2coffee');
fsUtil = require('fs');
fsUtil = require('fs');
pathUtil = require('path');
pathUtil = require('path');
extractOpts = require('extract-opts').extractOpts;
extractOpts = require('extract-opts').extractOpts;
requireFreshSafe = require('requirefresh').requireFreshSafe;
requireFreshSafe = require('requirefresh').requireFreshSafe;
wait = function(delay, fn) {
return setTimeout(fn, delay);
};
wait = function(delay, fn) {
return setTimeout(fn, delay);
};
CSON = {
parseFile: function(filePath, opts, next) {
var err, _ref,
_this = this;
_ref = extractOpts(opts, next), opts = _ref[0], next = _ref[1];
filePath = pathUtil.resolve(filePath);
if (/\.(js|coffee)$/.test(filePath)) {
requireFreshSafe(filePath, next);
} else if (/\.(json|cson)$/.test(filePath)) {
fsUtil.readFile(filePath, function(err, data) {
var dataStr;
if (err) {
return next(err);
}
dataStr = data.toString();
return _this.parse(dataStr, opts, next);
});
} else {
err = new Error("CSON.parseFile: Unknown extension type for " + filePath);
next(err);
}
return this;
},
parseFileSync: function(filePath, opts) {
var data, dataStr, err, result;
opts || (opts = {});
filePath = pathUtil.resolve(filePath);
if (/\.(js|coffee)$/.test(filePath)) {
return result = requireFreshSafe(filePath);
} else if (/\.(json|cson)$/.test(filePath)) {
data = fsUtil.readFileSync(filePath);
if (data instanceof Error) {
result = data;
CSON = {
parseFile: function(filePath, opts, next) {
var err, _ref,
_this = this;
_ref = extractOpts(opts, next), opts = _ref[0], next = _ref[1];
filePath = pathUtil.resolve(filePath);
if (/\.(js|coffee)$/.test(filePath)) {
requireFreshSafe(filePath, next);
} else if (/\.(json|cson)$/.test(filePath)) {
fsUtil.readFile(filePath, function(err, data) {
var dataStr;
if (err) {
return next(err);
}
dataStr = data.toString();
return _this.parse(dataStr, opts, next);
});
} else {
dataStr = data.toString();
result = this.parseSync(dataStr, opts);
err = new Error("CSON.parseFile: Unknown extension type for " + filePath);
next(err);
}
return result;
} else {
err = new Error("CSON.parseFileSync: Unknown extension type for " + filePath);
return err;
}
},
parse: function(src, opts, next) {
var _ref,
_this = this;
_ref = extractOpts(opts, next), opts = _ref[0], next = _ref[1];
wait(0, function() {
var result;
result = _this.parseSync(src, opts);
if (result instanceof Error) {
return next(result);
return this;
},
parseFileSync: function(filePath, opts) {
var data, dataStr, err, result;
opts || (opts = {});
filePath = pathUtil.resolve(filePath);
if (/\.(js|coffee)$/.test(filePath)) {
return result = requireFreshSafe(filePath);
} else if (/\.(json|cson)$/.test(filePath)) {
data = fsUtil.readFileSync(filePath);
if (data instanceof Error) {
result = data;
} else {
dataStr = data.toString();
result = this.parseSync(dataStr, opts);
}
return result;
} else {
return next(null, result);
err = new Error("CSON.parseFileSync: Unknown extension type for " + filePath);
return err;
}
});
return this;
},
parseSync: function(src, opts) {
var err, result;
opts || (opts = {});
if (opts.sandbox == null) {
opts.sandbox = true;
}
try {
result = JSON.parse(src);
} catch (_error) {
err = _error;
},
parse: function(src, opts, next) {
var _ref,
_this = this;
_ref = extractOpts(opts, next), opts = _ref[0], next = _ref[1];
wait(0, function() {
var result;
result = _this.parseSync(src, opts);
if (result instanceof Error) {
return next(result);
} else {
return next(null, result);
}
});
return this;
},
parseSync: function(src, opts) {
var err, result;
opts || (opts = {});
if (opts.sandbox == null) {
opts.sandbox = true;
}
try {
result = coffee["eval"](src, opts);
result = JSON.parse(src);
} catch (_error) {
err = _error;
result = err;
try {
result = coffee["eval"](src, opts);
} catch (_error) {
err = _error;
result = err;
}
}
}
return result;
},
stringify: function(obj, next) {
var _this = this;
wait(0, function() {
var result;
result = _this.stringifySync(obj);
if (result instanceof Error) {
return next(result);
} else {
return next(null, result);
}
});
return this;
},
stringifySync: function(obj) {
var err, result, src;
try {
src = "var result = " + (JSON.stringify(obj));
result = js2coffee.build(src);
result = result.replace(/^\s*result\s*\=\s/, '');
if (typeof obj === 'object') {
if (!Array.isArray(obj)) {
if (result !== '{}') {
result = '{\n' + result + '\n}';
return result;
},
stringify: function(obj, next) {
var _this = this;
wait(0, function() {
var result;
result = _this.stringifySync(obj);
if (result instanceof Error) {
return next(result);
} else {
return next(null, result);
}
});
return this;
},
stringifySync: function(obj) {
var err, result, src;
try {
src = "var result = " + (JSON.stringify(obj));
result = js2coffee.build(src);
result = result.replace(/^\s*result\s*\=\s/, '');
if (typeof obj === 'object') {
if (!Array.isArray(obj)) {
if (result !== '{}') {
result = '{\n' + result + '\n}';
}
}
}
} catch (_error) {
err = _error;
result = err;
}
} catch (_error) {
err = _error;
result = err;
return result;
}
return result;
}
};
};
module.exports = CSON;
module.exports = CSON;
}).call(this);
{
"title": "CSON",
"name": "cson",
"version": "1.4.4",
"version": "1.4.5",
"description": "CoffeeScript-Object-Notation Parser. Same as JSON but for CoffeeScript objects",
"homepage": "https://github.com/bevry/cson",
"license": {
"type": "MIT"
},
"badges": {
"travis": true,
"npm": true,
"gittip": "bevry",
"flattr": "344188/balupton-on-Flattr",
"paypal": "QB8GQPZAH84N6"
},
"keywords": [

@@ -14,3 +25,3 @@ "javascript",

],
"author": "Bevry Pty Ltd <us@bevry.me> (http://bevry.me)",
"author": "2012+ Bevry Pty Ltd <us@bevry.me> (http://bevry.me), 2011 Benjamin Lupton <b@lupton.cc> (http://balupton.com)",
"maintainers": [

@@ -21,7 +32,7 @@ "Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)"

"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)",
"Ryan LeFevre <meltingice8917@gmail.com> (https://github.com/meltingice)",
"Joel Perras <joel.perras@gmail.com> (https://github.com/jperras)",
"Linus G Thiel <linus@hanssonlarsson.se> (https://github.com/linus)",
"Zhang Cheng <czhang.oss@gmail.com> (https://github.com/zhangcheng)",
"Nicolae Claudius <claudius.nicolae@gmail.com> (https://github.com/clyfe)",
"Joel Perras <joel.perras@gmail.com> (https://github.com/jperras)"
"Ryan LeFevre <meltingice8917@gmail.com> (https://github.com/meltingice)",
"Zhang Cheng <czhang.oss@gmail.com> (https://github.com/zhangcheng)"
],

@@ -40,3 +51,3 @@ "bugs": {

"coffee-script": "~1.6.3",
"js2coffee": "~0.1.4",
"js2coffee": "~0.2.3",
"extract-opts": "~2.2.0",

@@ -46,5 +57,6 @@ "requirefresh": "~1.1.2"

"devDependencies": {
"chai": "~1.7.2",
"chai": "~1.8.1",
"joe": "~1.3.0",
"joe-reporter-console": "~1.2.1"
"joe-reporter-console": "~1.2.1",
"projectz": "~0.2.5"
},

@@ -55,3 +67,4 @@ "directories": {

"scripts": {
"test": "node ./out/test/everything.test.js"
"preinstall": "node ./cyclic.js",
"test": "node ./out/test/cson-test.js"
},

@@ -63,2 +76,2 @@ "bin": {

"main": "./out/lib/cson"
}
}

@@ -0,11 +1,42 @@

<!-- TITLE/ -->
# CSON
[![Check this project's build status on TravisCI](https://secure.travis-ci.org/bevry/cson.png?branch=master)](http://travis-ci.org/bevry/cson)
[![View this project's NPM page](https://badge.fury.io/js/cson.png)](https://npmjs.org/package/cson)
[![Donate monthly to this project via Flattr](https://raw.github.com/balupton/flattr-buttons/master/badge-89x18.gif)](http://flattr.com/thing/344188/balupton-on-Flattr)
[![Donate once-off to this project via Paypal](https://www.paypalobjects.com/en_AU/i/btn/btn_donate_SM.gif)](https://www.paypal.com/au/cgi-bin/webscr?cmd=_flow&SESSION=IHj3DG3oy_N9A9ZDIUnPksOi59v0i-EWDTunfmDrmU38Tuohg_xQTx0xcjq&dispatch=5885d80a13c0db1f8e263663d3faee8d14f86393d55a810282b64afed84968ec)
<!-- /TITLE -->
CoffeeScript-Object-Notation Parser. Same as JSON but for CoffeeScript objects.
<!-- BADGES/ -->
[![Build Status](http://img.shields.io/travis-ci/bevry/cson.png?branch=master)](http://travis-ci.org/bevry/cson "Check this project's build status on TravisCI")
[![NPM version](http://badge.fury.io/js/cson.png)](https://npmjs.org/package/cson "View this project on NPM")
[![Gittip donate button](http://img.shields.io/gittip/bevry.png)](https://www.gittip.com/bevry/ "Donate weekly to this project using Gittip")
[![Flattr donate button](http://img.shields.io/flattr/donate.png?color=yellow)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr")
[![PayPayl donate button](http://img.shields.io/paypal/donate.png?color=yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6 "Donate once-off to this project using Paypal")
<!-- /BADGES -->
<!-- DESCRIPTION/ -->
CoffeeScript-Object-Notation Parser. Same as JSON but for CoffeeScript objects
<!-- /DESCRIPTION -->
<!-- INSTALL/ -->
## Install
### [Node](http://nodejs.org/), [Browserify](http://browserify.org/)
- Use: `require('cson')`
- Install: `npm install --save cson`
### [Ender](http://ender.jit.su/)
- Use: `require('cson')`
- Install: `ender add cson`
<!-- /INSTALL -->
## What is CSON?

@@ -52,3 +83,3 @@

1. [Install Node.js](https://github.com/balupton/node/wiki/Installing-Node.js)
1. [Install Node.js](http://bevry.me/node/install)

@@ -58,3 +89,3 @@ 2. Install CSON

``` bash
npm install cson
npm install --save cson
```

@@ -116,9 +147,64 @@

<!-- HISTORY/ -->
## History
[You can discover the version history inside the `History.md` file](https://github.com/bevry/cson/blob/master/History.md#files)
[Discover the change history by heading on over to the `History.md` file.](https://github.com/bevry/cson/blob/master/History.md#files)
<!-- /HISTORY -->
<!-- CONTRIBUTE/ -->
## Contribute
[Discover how you can contribute by heading on over to the `Contributing.md` file.](https://github.com/bevry/cson/blob/master/Contributing.md#files)
<!-- /CONTRIBUTE -->
<!-- BACKERS/ -->
## Backers
### Maintainers
These amazing people are maintaining this project:
- Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)
### Sponsors
No sponsors yet! Will you be the first?
[![Gittip donate button](http://img.shields.io/gittip/bevry.png)](https://www.gittip.com/bevry/ "Donate weekly to this project using Gittip")
[![Flattr donate button](http://img.shields.io/flattr/donate.png?color=yellow)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr")
[![PayPayl donate button](http://img.shields.io/paypal/donate.png?color=yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6 "Donate once-off to this project using Paypal")
### Contributors
These amazing people have contributed code to this project:
- Benjamin Lupton <b@lupton.cc> (https://github.com/balupton) - [view contributions](https://github.com/bevry/cson/commits?author=balupton)
- Joel Perras <joel.perras@gmail.com> (https://github.com/jperras) - [view contributions](https://github.com/bevry/cson/commits?author=jperras)
- Linus G Thiel <linus@hanssonlarsson.se> (https://github.com/linus) - [view contributions](https://github.com/bevry/cson/commits?author=linus)
- Nicolae Claudius <claudius.nicolae@gmail.com> (https://github.com/clyfe) - [view contributions](https://github.com/bevry/cson/commits?author=clyfe)
- Ryan LeFevre <meltingice8917@gmail.com> (https://github.com/meltingice) - [view contributions](https://github.com/bevry/cson/commits?author=meltingice)
- Zhang Cheng <czhang.oss@gmail.com> (https://github.com/zhangcheng) - [view contributions](https://github.com/bevry/cson/commits?author=zhangcheng)
[Become a contributor!](https://github.com/bevry/cson/blob/master/Contributing.md#files)
<!-- /BACKERS -->
<!-- LICENSE/ -->
## License
Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/)
<br/>Copyright &copy; 2012+ [Bevry Pty Ltd](http://bevry.me)
<br/>Copyright &copy; 2011 [Benjamin Lupton](http://balupton.com)
Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT license](http://creativecommons.org/licenses/MIT/)
Copyright &copy; 2012+ Bevry Pty Ltd <us@bevry.me> (http://bevry.me)
<br/>Copyright &copy; 2011 Benjamin Lupton <b@lupton.cc> (http://balupton.com)
<!-- /LICENSE -->

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc