Name: rich-message
Owner: MOOSE Team
Description: :moneybag: Turn a plain message into a rich HTML message
Created: 2015-04-30 06:01:08.0
Updated: 2018-02-23 10:05:30.0
Pushed: 2016-03-25 21:31:33.0
Homepage: null
Size: 22
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Turn a plain message into a rich HTML message
install rich-message
richMessage = require('rich-message')
basicMessage = {
xt: 'hi maxogden', // text entered by a user
ername: 'mafintosh', // github username
mestamp: Date.now()
username = 'maxogden' // current user's github username (used for highlighting)
output = richMessage(basicMessage, username)
text: 'hi maxogden',
username: 'mafintosh',
timestamp: 1458939703123,
anon: false,
avatar: 'https://github.com/mafintosh.png',
timeago: '2:01 PM',
html: '<div class="highlight"><p>hi maxogden</p><p></p></div>' }
This module is currently very tightly coupled with friends (sorry). If you'd like to help make it more usable for other projects, please fork and contribute!
Contributions welcome! Please read the contributing guidelines first.