# email-lang

> The email language

Latest version **1.1.2** (published 2017-02-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install email-lang
pnpm add email-lang
yarn add email-lang
bun add email-lang
```

## 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.1.2 |
| Published | 2017-02-25 |
| First published | 2017-02-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | mattmezza |

## Links

- npm: https://www.npmjs.com/package/email-lang
- Repository: https://github.com/mattmezza/email-lang
- Homepage: https://github.com/mattmezza/email-lang#readme
- Issues: https://github.com/mattmezza/email-lang/issues
- npm.io page: https://npm.io/package/email-lang

## Recent versions

- 1.1.2 (latest) — 2017-02-25
- 1.1.1 — 2017-02-25
- 1.1.0 — 2017-02-25
- 1.0.0 — 2017-02-23

## README

# SYNOPSIS
_A language to model emails._

You can use this software in your npm project by requiring it or you can use [email-lang-cli](https://github.com/mattmezza/email-lang-cli) from your command line.

# BUILD

[![Travis](https://img.shields.io/travis/mattmezza/email-lang.svg)]()

```bash
npm install --save-dev email-lang
```

# USAGE

### email.txt
Write an email file that follows the language specification

```
From: "matteomerola.me" <mattmezza@gmail.com>
Subject: Comment about the novel
Date: February 21, 2017 at 7:02:47 AM GMT+1
To: Tiffany <tiffany.holsen@me.com>
Reply-To: Matteo <mattmezza@gmail.com>

We all know the numerous film adaptations of the novel!

Cheers,
  Matt.
```

### index.js
Create an instance of the model then pass data into it one or more times.

```js
const fs = require('fs')
const compile = require('email-lang')

let emails = compile(fs.readFileSync('email.txt', 'utf8'))

console.log(emails[0].subject) // prints "Comment about the novel"
```

### output

The result will be an array of emails structured as follows

```js
[
  {
    from: {
      name: 'Matteo',
      email: 'mattmezza@gmail.com'
    },
    subject: 'The subject of the email',
    to: {
      name: 'Recipient',
      email: 'recipient@email.it'
    },
    replyTo: {
      name: 'Matteo',
      email: 'mattmezza@gmail.com'
    },
    text: 'The body content of the email message'
  },
  {
    ...// another email if any
  }
]
```

# LICENSE

http://matteomerola.me

[![License](https://img.shields.io/npm/l/array.from.svg)](/LICENSE)

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