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

yaml-or-json

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yaml-or-json - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

11

index.js

@@ -5,2 +5,3 @@ 'use strict';

var yaml = require('js-yaml');
var json5 = require('json5');

@@ -14,3 +15,3 @@ var opts = {

return fs.readFileSync(filePath, opts);
} catch(e) {
} catch (e) {
return undefined;

@@ -33,5 +34,11 @@ }

return require(path + '.json');
content = readFile(path + '.json');
if (typeof content !== 'undefined') {
return json5.parse(content);
}
throw new Error('no config file found');
}
module.exports = yamlOrJSON;

8

package.json
{
"name": "yaml-or-json",
"version": "0.1.0",
"version": "0.2.0",
"description": "Requires a yaml or json config file depending on what it finds.",

@@ -9,2 +9,5 @@ "main": "index.js",

},
"files": [
"index.js"
],
"repository": {

@@ -33,3 +36,4 @@ "type": "git",

"dependencies": {
"js-yaml": "^3.4.0"
"js-yaml": "^3.4.0",
"json5": "^0.4.0"
},

@@ -36,0 +40,0 @@ "devDependencies": {

@@ -30,4 +30,9 @@ # yaml-or-json

## JSON5 is supported!
JSON files are parsed by [JSON5 parser](https://www.npmjs.com/package/json5).
## License
The MIT License (MIT)

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