ts-metadata
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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

Package Sidebar

Install

npm i ts-metadata

Weekly Downloads

1

Version

0.0.3

License

ISC

Unpacked Size

28.9 kB

Total Files

10

Last publish

Collaborators

  • galaa2011