https://github.com/nodecraft/ya-bbcode
Yet another BBCode Parser
https://github.com/nodecraft/ya-bbcode
bbc bbcode hacktoberfest parser
Last synced: 6 days ago
JSON representation
Yet another BBCode Parser
- Host: GitHub
- URL: https://github.com/nodecraft/ya-bbcode
- Owner: nodecraft
- License: mit
- Created: 2018-03-14T23:40:39.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2025-12-01T22:14:24.000Z (about 2 months ago)
- Last Synced: 2025-12-03T00:56:51.623Z (about 2 months ago)
- Topics: bbc, bbcode, hacktoberfest, parser
- Language: TypeScript
- Homepage:
- Size: 1.43 MB
- Stars: 17
- Watchers: 3
- Forks: 5
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ya-bbcode
Yet another BBCode parser.
`npm install ya-bbcode --save`
[](https://badge.fury.io/js/ya-bbcode)
[](https://github.com/nodecraft/ya-bbcode/actions)
[](https://coveralls.io/github/nodecraft/ya-bbcode)
## Usage
```javascript
const yabbcode = require('ya-bbcode');
const parser = new yabbcode();
const bbc = '[url=https://nodecraft.com]Visit Nodecraft[/url]';
parser.parse(bbc);
// Visit Nodecraft
```
##### Add Custom Tags
```javascript
parser.registerTag('url', {
type: 'replace',
open: (attr) => {
return ``;
},
close: ''
});
// Remove all default or registered tags
parser.clearTags();
```
### Why ya-bbcode?
- **Supports nested BBCode**: Properly handles complex nested structures
- **Zero dependencies**: Lightweight with no external dependencies
- **Correct parsing**: Parent nodes are parsed before children in nested format
- **Customizable**: Easy to add or override tags