# vuepress-plugin-global-variables

> vuepress-plugin-global-variables

Latest version **0.2.0** (published 2020-11-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install vuepress-plugin-global-variables
pnpm add vuepress-plugin-global-variables
yarn add vuepress-plugin-global-variables
bun add vuepress-plugin-global-variables
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2020-11-06 |
| First published | 2020-11-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Artur Mędrygał |
| Maintainers | demtario |
| Keywords | global, global-variables, vue, vuepress |

## Links

- npm: https://www.npmjs.com/package/vuepress-plugin-global-variables
- Repository: https://github.com/demtario/vuepress-plugin-global-variables
- Issues: https://github.com/demtario/vuepress-plugin-global-variables/issues
- npm.io page: https://npm.io/package/vuepress-plugin-global-variables

## Recent versions

- 0.2.0 (latest) — 2020-11-06
- 0.1.1 — 2020-11-06
- 0.1.0 — 2020-11-06

## README

<h1 align="center">vuepress-plugin-global-variables</h1>
<div align="center">

Plugin that add a global variables for VuePress.

![Version](https://img.shields.io/github/package-json/v/demtario/vuepress-plugin-global-variables?style=flat-square)
![NPM](https://img.shields.io/npm/l/vuepress-plugin-global-variables?style=flat-square)

</div>

## Install

```sh
yarn add -D vuepress-plugin-global-variables
# OR npm install -D vuepress-plugin-global-variables
```

## Use

Register plugin, all `variables` keys will be registred as a global variables in your vuepress app

```js
module.exports = {
  plugins: [['vuepress-plugin-global-variables', { variables: { example: 'foo' } }]],
}
```

Now, you can simply use `$var[key]` or `this.$page.global[key]` to get your variable in any template or component.

Example:

```vue
{{ $var.example }}

// or

{{ $page.global.example }}
```

will render:

```md
foo
```

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