@go-bus-stop/common-shake (英语)
见 网络包- 常见震动 页:1 网络软件包 插件 . 见 常态变化 (单位:千美元) 浏览器 插件 .
使用量
const acorn = require('acorn');
const Analyzer = require('@goto-bus-stop/common-shake').Analyzer;
const a = new Analyzer();
a.run(acorn.parse(`
'use strict';
const lib = require('./a.js');
exports.a = lib.a;
`, { locations: true }), 'index.js');
a.run(acorn.parse(`
'use strict';
exports.a = 42;
`, { locations: true }), 'a.js');
a.resolve('index.js', './a.js', 'a.js');
console.log(a.isSuccess(), a.bailouts);
// true false
console.log(a.getModule('index.js').getInfo());
// { bailouts: false, declarations: [ 'a' ], uses: [] }
console.log(a.getModule('a.js').getInfo());
// { bailouts: false, declarations: [ 'a' ], uses: [ 'a' ] }
const module = a.getModule('a.js');
a.getDeclarations().forEach((decl) => {
console.log(module.isUsed(decl.name) ? 'used' : 'not used');
console.log(decl.name, decl.ast);
});
// If you want to mark all exported values of module as used:
a.getModule('root').forceExport();
图维兹
用于调试和检查目的: 点 格式可以是 使用下列 API 生成的模块等级:
const Graph = require('@goto-bus-stop/common-shake').Graph;
const graph = new Graph('/path/to/working/dir');
console.log(graph.generate(analyzer.getModules()));
自由主义
这个软件根据麻省理工学院的许可证获得许可.
2017年,版权由费多尔·Indutny提供.
特此免费准许任何人获得 本软件和相关文档文件的复制件 “软件”,在软件中不受限制地处理,包括 不限制使用、复制、修改、合并、出版、, 软件的分发、分版和/或销售,并允许 提供软件的人 下列条件:
上述版权通知和本许可通知应当包括: 软件的所有副本或大部分.
软件被提供"AS IS", 没有任何恐惧, EXPRESS ,包括但不局限于 紧迫性,特别是目的和非目的的证明。 内 对于任何索赔, 都不得使用任何连锁电话或警察电话, 转让或其他责任,以契约、条约或 产生于、出自或与溶剂有关的 在软件中使用或其他交易.