Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/segment-boneyard/read-metadata
Load a JSON or YAML metadata file and return it as an object.
https://github.com/segment-boneyard/read-metadata
Last synced: about 5 hours ago
JSON representation
Load a JSON or YAML metadata file and return it as an object.
- Host: GitHub
- URL: https://github.com/segment-boneyard/read-metadata
- Owner: segment-boneyard
- Created: 2014-07-30T17:34:37.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-08-24T07:19:02.000Z (about 3 years ago)
- Last Synced: 2024-04-09T16:31:14.122Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 191 KB
- Stars: 11
- Watchers: 41
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Build Status](https://circleci.com/gh/segmentio/read-metadata.png?circle-token=c2b4cfaa8e98f46f9ee24fba69609eb790e500f2)](https://circleci.com/gh/segmentio/read-metadata)
# read-metadata
Load a JSON or YAML metadata file and return it as an object.
## Install
```
npm install read-metadata
```## Usage
It handles both JSON and YAML and will return a parsed object.
```
var read = require('read-metadata');read('path/to/metadata.json', function(err, data){
console.log(data);
});
```## API
### read(path, callback)
Takes a path to the metadata file. The callback will be called with `fn(err, result)`.
### read.sync(path)
Load a metafile syncronously.