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

rsa-yamljs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rsa-yamljs

Fork of yamljs (0.2.1) for a purpose. See README for details.

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

rsa-yaml.js

This project is a fork of <a href=https://github.com/jeremyfa/yaml.js.git>yaml.js Please check it's documentation first.

In this fork I have made below changes on JSON to YAML converter (Dumper.js).

-) In JSON key-value pairs, YML output of string values are wrapped with single quotes by default.

-) A configuration metadata JSON object can be passed as last parameter to Dumper function so that selected values can be wrapped in double quotes.

Sample use

fs   = require('fs');
yaml = require('./');

var my_json = { key1: "value1",
    key2: "value2",
    key3: "value3",
    key4: 5,
    key5: true
};

var metadata_conf = { double_quotes:
    [ 'key1',
        'key2' ] };


var yml_out = yaml.dump(my_json, null, null, null, null, metadata_conf);
fs.writeFile('out.yml', '---\n' + yml_out , function(err) {
    if(err) {
        console.log(err);
    } else {
        console.log("The file was saved!");
    }
});

For this sample values for key1, key2 will be double quoted, and value for key3 will be single quoted in the generated file.

Use with node.js

Install module:

npm install rsa-yamljs

Hope it helps someone out there. As a side note, I removed the coffee scripts and coded directly on the javascript files.

Keywords

FAQs

Package last updated on 09 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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