Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattmezza/email-lang-cli
The Email Language CLI
https://github.com/mattmezza/email-lang-cli
cli compiler email language parser transpiler
Last synced: 5 days ago
JSON representation
The Email Language CLI
- Host: GitHub
- URL: https://github.com/mattmezza/email-lang-cli
- Owner: mattmezza
- License: mit
- Created: 2017-02-24T18:12:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-02-24T18:38:59.000Z (over 7 years ago)
- Last Synced: 2024-04-27T01:21:59.289Z (6 months ago)
- Topics: cli, compiler, email, language, parser, transpiler
- Language: JavaScript
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SYNOPSIS
This is a CLI (command line interface) for [The Email Language](https://github.com/mattmezza/email-lang).# BUILD
[![Travis](https://img.shields.io/travis/mattmezza/email-lang-cli.svg)]()
# USAGE
### Installation
```bash
npm install -g email-lang-cli
```### Input
Write an email file that follows the language specification```
From: "matteomerola.me"
Subject: Comment about the novel
Date: February 21, 2017 at 7:02:47 AM GMT+1
To: Tiffany
Reply-To: MatteoWe all know the numerous film adaptations of the novel!
Cheers,
Matt.
```### Use the CLI
Use [email-lang-cli](https://github.com/mattmezza/email-lang-cli) to parse the file and produce a json output.
```bash
email-lang-cli --file email.txt --out-file emails.json
```The full specification of the CLI can be obtained with `email-lang-cli -h` and is as follows
```
Usage: email lang-cli [options] [command]Commands:
help Display help
Options:
-d, --dir The directory containing the email text files you want to parse
-f, --file The file containing the email text you want to parse
-h, --help Output usage information
-o, --out-file [value] The output file in which you want the emails to be parsed (defaults to "emails.json")
-v, --version Output the version number
````--file`: takes a file in input. The file might contain one or more emails in the classic text format
`--dir`: takes a directory in input. The directory contains all the email files to parse (by default it ignores file names not ending with `.txt`)
`--out-file`: specifies the file name of the output json fileTypical usage would be:
`email-lang-cli -f email.txt -o emails.json`
This would print out some info and create the output file starting from the input file
### Output
The result will be an array of emails structured as follows
```json
[
{
"from": {
"name": "matteomerola.me",
"email": "[email protected]"
},
"subject": "Hello from Ibiza",
"date": "February 21, 2017 at 7:02:47 AM GMT+1",
"to": {
"name": "Tiffany",
"email": "[email protected]"
},
"replyTo": {
"name": "Matteo",
"email": "[email protected]"
},
"text": "We all know the numerous film adaptations of the novel!\n\nCheers,\n Matt.\n"
}
]
```# LICENSE
http://matteomerola.me
[![License](https://img.shields.io/npm/l/array.from.svg)](/LICENSE)