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

jsoner

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsoner - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

20

lib/append.js

@@ -79,2 +79,12 @@ var _ = require('lodash');

try {
fs.accessSync(filename, fs.R_OK | fs.W_OK);
} catch (err) {
if (err.toString().match(/ENOENT/)) {
fs.writeFileSync(filename, '[]');
} else {
throw err;
}
}
if (element.length === 0) {

@@ -94,12 +104,2 @@ // nothing to write

try {
fs.accessSync(filename, fs.R_OK | fs.W_OK);
} catch (err) {
if (err.toString().match(/ENOENT/)) {
fs.writeFileSync(filename, '[]');
} else {
throw err;
}
}
var fd = fs.openSync(filename, 'r+');

@@ -106,0 +106,0 @@

{
"name": "jsoner",
"version": "0.1.5",
"version": "0.1.6",
"description": "Simple, fast, minimalist JSON library for node",

@@ -5,0 +5,0 @@ "keywords": [

@@ -170,3 +170,10 @@ var _ = require('lodash');

it('always creates the file even on an empty append', function() {
jsoner.appendFileSync(tmpFilename, []);
var jsonString = fs.readFileSync(tmpFilename).toString();
var results = JSON.parse(jsonString);
expect(results).to.deep.equal([]);
});
});
});
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