A minimalistic YAML parser with zero external dependencies.
Based on js-yaml by Vitaly Puzrin. Forked, heavily pruned, condensed and refactored.
NodeJS v20 or higher.
Install from within your project, like this:
npm install 0bone/yaml-reader
The file must be read into a string before calling the parser.
Example
const fs = require("node:fs");
const path = require("node:path");
const Parser = require("@0b1.org/yaml-reader/lib/parser");
const inputPath = path.join(__dirname, "./valid.yaml");
const inputData = fs.readFileSync(inputPath, "utf-8");
const result = Parser.Parse(inputData);
console.log(result);