{"id":12881,"library":"bbcode","title":"BBCode Parser for Node.js","description":"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.","status":"abandoned","version":"0.1.5","language":"javascript","source_language":"en","source_url":"http://github.com/ncb000gt/node-bbcode","tags":["javascript"],"install":[{"cmd":"npm install bbcode","lang":"bash","label":"npm"},{"cmd":"yarn add bbcode","lang":"bash","label":"yarn"},{"cmd":"pnpm add bbcode","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime utility dependency for internal operations.","package":"underscore","optional":false}],"imports":[{"note":"This package is CommonJS-only, reflecting its age. ESM import syntax is not supported and will result in errors.","wrong":"import bbcode from 'bbcode';","symbol":"bbcode","correct":"const bbcode = require('bbcode');"},{"note":"The `parse` method is accessed directly from the default CommonJS export, not as a named export.","wrong":"import { parse } from 'bbcode';","symbol":"parse","correct":"bbcode.parse('[b]hello[/b]', callback);"}],"quickstart":{"code":"const bbcode = require('bbcode');\n\nconst bbcodeString = '[b]This is bold text.[/b] [i]This is italic.[/i] [url=https://example.com]Visit Example[/url]';\n\nbbcode.parse(bbcodeString, function(content) {\n  console.log('Parsed BBCode to HTML:');\n  console.log(content);\n\n  // Example with a different string\n  bbcode.parse('[color=red]Red text[/color] and [u]underlined[/u].', function(coloredContent) {\n    console.log('\\nParsed another string:');\n    console.log(coloredContent);\n  });\n});\n\nconsole.log('Parsing initiated...');\n","lang":"javascript","description":"Demonstrates how to import the `bbcode` parser and use its asynchronous `parse` method to convert a BBCode string to HTML."},"warnings":[{"fix":"Consider using modern, actively maintained BBCode parsers such as `@bbob/parser` or `ya-bbcode` for better compatibility, features, and security.","message":"The 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.","severity":"breaking","affected_versions":"<=0.1.5"},{"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.","message":"Lack 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.","severity":"gotcha","affected_versions":"<=0.1.5"},{"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.","message":"Limited 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.","severity":"gotcha","affected_versions":"<=0.1.5"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"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.","cause":"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.","error":"TypeError: bbcode.parse is not a function"},{"fix":"Replace `import bbcode from 'bbcode';` with `const bbcode = require('bbcode');` to use the correct CommonJS syntax required by this package.","cause":"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.","error":"SyntaxError: Cannot use import statement outside a module"},{"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.","cause":"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.","error":"BBCode tags like [img] or [list] are not parsed correctly or are ignored."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null}