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

yml

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yml - npm Package Compare versions

Comparing version 0.0.5 to 1.0.0

27

build/main.js
(function() {
var YamlLoader, _, extend, fs, ursa, yaml;
var YamlLoader, _, crypto, extend, fs, rsa, yaml;
ursa = require('ursa');
crypto = require('crypto');

@@ -14,2 +14,17 @@ fs = require('fs');

rsa = {
decrypt: function(str, private_key) {
var buffer, decrypted;
buffer = new Buffer(str, 'base64');
decrypted = crypto.privateDecrypt(private_key, buffer);
return decrypted.toString('utf8');
},
encrypt: function(str, public_key) {
var buffer, encrypted;
buffer = new Buffer(str);
encrypted = crypto.publicEncrypt(public_key, buffer);
return encrypted.toString('base64');
}
};
YamlLoader = (function() {

@@ -23,3 +38,3 @@ function YamlLoader(path1, options1) {

if (this.options.key != null) {
this.key_file = ursa.createPrivateKey(fs.readFileSync(this.options.key));
this.key_file = fs.readFileSync(this.options.key);
}

@@ -59,3 +74,3 @@ this.env = this.options.env || process.env.NODE_ENV || 'development';

matches = /decrypt\((.+)\)/.exec(obj);
return this.key_file.decrypt(matches[1], 'base64', 'utf8');
return rsa.decrypt(matches[1], this.key_file);
} else {

@@ -88,5 +103,3 @@ return obj;

encrypt: function(phrase, public_key) {
var crt;
crt = ursa.createPublicKey(fs.readFileSync(public_key));
return crt.encrypt(phrase, 'utf8', 'base64');
return rsa.encrypt(phrase, fs.readFileSync(public_key));
}

@@ -93,0 +106,0 @@ };

{
"name": "yml",
"version": "0.0.5",
"version": "1.0.0",
"description": "Read Yaml files based on NODE_ENV or passed env + support for encryption",
"main": "build/main",
"dependencies": {
"js-yaml": "^3.3.0",
"lodash": "^3.2.0",
"node.extend": "^1.1.3",
"ursa": "^0.9.1"
"js-yaml": "^3.9.0",
"lodash": "^4.17.4",
"node.extend": "^2.0.0"
},

@@ -12,0 +11,0 @@ "repository": {

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