# panda-messages

> Message lookup with templating

Latest version **0.0.1** (published 2016-03-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install panda-messages
pnpm add panda-messages
yarn add panda-messages
bun add panda-messages
```

Provides the command `message`.

## 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.0.1 |
| Published | 2016-03-23 |
| First published | 2016-03-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dan Yoder |
| Maintainers | dyoder |
| Keywords | messages |

## Links

- npm: https://www.npmjs.com/package/panda-messages
- Repository: https://github.com/pandastrike/message
- Homepage: https://github.com/pandastrike/message#readme
- Issues: https://github.com/pandastrike/message/issues
- npm.io page: https://npm.io/package/panda-messages

## Dependencies (3)

- [js-yaml](https://npm.io/package/js-yaml.md) ^3.5.5
- [fairmont](https://npm.io/package/fairmont.md) ^1.0.0-beta-40
- [markup-js](https://npm.io/package/markup-js.md) ^1.5.21

## Recent versions

- 0.0.1 (latest) — 2016-03-23

## README

# Panda Messages

Javascript-based message lookup with support for message templates.

## API Examples

#### JavaScript

```javascript
var messages = require("messages");

message("my-messages.yaml")
.then(function(Messages) {
  console.log(
    Messages.message("greeting", { name: "World" })
  );
});
```

#### CoffeeScript

```coffee
messages = require "messages"

message "my-messages.yaml"
.then ({message}) ->
  console.log message "greeting", name: "World"
```

## CLI Examples

```
$ message my-messages.yaml greeting --data 'name: World'
Hello World
```

The `--data` flag is optional.

```
$ message my-messages.yaml farewell
Goodbye!
```

## Installation

```
npm install panda-messages
```

Or, if you want to use the CLI, you may want to use the `-g` option.

```
npm install -g panda-messages
```

## API Reference

### messages _path_

The `message` module exports a single function that takes a path
and returns a promise. If the path is for a valid YAML file,
the promise resolves to an object whose properties are message helpers.

These helpers are: `lookup`, `message`, and `abort`.

### lookup _key_

Returns the message that corresponds to the `key`.

### message _key_, _data={}_

Returns the message that corresponds to the `key` and
processes it as a template, using `data`.
If you don't pass a `data` argument, it defaults to
the empty object.

### abort _key_, _data={}_

Works like `message` except that it
displays the message on standard error and then aborts
(calls `process.exit`) with a status code of 1.

## Templates

Message uses [Markup-JS](https://github.com/adammark/Markup.js/) to render template strings.

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