【文件属性】:
文件名称:jsdast:JSDoc抽象语法树
文件大小:90KB
文件格式:ZIP
更新时间:2021-05-09 02:23:02
JavaScript
jsdast
基于Unist规范的语法树JSDoc
安装
$ npm install @geut/jsdast
用法
const unified = require ( 'unified' )
const { parser } = require ( '@geut/jsdast' )
const tree = unified ( ) . use ( parser ) . parse ( `
/**
* @param {number} a
* @param {number} b
* @returns {number}
*/
function sum(a, b) {
return a + b
}
` )
console . log ( JSON . stringify ( tree , null , 2 ) )
/*
{
"type": "Ro
【文件预览】:
jsdast-main
----.gitignore(923B)
----package.json(1KB)
----package-lock.json(287KB)
----src()
--------module-reader.js(5KB)
--------type-definition-parser.js(10KB)
--------index.js(477B)
--------tsmorph-utils.js(4KB)
----.travis.yml(47B)
----CONTRIBUTING.md(2KB)
----LICENSE(1KB)
----CHANGELOG.md(591B)
----README.md(4KB)
----tests()
--------index.test.js(2KB)
--------example()
--------__snapshots__()
----.editorconfig(147B)