Socket
Socket
Sign inDemoInstall

tagged-comment-parser

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tagged-comment-parser

This is a simple parser for tagged comments.


Version published
Weekly downloads
25K
decreased by-2.14%
Maintainers
1
Weekly downloads
 
Created
Source

tagged-comment-parser

This is a simple parser for tagged comments.

import { parse, tryParse } from "tagged-comment-parser";

const result = parse("@cached @alias:foo this comment is tagged!");
/*
result:
{
  "comment": "this comment is tagged!",
  "tags": {
    "cached": true,
    "alias": "foo"
  }
}
*/

// If you want to avoid exceptions, use tryParse
const result = tryParse(null);
/*
result:
{
  "comment": undefined,
  "tags": {}
}
*/

The tags can appear as the first xor last part of the string.

Syntax

  • '@tag' (no value specified): tag will have a value of true
  • '@tag:something' (value after colon): tag will be the string 'something'
  • '@tag(12, "some string")' (parentheses with multiple values): tag will be the array ["12", "some string"]

FAQs

Package last updated on 12 Jun 2024

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