code-context:从一串javascript解析上下文,以根据其代码确定函数,变量和注释的上下文

时间:2021-05-18 14:58:32
【文件属性】:
文件名称:code-context:从一串javascript解析上下文,以根据其代码确定函数,变量和注释的上下文
文件大小:29KB
文件格式:ZIP
更新时间:2021-05-18 14:58:32
JavaScript 代码上下文 解析一串javascript,根据随后的代码确定函数,变量和注释的上下文。 目前支持: 代码注释 功能陈述 函数表达式 原型方法 原型属性 方法 特性 报关单 安装 用安装 $ npm i code-context --save 用法 var parseContext = require ( 'code-context' ) ; 在my-app.js给出以下代码: /** * My app */ var app = function ( str ) { return str } ; 将my-app.js作为字符串传递: var str = fs . readFileSync ( 'my-app.js' , 'utf8' ) ; var context = parseContext ( str ) ; 结果是: [ { type : 'com
【文件预览】:
code-context-master
----.gitignore(518B)
----README.md(2KB)
----.verb.md(1KB)
----example.js(267B)
----test()
--------fixtures()
--------params.js(1KB)
--------actual()
--------callback.js(1KB)
--------helpers()
--------context.js(3KB)
----LICENSE(1KB)
----.gitattributes(127B)
----.jshintrc(281B)
----package.json(1KB)
----index.js(684B)
----.travis.yml(89B)
----.editorconfig(424B)

网友评论