Skip to content

galaa2011/ts-metadata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published