3.0.1 • Published 3 years ago
@incmix/ts.runtime v3.0.1
ts.runtime
This tool converts TypeScript types into TS Runtime objects.
Usage - via CLI
Install it globally:
npm i ts.runtime -gWe have this file:
// test/test.ts
export type Type = string | 4 | 2 | boolean;To convert the type in the file above, we do this:
ts.runtime test/test.tsThis generates the TS Runtime objects from the types in the file and prints them:
export type Type = string | 4 | 2 | boolean;
export type TsRuntimeObject_Type = {
  type: "union";
  members: [
    { type: "string" },
    { type: "number"; value: 4 },
    { type: "number"; value: 2 },
    { type: "boolean" }
  ];
};Usage - via programmatic interface
You can use ts.runtime in your projects.
npm i ts.runtimeIn our project, we import generateTSRuntimeObjectFromFile from ts.runtime:
import { generateTSRuntimeObjectFromFile } from "ts.runtime";
const tsRuntimeObject = generateTSRuntimeObjectFromFile("test/test.ts");1.2.0
3 years ago
1.1.0
3 years ago
1.9.0
3 years ago
1.8.0
3 years ago
1.6.0
3 years ago
1.4.0
3 years ago
1.3.0
3 years ago
2.3.0
3 years ago
2.2.0
3 years ago
2.0.2
3 years ago
2.5.0
3 years ago
2.4.0
3 years ago
2.5.2
3 years ago
2.5.1
3 years ago
2.5.3
3 years ago
2.1.0
3 years ago
2.0.1
3 years ago
2.0.0
3 years ago
3.0.1
3 years ago
3.0.0
3 years ago
1.0.17
3 years ago
1.0.16
3 years ago
1.0.12
3 years ago
1.0.11
3 years ago
1.0.9
3 years ago
1.0.8
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago