Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
A wrapper for js-yaml parser
This documentation is actual for next major version of the library. If you want the documentation of current stable version, please check out the 3.x branch.
You can install this module from Yarn:
yarn add node-yaml js-yaml
Or using NPM:
npm install node-yaml js-yaml
import {read} from "node-yaml"
read("path/to/file.yaml")
.then(res => console.log("File content:\n\n%s", JSON.stringify(res, null, 2)))
.catch(err => console.error("Error while reading file:\n\n%s", String(err)))
read
and readSync
methods allows to omit file extension:import {readSync} from "node-yaml"
// Will read the content from given path, but also resolve file extension
// Note that if you have 2 files with the same name,
// the first matched will be read.
readSync("path/to/file")
yaml.read(filename[, options]) -> {Promise<object>}
Read and parse YAML file from given path. Takes following arguments:
yaml.readSync(filename[, options]) -> {object}
Synchronous version of yaml.read
yaml.write(filename, object[, options]) -> {Promise<void>}
Write given YAML content to disk. Takes following arguments:
yaml.writeSync(filename, object[, options]) -> {void}
Synchronous version of yaml.write
FAQs
A wrapper for js-yaml parser
The npm package node-yaml receives a total of 31,164 weekly downloads. As such, node-yaml popularity was classified as popular.
We found that node-yaml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.