npm.io
0.1.3 • Published 5 years ago

node-ts-parser

Licence
MIT
Version
0.1.3
Deps
1
Size
7 kB
Vulns
0
Weekly
0

node-ts-parser

用于 node 环境下 转换 typescript 文件 成 js 并且获取其内容

安装

yarn add node-ts-parser

使用

typescript
import { tsParser } from 'node-ts-parser'
const [error, config] = tsParser({ context: __dirname, file: 'path/to/yyl.config.ts' })
js
const { tsParse } = require('node-ts-parser')
const [error, config] = tsParser({ context: __dirname, file: 'path/to/yyl.config.ts' })