Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johno/shtml
[WIP] Style shell output in an html-like fashion
https://github.com/johno/shtml
Last synced: 3 months ago
JSON representation
[WIP] Style shell output in an html-like fashion
- Host: GitHub
- URL: https://github.com/johno/shtml
- Owner: johno
- License: mit
- Created: 2016-06-27T17:50:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-08T00:33:46.000Z (over 8 years ago)
- Last Synced: 2024-04-24T17:41:16.033Z (9 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# shtml [![Build Status](https://secure.travis-ci.org/johnotander/shtml.svg?branch=master)](https://travis-ci.org/johnotander/shtml) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)
Style shell output in an html-like fashion.
This library draws inspiration from [chx](https://github.com/zeit/chx) but differs because it uses JavaScript template literals.Requires no transpilation or babelscript.
## Installation
```bash
npm install --save shtml
```## Usage
```javascript
const shtml = require('shtml')console.log(shtml`
- Item A
- Item B
`)
console.log(shtml`
Hello, world!
This is pretty neat.
`)
```
#### Supported tags
Tag | Usage | Description
--- | --- | -----------
`
` | `
...
` | Wrapper for text, adds a new line to the end`
` | `
` | Adds a newline
`
` | `
` | Adds a horizontal rule
`
- ` | `
- Item A
- Item B
`` | `...` | Color the text, see the [supported colors](#colors) below
`` | `...` | Color the background of text, see the [supported colors](#colors) below
`` | `...` | Get rainbow colored text
#### Colors
In order to color console text, `shtml` uses [`chalk`](https://npmjs.com/package/chalk).
The following colors are supported:
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
- gray
## License
MIT
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
Crafted with <3 by John Otander ([@4lpine](https://twitter.com/4lpine)).
***
> This package was initially generated with [yeoman](http://yeoman.io) and the [p generator](https://github.com/johnotander/generator-p.git).