百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

Civet

> 编程语言
开源

一个 TypeScript 子集,支持更多类型并减少输入

2.0K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个 TypeScript 子集,支持更多类型并减少输入

猫鼬

写 TypeScript 的现代方法。

  • 文档
  • 变更记录
  • 设计理念
  • 猪猪乐园
  • Civet VSCode 扩展
  • Discord 服务器
  • 适用于 Vite、esbuild、Astro、Farm、Rolldown、Rollup、Webpack ESM/CJS 加载器, Babel, Jest, Gulp, Bun,
  • Solid (旧版) 和 Solid Start 的启动模板 快速入门指南

bash
# Install
npm install -g @danielx/civet
# Run Civet code directly in a REPL
civet
# Transpile typed Civet code into TypeScript in a REPL
civet -c
# Compile Civet source file to TypeScript
civet < source.civet > output.ts
# Execute a .civet script
civet source.civet ...args...
# Execute a .civet source file in node
node --import @danielx/civet/register source.civet
# Type check entire project, which requires TypeScript installed
npm install -g typescript
civet --typecheck

代码示例

typescript
ts, {CompilerOptions} from typescript

DefaultCompilerOptions : CompilerOptions :=
  allowNonTsExtensions: true
  allowJs: true
  target: ts.ScriptTarget.Latest
  moduleResolution: ts.ModuleResolutionKind.NodeJs
  module: ts.ModuleKind.CommonJS
  allowSyntheticDefaultImports: true
  experimentalDecorators: true

fileCache : Record<string, any> := {}

createCompilerHost := (options: CompilerOptions, moduleSearchLocations : string[]) ->
  fileExists := (fileName: string) : boolean ->
    fileCache[fileName]?

  readFile := (fileName: string) ->
    fileCache[fileName]

概述

Civet 本质上是 TypeScript 的一种高级版,具有更好的口感。

<script> tag

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ccoffeescriptjavascripttypescript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言