{"id":15654097,"url":"https://github.com/jonschlinkert/read-yaml","last_synced_at":"2025-04-30T07:22:42.691Z","repository":{"id":18785506,"uuid":"21998967","full_name":"jonschlinkert/read-yaml","owner":"jonschlinkert","description":"Very thin wrapper around js-yaml for directly reading in YAML files.","archived":false,"fork":false,"pushed_at":"2019-11-18T19:48:29.000Z","size":22,"stargazers_count":27,"open_issues_count":1,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-25T12:04:56.965Z","etag":null,"topics":["data","file","json","yaml"],"latest_commit_sha":null,"homepage":"https://github.com/jonschlinkert","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/jonschlinkert.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":"2014-07-19T01:11:52.000Z","updated_at":"2023-10-20T09:38:22.000Z","dependencies_parsed_at":"2022-08-05T02:01:50.259Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/read-yaml","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fread-yaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fread-yaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fread-yaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fread-yaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/read-yaml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251658715,"owners_count":21622909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["data","file","json","yaml"],"created_at":"2024-10-03T12:49:30.004Z","updated_at":"2025-04-30T07:22:42.675Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# read-yaml [![NPM version](https://img.shields.io/npm/v/read-yaml.svg?style=flat)](https://www.npmjs.com/package/read-yaml) [![NPM monthly downloads](https://img.shields.io/npm/dm/read-yaml.svg?style=flat)](https://npmjs.org/package/read-yaml)  [![NPM total downloads](https://img.shields.io/npm/dt/read-yaml.svg?style=flat)](https://npmjs.org/package/read-yaml) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/read-yaml.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/read-yaml)\n\n\u003e Very thin wrapper around js-yaml for directly reading in YAML files.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save read-yaml\n```\n\n## API\n\n### [readYaml](index.js#L29)\n\nRead yaml file asynchronously and parse content as JSON.\n\n**Params**\n\n* `filepath` **{String}**: Path of the file to read.\n* `options` **{Object|String}**: to pass to [js-yaml](https://github.com/nodeca/js-yaml)\n* `cb` **{Function}**: Callback function `\n\n**Example**\n\n```js\nvar readYaml = require('read-yaml');\nreadYaml('config.yml', function(err, data) {\n  if (err) throw err;\n  console.log(data);\n});\n```\n\n### [.sync](index.js#L69)\n\nRead yaml file synchronously and parse content as JSON.\n\n**Params**\n\n* `filepath` **{String}**: Path of the file to read.\n* `options` **{Object|String}**: to pass to [js-yaml](https://github.com/nodeca/js-yaml).\n* `returns` **{Object}**: JSON\n\n**Example**\n\n```js\nvar read = require('read-yaml');\nvar config = read.sync('config.yml');\n```\n\n## About\n\n### Related projects\n\n* [copy](https://www.npmjs.com/package/copy): Copy files or directories using globs. | [homepage](https://github.com/jonschlinkert/copy \"Copy files or directories using globs.\")\n* [read-data](https://www.npmjs.com/package/read-data): Read JSON or YAML files. | [homepage](https://github.com/jonschlinkert/read-data \"Read JSON or YAML files.\")\n* [write](https://www.npmjs.com/package/write): Write files to disk, creating intermediate directories if they don't exist. | [homepage](https://github.com/jonschlinkert/write \"Write files to disk, creating intermediate directories if they don't exist.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 15 | [shinnn](https://github.com/shinnn) |\n| 10 | [jonschlinkert](https://github.com/jonschlinkert) |\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on April 02, 2017._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fread-yaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fread-yaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fread-yaml/lists"}