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

@code-to-json/comments

Package Overview
Dependencies
Maintainers
2
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@code-to-json/comments

Comment-parsing utilities for code-to-json

  • 1.0.0-rc.47
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-88.41%
Maintainers
2
Weekly downloads
 
Created
Source

@code-to-json/comments

Parse JSDoc or TSDoc style comments into structured data

Build Status Build Status Version codecov Total alerts


Usage

First, install this package as a dependency

yarn add @code-to-json/comments

Then, import the parseCommentString function, and pass it stringified code comment

import { parseCommentString } from '@code-to-json/comments';

parseCommentString(`
/**
 * This is only a comment in a file
 *
 * @example
 *
 * function foo() {}
 * foo(); // equal: undefined
 *
 */
`);

which should return a CommentData value like this

{
  "summary": ["This is only a comment in a file"],
  "customTags": [
    {
      "content": ["function foo() {} ", "\n", "foo(); // equal: undefined"],
      "kind": "blockTag",
      "tagName": "example"
    }
  ]
}

© 2018 LinkedIn

FAQs

Package last updated on 16 Apr 2019

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