djsdoc
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

djsdoc

Simple JSDoc parser. parses jsdoc string to json.

(You need to pass in the comment, not a whole JavaScript file, you can use jsdoc-regex to matching the JSDoc in a JavaScript file).

Installation

You can install djsdoc using npm:

$ npm install djsdoc --save-dev

Usage

djsdoc(`/**
* djsdoc is a simple JSDoc parser. parses jsdoc string to json.
* @title something
* @subtitle something else
* @date 2018-06-12
* @comments
* 
* @tags 
* a
* b
* 
* c
* @categories d e f
*
* @const @const
* @中文 滑稽
*
*/`)
/*{
  description: 'djsdoc is a simple JSDoc parser. parses jsdoc string to json.',
  tags:
    [{ title: 'title', content: 'something' },
    { title: 'subtitle', content: 'something else' },
    { title: 'date', content: '2018-06-12' },
    { title: 'comments', content: '' },
    { title: 'tags', content: 'a\nb\n\nc' },
    { title: 'categories', content: 'd e f' },
    { title: 'const', content: '@const' },
    { title: '中文', content: '滑稽'}]
}*/

About

Open sourced under the GPL v3.0 license.

Part of the code was modified from doctrine.

Readme

Keywords

none

Package Sidebar

Install

npm i djsdoc

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

114 kB

Total Files

8

Last publish

Collaborators

  • cn_eyhn