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

bbcode-async

v1.0.5

Published

Asnyc parser for [bb]Code

Readme

bbcode-async

A simple BBCode parser/renderer with async, designed for NodeJS.

-- NOT PRODUCTION YET --

Installation

npm i bbcode-async

Usage

First, require this library

const bba = require('bbcode-async')
 

When it´s initiated, you can parse strings.

let string "[h1]Hello World[/h1] this is my text";

bba.parse(string, function(err, result) {
    console.log(result);
    // will output <h1>Hello World</h1> this is my text
})

Options

| option | default | function | |----------------|---------|-----------------------------------------| | replaceNewLine | false | replaces each \r and \n with | | dataAttributes | false | allow usage of data-xyz="data" | | classes | false | allows to define classes in BBCode tags | | classPrefix | null | adds a prefix to classes |

options can be passed by second attribute like:

let options = {
    replaceNewLine: true
};

bba.parse(string, options, function(err, result) {
    console.log(result);
}) 

Default Tags

| tag | rendered | |---------------------------------------------|---------------------------------------------------------------------------| | [url=google.com]link[/url] | link | | [[email protected]]email me[/email] | email me | | [b]bold content[/b] | bold content | | [i]italic content[/i] | italic content | | [u]underlined content[/u] | underlined content | | [s]strike-through content[/s] | strike-through content | | [indent]quoted content[/indent] | quoted content | | [list][/list] | alias for [ul] | | [ul][/ul] | | | [li][/li] | | | [php]code content[/php] | | | [javascript]code content[/javascript] | | | [java]code content[/java] | | | [ruby]code content[/ruby] | | | [css]code content[/css] | | | [python]code content[/python] | | | [code]code content[/code] | | | [color=black]colored content[/color] | | | [h1]headline content[/h1] | | | [h2..6]headline 2-6 content[/h2..6] | | | [span]simple span content[/span] | | | [p]simple paragraph content[/p] | | | [img=http://link_to_my_image.jpg][/img] | | | [center]centered content[/center] | | | [left]left-alined content[/left] | | | [right]left-alined content[/right] | |

Custom Tags

Simple as easy to add you own custom tag

bba.registerTag('mytag', function(string, tag, attrs, value, tagDetails, done) {
    return done(null, '<my-tag>' + value + '</mytag>');
})

same for asynchronous custom tags

bba.registerTag('mytag', function(string, tag, attrs, value, tagDetails, done) {
    // simulates an async call
    setTimeout(function() {
        return done(null, '<my-tag>' + value + '</mytag>');
    }, 2000);
})