Socket
Socket
Sign inDemoInstall

heading-doc-parser

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    heading-doc-parser

Simple doc parser for heading comment.


Version published
Maintainers
1
Created

Readme

Source

heading-doc-parser

A simple parser for doc generation.

feature

  • Lightweight - less than 2kb before gzip
  • Type Support - friendly with typescript

Install

npm install heading-doc-parser

Usage

simple usage

import parseDoc from 'heading-doc-parser'

const code = `
/**
 * description 
 * @title - 1
 * @desc
 *  hello
 *  world
 */
export function Demo() {
  return <button>demo</button>
}
`
console.log(parseDoc(code))
/*
  {
    description: "description",
    data: {
      title: '1',
      desc: 'hello\nworld',
    }
  }  
*/

Type Support

import parseDoc from 'heading-doc-parser'

const code = `
/**
 * description 
 * @title - 1
 * @desc
 *  hello
 *  world
 */
export function Demo() {
  return <button>demo</button>
}
`

type Key = 'title' | 'desc'
console.log(parseDoc<Key>(code))
/*
  {
    description: "description",
    data: {
      title: '1',
      desc: 'hello\nworld',
    }
  }  
*/

Keywords

FAQs

Last updated on 21 Apr 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc