{"id":19860319,"url":"https://github.com/dailyrandomphoto/node-read-yaml","last_synced_at":"2026-01-23T07:34:50.110Z","repository":{"id":48444606,"uuid":"220382637","full_name":"dailyrandomphoto/node-read-yaml","owner":"dailyrandomphoto","description":"Read and parse a YAML file. A wrapper of js-yaml read file directly.","archived":false,"fork":false,"pushed_at":"2021-07-26T06:26:38.000Z","size":16,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-09T06:55:13.730Z","etag":null,"topics":["read-file","yaml","yml"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dailyrandomphoto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-08T03:53:20.000Z","updated_at":"2020-07-30T14:37:39.000Z","dependencies_parsed_at":"2022-09-15T17:00:42.708Z","dependency_job_id":null,"html_url":"https://github.com/dailyrandomphoto/node-read-yaml","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":"0.33333333333333337","last_synced_commit":"3c0a9fd76fe4fe3dd96206359ef6a29b17cc4227"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dailyrandomphoto/node-read-yaml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailyrandomphoto%2Fnode-read-yaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailyrandomphoto%2Fnode-read-yaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailyrandomphoto%2Fnode-read-yaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailyrandomphoto%2Fnode-read-yaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dailyrandomphoto","download_url":"https://codeload.github.com/dailyrandomphoto/node-read-yaml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailyrandomphoto%2Fnode-read-yaml/sbom","scorecard":{"id":317181,"data":{"date":"2025-08-11","repo":{"name":"github.com/dailyrandomphoto/node-read-yaml","commit":"3c0a9fd76fe4fe3dd96206359ef6a29b17cc4227"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/6 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T00:28:50.055Z","repository_id":48444606,"created_at":"2025-08-18T00:28:50.055Z","updated_at":"2025-08-18T00:28:50.055Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28683468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T05:48:07.525Z","status":"ssl_error","status_checked_at":"2026-01-23T05:48:07.129Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["read-file","yaml","yml"],"created_at":"2024-11-12T15:03:57.608Z","updated_at":"2026-01-23T07:34:50.093Z","avatar_url":"https://github.com/dailyrandomphoto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-read-yaml\n\n[![NPM Version][npm-version-image]][npm-url]\n[![LICENSE][license-image]][license-url]\n[![Build Status][travis-image]][travis-url]\n[![code style: prettier][code-style-prettier-image]][code-style-prettier-url]\n\nRead and parse a YAML file. A wrapper of [`js-yaml`](https://github.com/nodeca/js-yaml) read file directly.\n\n```js\nconst read = require(\"node-read-yaml\");\n\nconst doc = read.sync(filename);\nconsole.log(doc);\n```\n\nsame as\n\n```js\nconst fs = require(\"fs\");\nconst yaml = require(\"js-yaml\");\n\nconst doc = yaml.safeLoad(fs.readFileSync(filename, \"utf8\"));\nconsole.log(doc);\n```\n\n## Installation\n\n```sh\nnpm install node-read-yaml\n```\n\n## API\n\n### read (filename [ , options ]) | read.sync (filename [ , options ])\n\nRead a YAML file and parse content as JSON.\nReturns either a plain object, an array, a string or undefined, or throws YAMLException on error. By default, does not support regexps, functions and undefined. This method is safe for untrusted data.\n[more](https://github.com/nodeca/js-yaml#api)\n\noptions:\n\n- `multi` _(default: false)_ - If true, then reads file as multi-document and returns an array.\n- `onWarning` _(default: null)_ - function to call on warning messages.\n  Loader will call this function with an instance of `YAMLException` for each warning.\n- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use.\n  - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects:\n    http://www.yaml.org/spec/1.2/spec.html#id2802346\n  - `JSON_SCHEMA` - all JSON-supported types:\n    http://www.yaml.org/spec/1.2/spec.html#id2803231\n  - `CORE_SCHEMA` - same as `JSON_SCHEMA`:\n    http://www.yaml.org/spec/1.2/spec.html#id2804923\n  - `DEFAULT_SAFE_SCHEMA` - all supported YAML types, without unsafe ones\n    (`!!js/undefined`, `!!js/regexp` and `!!js/function`):\n    http://yaml.org/type/\n  - `DEFAULT_FULL_SCHEMA` - all supported YAML types.\n- `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error.\n\n#### Examples\n\n**asynchronously read a file**\n\n```js\nconst read = require(\"node-read-yaml\");\n\nread(\"config.yml\")\n  .then((doc) =\u003e console.log(doc))\n  .catch((err) =\u003e console.error(err));\n```\n\nwrapper of `require('js-yaml').safeLoad`\n\n**asynchronously read multi-document file**\n\n```js\nconst read = require(\"node-read-yaml\");\n\nread(\"config.yml\", { multi: true })\n  .then((arr) =\u003e arr.forEach((doc) =\u003e console.log(doc)))\n  .catch((err) =\u003e console.error(err));\n```\n\nwrapper of `require('js-yaml').safeLoadAll`\n\n**synchronously read a file**\n\n```js\nconst readSync = require(\"node-read-yaml\").sync;\n\ntry {\n  const doc = readSync(\"config.yml\");\n  console.log(doc);\n} catch (err) {\n  console.log(err);\n}\n```\n\nwrapper of `require('js-yaml').safeLoad`\n\n**synchronously read multi-document file**\n\n```js\nconst readSync = require(\"node-read-yaml\").sync;\n\ntry {\n  const arr = readSync(\"config.yml\", { multi: true });\n  arr.forEach((doc) =\u003e console.log(doc));\n} catch (err) {\n  console.log(err);\n}\n```\n\nwrapper of `require('js-yaml').safeLoadAll`\n\n### read.YAMLException\n\n`require('js-yaml').YAMLException`\n\n## Related\n\n- [node-read-yaml-files](https://github.com/dailyrandomphoto/node-read-yaml-files) - Read and parse YAML files in a directory and its subdirectories.\n- [js-yaml](https://github.com/nodeca/js-yaml) - JavaScript YAML parser and dumper. Very fast.\n\n## License\n\nCopyright (c) 2019 [dailyrandomphoto][my-url]. Licensed under the [MIT license][license-url].\n\n[my-url]: https://github.com/dailyrandomphoto\n[npm-url]: https://www.npmjs.com/package/node-read-yaml\n[travis-url]: https://travis-ci.org/dailyrandomphoto/node-read-yaml\n[license-url]: LICENSE\n[code-style-prettier-url]: https://github.com/prettier/prettier\n[npm-downloads-image]: https://img.shields.io/npm/dm/node-read-yaml\n[npm-version-image]: https://img.shields.io/npm/v/node-read-yaml\n[license-image]: https://img.shields.io/npm/l/node-read-yaml\n[travis-image]: https://img.shields.io/travis/dailyrandomphoto/node-read-yaml\n[code-style-prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdailyrandomphoto%2Fnode-read-yaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdailyrandomphoto%2Fnode-read-yaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdailyrandomphoto%2Fnode-read-yaml/lists"}