{"library":"shortcode-parser","title":"Shortcode Parser","description":"This library, `shortcode-parser`, provides functionality for parsing shortcodes in JavaScript, supporting both self-closing and enclosing shortcodes, attributes, and automatic typecasting. Key features include attribute handling and a clean, linted JavaScript source with unit tests. Its last known release, version `0.0.1`, was published in October 2013. The package explicitly targets Node.js versions `0.10.x`, which reached its End-of-Life in October 2016. Due to its age and reliance on an unsupported Node.js runtime, this package is effectively abandoned. There is no active development or maintenance, and no clear release cadence. Developers seeking similar functionality in modern JavaScript environments should consider actively maintained alternatives like `shortcode-insert`, `universal-shortcodes`, or `@hewes/shortcode`.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install shortcode-parser"],"cli":null},"imports":["const shortcode = require('shortcode-parser');","shortcode.add('bold', function(buf, opts) { /* ... */ });","shortcode.parse(str, data, context);"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const shortcode = require('shortcode-parser');\n\n// Add a handler for the 'bold' shortcode\nshortcode.add('bold', function(buf, opts) {\n  let content = buf;\n  if (opts.upper) {\n    content = buf.toUpperCase();\n  }\n  return `<strong>${content}</strong>`;\n});\n\n// Define a shortcode handler (e.g., for markdown, though 'marked' isn't a direct dependency)\n// For demonstration, we'll just wrap it.\nconst myCustomShortcodeHandlers = {\n  markdown: function(buf, opts) {\n    // In a real app, you might use a library like 'marked' here:\n    // return require('marked')(buf, opts);\n    return `<div>--- Markdown Content ---\\n${buf}\\n--- End Markdown Content ---</div>`;\n  }\n};\n\n// String containing shortcodes\nconst str = \"This is [bold upper=true]Bold Text[/bold]!!! Also, some [markdown]## Hello World\\nThis is a markdown test.[/markdown]\";\n\n// Parse the string with registered shortcodes\nconst output = shortcode.parse(str);\nconsole.log('Output with registered handlers:\\n', output);\n\n// Parse with custom handlers provided via context\nconst outputWithContext = shortcode.parse(str, {}, myCustomShortcodeHandlers);\nconsole.log('\\nOutput with context handlers:\\n', outputWithContext);","lang":"javascript","description":"Demonstrates how to install, require, add custom shortcode handlers, and parse strings containing both registered and context-specific shortcodes.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}