npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

spark-messages

v1.0.5

Published

A collection of helpers to ensure consistent formatting of Cisco spark messages.

Downloads

14

Readme

spark-messages Build Status XO code style

A collection of helpers to ensure consistent formatting of Cisco spark messages.

spark-messages may be redudant in some regards, but there are some side-benefits:

  • Any changes to markdown interpretation is corrected outside of source code
  • Ensure the usage of only a supported set of markdown -- no need to "guess and check"
  • HTML/CSS-like methods for easier referencing and implicit behavior
  • Programmability

Install

$ npm install --save spark-messages

Usage

const sm = require('spark-messages');

const message = `
${sm.h1('🦄 Unicorn Town')}
${sm.hr()}
For more info, click ${sm.link('http://unicornland.com', 'here')}!`
//=>
# 🦄 Unicorn Town
___
For more info, click [here](http://unicornland.com)!

Advance Usages

Mass editing a set of links

const sm = require('spark-messages');

const links = [
	'http://google.com',
	'http://facebook.com',
	'http://instagram.com'
];

const mdLinks = links.map(sm.link);
const boldLinks = mdLinks.map(sm.bold);
const mdLinkList = sm.ol(boldLinks);

// SHORT-HAND: sm.ol(links.map(raw => sm.link(sm.bold(raw))))
// =>
//   1. **<http://google.com>**
//   2. **<http://facebook.com>**
//   3. **<http://instagram.com>**

API

Preview the Spark Messages Wiki for visual reference of Spark output and examples.

Elements

h*{n}*(text)

h1(text), h2(text), h3(text), h4(text), h5(text), h6(text)

Text

Type: string

Text to be a header.

link(href, title)

Alias: a(), anchor()

href

Type: string

Url for the link

title

Type: string

Mask for the link.

email(emailAddress, title)

emailAddress

Type: string

Email address to create an link email. HTML equivalent = <a href="mailto:emailaddress">emailAddress</a>

title

Type: string

Mask for the email.

telephone(telephoneNumber, title)

Alias: tel()

telephoneNumber

Type: string

Telephone number to be an tel:.

title

Type: string

Mask for the telephone number.

unorderedList(items)

Alias: ul(items)

items

Type: array

List of items to be individually transformed to unordered list items.

orderedList(items)

Alias: ol(items)

items

Type: array

List of items to be individually transformed to unordered list items.

unorderedList(items)

Alias: ul(items)

items

Type: array

List of items to be individually transformed to ordered list items.

Font Style

bold(text)

Alias: b(), heavy()

Text

Type: string

Text to be bolded.

italic(text)

Alias: i(text), em(text), emphasis(text)

Text

Type: string

Text to be italicize.

code(text)

Alias: c(text)

Text

Type: string

Text to be transformed into a code style.

codeBlock(text)

Alias: cb(text)

Text

Type: string

Text to be transformed into a code block style.

Visual Elements

horizontalRule()

Alias: hr()

Returns a markdown horziontal rule (___).

lineBreak()

Alias: br()

Returns a linebreak.

License

MIT © Brandon Him