# patternlab-pattern-data

> Reuse patternlab pattern data by reference within other components/patterns.

Latest version **1.0.0** (published 2020-11-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install patternlab-pattern-data
pnpm add patternlab-pattern-data
yarn add patternlab-pattern-data
bun add patternlab-pattern-data
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-11-26 |
| First published | 2020-11-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Daggerhart Lab |
| Maintainers | daggerhart |
| Keywords | patternlab |

## Links

- npm: https://www.npmjs.com/package/patternlab-pattern-data
- Repository: https://github.com/daggerhartlab/patternlab-pattern-data
- Homepage: https://github.com/daggerhartlab/patternlab-pattern-data#readme
- Issues: https://github.com/daggerhartlab/patternlab-pattern-data/issues
- npm.io page: https://npm.io/package/patternlab-pattern-data

## Recent versions

- 1.0.0 (latest) — 2020-11-26

## README

# Pattern Data Plugin

This is a PatternLab plugin for utilizing other pattern's data in a pattern
data.

## Installation

Add the following section info the `patternlab-config.json` file.

```json
{
  "plugins": {
	  "patternlab-pattern-data": {
		  "enabled": true
	  }
  }
}
```

## Usage

In a pattern's data file, data may be referenced from another pattern.

```yaml
# Shorthand syntax referencing the menu pattern by its "patternPartial", which
# can be found as the "p" parameter in the URL when browsing the PatternLab UI.
menu: 'patternData@organisms-menu'

# Shorthand syntax referencing the call to action pattern by "verbosePartial".
#  This is the file path of the twig or yaml file relative to the
# source/_patterns directory, omitting the extension.
call_to_action: 'patternData@02-organisms/call-to-action/call-to-action~exclaim'
```

Additionally, a long-form syntax is available. In the future, it may be
possible to utilize additional data or configurations from within plugin.

One idea here is that we'd be able to "extend" the other pattern's data with
data provided here. Other behaviors or functionality may also be possible.

```yaml
# Long form syntax referencing the menu pattern by its "patternPartial".
menu:
  patternData: 'organisms-menu'

# Long form syntax referencing the call to action pattern by its
# "patternPartial".
call_to_action:
  patternData: '02-organisms/call-to-action/call-to-action~exclaim'
```

---
_Source: https://npm.io/package/patternlab-pattern-data · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
