Socket
Socket
Sign inDemoInstall

manis

Package Overview
Dependencies
5
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.3 to 0.3.0-beta.1

4

lib/finder.js

@@ -51,5 +51,3 @@ /**

init: function () {
this.loader = this.loader || function (text) {
return JSON.parse(text);
};
this.loader = this.loader || util.loader;

@@ -56,0 +54,0 @@ this.cached = this.cache && Object.create(null);

@@ -274,2 +274,6 @@ /**

Manis.yaml = require('js-yaml');
Manis.loader = util.loader;
module.exports = Manis;

@@ -116,1 +116,21 @@ /**

exports.homeDirectory = exports.getHome();
var yaml = require('js-yaml');
var stripJSONComment = require('strip-json-comments');
/**
* Default loader
*
* @param {string} content string to be parsed
* @param {string} path config file path
* @param {?Object} options options for yaml.safeLoad
* @return {Object}
*/
exports.loader = function (content, path, options) {
try {
return yaml.safeLoad(stripJSONComment(content), options || {filename: path, json: true});
}
catch (e) {
return {};
}
};
{
"name": "manis",
"version": "0.2.3",
"version": "0.3.0-beta.1",
"description": "Find and read your configuration files recursively",

@@ -38,3 +38,7 @@ "main": "lib/manis.js",

"mock-fs": "^3.0.0"
},
"dependencies": {
"js-yaml": "^3.5.1",
"strip-json-comments": "^2.0.0"
}
}

@@ -57,2 +57,4 @@ Manis

#### NOTICE: the default loader strip comment after manis@0.3.0.
### Loading `.yml` with `js-yaml`

@@ -76,3 +78,5 @@

#### NOTICE: the default loader used `js-yaml` to load YAML and JSON content after manis@0.3.0.
### With defaults

@@ -167,2 +171,13 @@

### Manis.yaml;
Alias for `js-yaml` module.
### Object Manis.loader;
The default loader, parse JSON or YAML content with `js-yaml`.
### Object Manis#from(string path);
#### options

@@ -169,0 +184,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc