Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

read-json

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-json - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

16

index.js
var fs = require("fs");
var call = require("try-call");

@@ -6,3 +7,3 @@ module.exports = readJSON;

function readJSON(filename, options, callback){
if(callback === undefined){
if(arguments.length == 2){
callback = options;

@@ -14,12 +15,9 @@ options = {};

if(error) return callback(error);
call(parse.bind(null, bf), callback);
});
try {
bf = JSON.parse(bf.toString().replace(/^\ufeff/g, ''));
} catch (err) {
callback(err);
return;
}
function parse (bf) {
return JSON.parse(bf.toString().replace(/^\ufeff/g, ''));
}
callback(undefined, bf);
});
}
{
"name": "read-json",
"version": "0.1.0",
"version": "0.2.0",
"description": "Reads and parses a JSON file.",

@@ -17,3 +17,6 @@ "main": "index.js",

"author": "Azer Koçulu <azer@kodfabrik.com>",
"license": "BSD"
"license": "BSD",
"dependencies": {
"try-call": "0.0.0"
}
}
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