# @delucis/reading-data-yaml-loader

> YAML file loader plugin for @delucis/reading-data.

Latest version **0.1.2** (published 2019-06-14) · GPL-3.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @delucis/reading-data-yaml-loader
pnpm add @delucis/reading-data-yaml-loader
yarn add @delucis/reading-data-yaml-loader
bun add @delucis/reading-data-yaml-loader
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2019-06-14 |
| First published | 2017-08-18 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Chris Swithinbank |
| Maintainers | delucis |

## Links

- npm: https://www.npmjs.com/package/@delucis/reading-data-yaml-loader
- Repository: https://github.com/delucis/reading-data-yaml-loader
- Homepage: https://github.com/delucis/reading-data-yaml-loader#readme
- Issues: https://github.com/delucis/reading-data-yaml-loader/issues
- npm.io page: https://npm.io/package/@delucis/reading-data-yaml-loader

## Dependencies (3)

- [got](https://npm.io/package/got.md) ^9.6.0
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.13.1
- [load-yaml-file](https://npm.io/package/load-yaml-file.md) ^0.2.0

## Recent versions

- 0.1.2 (latest) — 2019-06-14
- 0.1.1 — 2019-06-14
- 0.1.0 — 2017-08-18

## README

# @delucis/reading-data-yaml-loader

[![Build Status](https://travis-ci.org/delucis/reading-data-yaml-loader.svg?branch=master)](https://travis-ci.org/delucis/reading-data-yaml-loader)
[![Coverage Status](https://coveralls.io/repos/github/delucis/reading-data-yaml-loader/badge.svg?branch=master)](https://coveralls.io/github/delucis/reading-data-yaml-loader?branch=master)
[![npm (scoped)](https://img.shields.io/npm/v/@delucis/reading-data-yaml-loader.svg)](https://www.npmjs.com/package/@delucis/reading-data-yaml-loader)

A plugin for [`@delucis/reading-data`](https://github.com/delucis/reading-data)
that loads YAML files over the network or from the local file system.


## Installation

```sh
npm install --save @delucis/reading-data-yaml-loader
```


## Usage

```js
const RD = require('@delucis/reading-data')
const YAML_LOADER = require('@delucis/reading-data-yaml-loader')

RD.use(YAML_LOADER, {
  scope: 'myYAMLFile',
  path: 'https://unpkg.com/@delucis/reading-data/.travis.yml'
})

RD.run().then((res) => {
  console.log(res.data.myYAMLFile)
})
```

Using `reading-data-yaml-loader` to load multiple files:

```js
RD.use(YAML_LOADER, {
  scope: [local, github, unpkg]
  path: {
    local: 'config.yml',
    github: 'https://raw.githubusercontent.com/delucis/reading-data/master/.travis.yml',
    unpkg: 'https://unpkg.com/@delucis/reading-data/.travis.yml'
  }
})

RD.run().then((res) => {
  for (var key in res.data) {
    console.log(key) // 'local', 'github', 'unpkg'
  }
})
```


## Options

name    | type                 | default       | required? | description
--------|----------------------|---------------|:---------:|-------------------------------------------------------------------------------------------------------------------------------------------
`hooks` | `String`, `Object` |               |           | The `reading-data` hook that should load the YAML file. Can be scoped by passing an object with scopes as keys, hooks as values.
`path`  | `String`, `Object` |               |     ✔︎     | The path or URL of the YAML file to load. Can be an object, where the keys match the scope(s) set in the `scope` option.
`scope` | `String`, `Array`  | 'yaml-loader' |           | The scope under which `reading-data` will store this plugin’s data. Can be an array to return multiple filepaths/URLs, to multiple scopes.

---
_Source: https://npm.io/package/@delucis/reading-data-yaml-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
