Socket
Socket
Sign inDemoInstall

jsonfile

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonfile - npm Package Compare versions

Comparing version 2.3.0 to 2.3.1

5

CHANGELOG.md

@@ -0,1 +1,5 @@

2.3.1 / 2016-05-13
------------------
- fix to support BOM. [#45][#45]
2.3.0 / 2016-04-16

@@ -73,2 +77,3 @@ ------------------

[#45]: https://github.com/jprichardson/node-jsonfile/issues/45 "Reading of UTF8-encoded (w/ BOM) files fails"
[#44]: https://github.com/jprichardson/node-jsonfile/issues/44 "Extra characters in written file"

@@ -75,0 +80,0 @@ [#43]: https://github.com/jprichardson/node-jsonfile/issues/43 "Prettyfy json when written to file"

@@ -27,2 +27,4 @@ var _fs = require('fs')

data = stripBom(data)
var obj

@@ -61,2 +63,3 @@ try {

var content = fs.readFileSync(file, options)
content = stripBom(content)

@@ -112,2 +115,9 @@ try {

function stripBom (content) {
// we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified
if (Buffer.isBuffer(content)) content = content.toString('utf8')
content = content.replace(/^\uFEFF/, '')
return content
}
var jsonfile = {

@@ -114,0 +124,0 @@ spaces: null,

2

package.json
{
"name": "jsonfile",
"version": "2.3.0",
"version": "2.3.1",
"description": "Easily read/write JSON files.",

@@ -5,0 +5,0 @@ "repository": {

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