npm库-fn-args 发表于 2022-03-10 更新于 2022-10-16fn-args: 获取函数的所有参数名6.0 开始,只能以 ESM 的形式引入5.0 的版本支持 CJSfn-args-exp.js123const jiti = require('jiti')();jiti('./');index.ts12345678910111213141516171819202122232425import fnArgs from 'fn-args';const f1 = function (name, age) {};function f2(a, b, c) {}const f3 = (d, e, f) => {};const f4 = async (g, h) => {};const f5 = function* (i, j) {};console.log(fnArgs(f1));console.log(fnArgs(f2));console.log(fnArgs(f3));console.log(fnArgs(f4));console.log(fnArgs(f5));image(2)