Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 575 Bytes

README.md

File metadata and controls

34 lines (25 loc) · 575 Bytes

ts-metadata

typescript 元数据操作, 提取/删除

Install

npm install --save ts-metadata

Usage

import ts from "typescript";
import Compiler from "ts-metadata";

const compiler = new Compiler({
  enableLog: true,
  rootNames: ['xxx.ts'],
  options: {
    target: ts.ScriptTarget.Latest,
    module: ts.ModuleKind.CommonJS,
  },
});

compiler.getMetadataByDecorator({
  classDecorators: ["Component", "InputType", "Props"],
  propsDecorators: ["Design", "Foo"],
});

License

MIT © galaa2011