Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eldoy/mrkp
Create HTML with a single Javascript function
https://github.com/eldoy/mrkp
Last synced: 6 days ago
JSON representation
Create HTML with a single Javascript function
- Host: GitHub
- URL: https://github.com/eldoy/mrkp
- Owner: eldoy
- Created: 2019-10-17T22:15:44.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-18T00:13:40.000Z (about 5 years ago)
- Last Synced: 2024-11-05T06:06:30.437Z (10 days ago)
- Language: JavaScript
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MRKP
Create HTML with a single Javascript function.
Isomorphic, works in both the browser and in Node. Only 218 bytes minified.
### Install
```
npm i mrkp
```### Usage
In node:
```javascript
var h = require('mrkp')
```In the browser:
```html
"+(t||"")+("string"==typeof i?i:(i||[]).join(""))+(null===t?"":"</"+n+">")}```
Make HTML:
```javascript
h('div', 'Content', { class: 'active' }, [
h('ul', '', {}, [
h('li', 'Meat'),
h('li', 'Milk'),
h('li', 'Butter')
])
])
```
MIT Licensed. Enjoy!