Skip to content

Monitor the interface definition of ts and generate JSON schema synchronously once there is any modification

Notifications You must be signed in to change notification settings

MMF-FE/ts-jsonschema-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Apr 3, 2023
ba8c9dc · Apr 3, 2023

History

2 Commits
Apr 1, 2023
Apr 3, 2023
Apr 3, 2023
Apr 1, 2023
Apr 1, 2023
Apr 1, 2023
Apr 1, 2023
Apr 1, 2023
Apr 1, 2023

Repository files navigation

ts-jsonschema-sync

监测 ts 的 interface 定义,一有改动,同步生成 json schema。

Monitor the interface definition of ts and generate JSON schema synchronously once there is any modification.

install

yarn add @yzfe/ts-jsonschema-sync

use

import { getTypeNames, getSchemaObject } from '@yzfe/ts-jsonschema-sync'
import * as path from 'path'

const rootPath = path.join(__dirname, 'typings')

const types = getTypeNames({
    rootPath
})

console.log(types)

console.log(JSON.stringify(getSchemaObject(types[0], {
    rootPath
}), null, 2))

About

Monitor the interface definition of ts and generate JSON schema synchronously once there is any modification

Resources

Stars

Watchers

Forks

Packages

No packages published