Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

359
Views
How to read yaml file from typescript

I have tried to write a small piece of code in typescript to read yaml file but unfortunately it is not working.

import { readFile } from 'fs/promises';
import { load } from 'js-yaml';

const filepath = 'src/commands/hello/test.yml';

const yaml = load(await readFile(filepath, "utf8")) as string;
const phrases = yaml.trainingPhrases;

console.log(phrases);

My yaml file

---
trainingPhrases:
- help me
- what to do
- how to play
- help
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!