Registry / serialization / bbcode

bbcode

JSON →
library1.1.0jsnpmunverified

The `bbcode` package is a basic BBCode parser designed for Node.js environments. It is currently at version 0.1.5, which was published approximately 12 years ago, indicating it is no longer actively maintained. The package's primary function is to convert BBCode strings into HTML, supporting fundamental tags like `[b]` for bold text. Its release cadence is effectively non-existent, as there have been no updates for over a decade. Compared to contemporary BBCode parsing libraries (e.g., `@bbob/parser`, `ya-bbcode`, `js-bbcode-parser`), this package offers a very limited feature set, lacks modern JavaScript support (such as ESM), and does not provide TypeScript type definitions. It was originally based on work from stonesteps.ca. Due to its age and lack of maintenance, it is generally not recommended for new projects.

npm install bbcode
INSTALL
IMPORT
SIG · BBCODE
B
bbcode
serializationjavascriptv1.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

bbcode
const bbcode = require('bbcode');
import bbcode from 'bbcode';
This package is CommonJS-only, reflecting its age. ESM import syntax is not supported and will result in errors.
parse
bbcode.parse('[b]hello[/b]', callback);
import { parse } from 'bbcode';
The `parse` method is accessed directly from the default CommonJS export, not as a named export.

Demonstrates how to import the `bbcode` parser and use its asynchronous `parse` method to convert a BBCode string to HTML.

const bbcode = require('bbcode'); const bbcodeString = '[b]This is bold text.[/b] [i]This is italic.[/i] [url=https://example.com]Visit Example[/url]'; bbcode.parse(bbcodeString, function(content) { console.log('Parsed BBCode to HTML:'); console.log(content); // Example with a different string bbcode.parse('[color=red]Red text[/color] and [u]underlined[/u].', function(coloredContent) { console.log('\nParsed another string:'); console.log(coloredContent); }); }); console.log('Parsing initiated...');
Debug
Known issues
breakingThe package is severely outdated and abandoned (last published over 12 years ago). It does not support modern JavaScript features, including ECMAScript Modules (ESM), and is not compatible with contemporary Node.js practices without transpilation or CJS-specific tooling.
fix
Consider using modern, actively maintained BBCode parsers such as `@bbob/parser` or `ya-bbcode` for better compatibility, features, and security.
affects: <=0.1.5
gotchaLack of security maintenance. Unmaintained software packages can contain unpatched vulnerabilities, posing a significant security risk to applications that depend on them. While no specific CVEs are listed for this package, the absence of updates is a critical concern.
fix
It is strongly recommended to use a well-maintained and regularly updated BBCode parsing library. If continued use is necessary, conduct a thorough security audit or fork the repository for internal maintenance.
affects: <=0.1.5
gotchaLimited feature set and customizability. The package's low version number and age imply a very basic BBCode parsing capability, likely missing support for many common or complex BBCode tags (e.g., spoiler boxes, font faces mentioned in the old TODO). Custom tag creation might be cumbersome or not fully supported.
fix
Evaluate your BBCode requirements. For richer tag support or extensibility, newer parsers offer more robust and flexible APIs for defining and handling custom BBCode tags.
affects: <=0.1.5
Errors
Common errors & fixes
TypeError: bbcode.parse is not a function
This error occurs if the `require('bbcode')` statement fails to correctly load the module, or if the `bbcode` object does not expose a `parse` method as expected. This could be due to incorrect installation or interference from other modules.
fix
Ensure `npm install bbcode` ran successfully. Verify that `require('bbcode')` is called at the top of your CommonJS file. Check for any global variable conflicts if not using strict module scoping.
SyntaxError: Cannot use import statement outside a module
Attempting to use `import bbcode from 'bbcode';` syntax in a Node.js environment configured for CommonJS, or if the package itself is CJS-only. This package is CJS-only.
fix
Replace `import bbcode from 'bbcode';` with `const bbcode = require('bbcode');` to use the correct CommonJS syntax required by this package.
BBCode tags like [img] or [list] are not parsed correctly or are ignored.
The `bbcode` package is very old (v0.1.5) and has a limited feature set. It likely does not include parsers for many common or advanced BBCode tags found in modern forums and applications.
fix
This package is not suitable for complex BBCode parsing. Consider migrating to a modern, actively maintained BBCode parser like `@bbob/parser` or `ya-bbcode`, which offer broader tag support and extensibility.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
underscorerequiredRuntime utility dependency for internal operations.
Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
bbcode — npm install bbcode · libregistry