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 🙏

© 2026 – Pkg Stats / Ryan Hefner

bb2

v1.4.0

Published

BB Code 2.0 (aka KBB) - the redefined BB-Code

Downloads

53

Readme

NPM version Git Commit Git Releases CircleCI

This is JavaScript implementation of BBCode 2.0.

What's BB Code 2.0 (aka KBB)

BBCode is a lightweight markup language, introduced in 1998. It is base markup for phpBB forum system and vBulletin. Read more about BBCode on wikipedia

BBCode 2.0 is a new modern redefinition of BBCode. It introduces smart closing of tags, relaxes tags structure, introduces number of extensions and simplifies adding custom extensions.

It is alternative to other markup languages:

  • it's more structural, extendable and verbose than markdown
  • less structural and verbose than HTML

Therefore, the main use is for professional users: it's markup language and rich-text content description for server and browser, which can be rendered to HTML and SVG, as tags/text or directly into DOM.

Examples

Auto close

Instead of this

This is <b><i><u>complicated</u></i></b> - because you have to remember to close everything.

Why not just

This is [b][i][u]less complicated[/][/][/] - because you just auto-close last tag.

Smart to-HTML destructuring

Instead of this

This is <b>bold and <i>italic</i></b><i>or just italic</i> text.

Why not just

This is [b]bold and [i]italic[/b]or just italic[/i] text.

Lists

Instead of this

<ul>
  <li>HTML way</li>
  <li>of handling</li>
  <li>lists</li>
</ul>

Why not just

[li]BBCode way
[li]of handling
[li]lists
[/]

more examples...

More examples in /examples folder and at full BB2 documentation

BBCode-2 on node.js

Installation

npm install bb2

Run tests

npm test

Usage

// example_basic.js
const BBCodeHtml = require('bb2').BBCodeHtml
const bb         = new BBCodeHtml()
console.log(bb.parse('visible [0]invisible[1] [b]bold[/] [i]italic[/] [u]underline[/]'))

Examples

Look into /examples folder. To run examples, run this ONCE:

cd examples
node 0_prepare.js

This:

  • prepares the folder structure as to pretend that's a real project.
  • creates the gallery.html file, which contains all the results from - just open that in the browser

After prepare, you can hit any of example_*.js like that:

node example_basic.js

For details go to http://doc.ke.mu/doc/bb

Other implementations

This is implementation of bb2 in JavaScript for node.js and browsers use. We also implemented bb2 in PHP for our older projects, but we never had time to publish it - contact us if you're interested.

Roadmap

  • [x] remove Coffeescript dependency - full rewrite to ES6 completed
  • [ ] more functional approach - current one is OOP classes with inheritance. We will rewrite it to functional approach, to allow easier composition, like adding specific bb-tags without need of class-extend
  • [ ] separate parsing from rendering - currently parsing code and rendering code are closely coupled. We'll separate them to 2 functional blocks: parsing (to AST) and rendering (from AST)
  • [ ] move rendering from text based to Nate based - instead of building big HTML-strings, we'll use Nate to allow Universal building: direct DOM in the browser, HTML on server-side, LaTeX when needed, even SVG if possible
  • [ ] smart-table tags - smart creation of tables

Authors

  • Roman Pietrzak aka yosh - Architecture, Code, Tests, Documentation
  • Sylwester Wysocki aka dzik - Code, Tests, Examples

This project is sponsored by Kemu Studio and used as main rich-text engine in Calculla.