How to create yaml from express.js

hi guys i need to create training yaml file from express.js yaml file format like

version: "3.0"
responses:
  utter_faq/q1:
  - text: |-
      question 1
  utter_faq/q2:
  - text: |-
      question 2

i tried yaml-writer but it write only can json file

writeYamlFile('foo.yaml', {
    version: "3.0"
    responses:
      utter_faq/q1:
      - text: |-
          question 1
      utter_faq/q2:
      - text: |-
          question 2
}).then(() => {
  console.log('done');
});

need some help