jeremyfa / yaml.js

Standalone JavaScript YAML 1.2 Parser & Encoder. Works under node.js and all major browsers. Also brings command line YAML/JSON conversion tools.
MIT License
889 stars 142 forks source link

Add space after each object #110

Open vinodkolla opened 6 years ago

vinodkolla commented 6 years ago

I am using yaml-js to auto-format the yaml files. I have a big JSON file with chunks of objects in it. When i convert them to YAML format, i want to add space after each json object. Example:

{
  person1: {
    name: "Foo"
  },
  person2: {
     name: "Bar"
  }
}

When this is converted to YAML, it formats as

person1:
    name: "Foo"
person2:
   name: "Bar"

Expected output is :

person1:
    name: "Foo"

person2:
   name: "Bar"