Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ya-bbcode

Package Overview
Dependencies
Maintainers
4
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ya-bbcode

Yet another BBCode Parser

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
242
decreased by-23.9%
Maintainers
4
Weekly downloads
 
Created
Source

ya-bbcode

Yet another BBCode parser. npm install ya-bbcode --save

npm version Actions Status Coverage Status

Usage

const yabbcode = require('ya-bbcode');
const parser = new yabbcode();

const bbc = '[url=https://nodecraft.com]Visit Nodecraft[/url]';
parser.parse(bbc);
// <a href="https://nodecraft.com">Visit Nodecraft</a>
Add Custom Tags
parser.registerTag('url', {
	type: 'replace',
	open: (attr) => {
		return `<a href="${attr || '#'}" rel="noopener norefer">`;
	},
	close: '</a>'
});

// Remove all default or registered tags
parser.clearTags();

Why another BBCode Parser?

  • Supports nested BBCode
  • Has no dependencies
  • All BBCode is replaced in a nested format, meaning that parent nodes are parsed before children.
  • Allows custom tags to be replaced or added.
Roadmap
  • Performance improvements
  • Clean code up for improved readability
  • Improve docs

Keywords

FAQs

Package last updated on 02 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc