moose-team/rich-message

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

rich-message

Turn a plain message into a rich HTML message

npm travis

Install
install rich-message
Usage
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!

Contributing

Contributions welcome! Please read the contributing guidelines first.

License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.