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

ajson

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ajson - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

fixture/huge_string.json

24

lib/index.js
// Generated by CoffeeScript 1.7.1
(function() {
var AJSON, asyncJSON;
var AJSON, asyncJSON, es, resumer;
asyncJSON = require("async-json");
resumer = require("resumer");
es = require("event-stream");
AJSON = (function() {

@@ -17,11 +21,15 @@ function AJSON() {}

AJSON.parse = function(s, cb) {
var e, err, result;
try {
result = JSON.parse(s);
} catch (_error) {
e = _error;
var stream;
stream = resumer();
stream.queue(s);
return stream.pipe(es.parse({
error: true
})).on("error", function(theErr) {
var err;
err = new Error("Invalid JSON string provided");
return cb(err, null);
}
return cb(null, result);
}).pipe(es.map(function(data, callback) {
callback(null, data);
return cb(null, data);
}));
};

@@ -28,0 +36,0 @@

@@ -14,6 +14,8 @@ {

},
"version": "0.1.0",
"version": "0.2.0",
"main": "./index.js",
"dependencies": {
"async-json": "0.0.2"
"async-json": "0.0.2",
"resumer": "0.0.0",
"event-stream": "3.3.0"
},

@@ -20,0 +22,0 @@ "devDependencies": {

@@ -23,2 +23,3 @@ AJSON

- [] Implement async version for JSON.parse
- [ ] write benchmarks
- [ ] finish readme

Sorry, the diff of this file is not supported yet

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