MIT License

项目介绍

thx/gogocode 是一个托管在 GitHub 上的开源项目,主要使用 JavaScript 编写,采用 MIT License 许可证,目前获得 6.1k 个 Star、464 次 Fork。

仓库全名
thx/gogocode
开源许可证
MIT License
Star 数
6.1k
Fork 数
464
未关闭 Issue
98

README 摘要

详细文档点击这里 What is GoGoCode? 中文 README GoGoCode is a transformer for JavaScript/Typescript/HTML based on AST but providing an intuitive API: A jQuery-like API to select and transform AST. A Regex-like syntax to match and replace code. Learn more at GoGoCode Document Intro Let's show you how to select and modify code with our API In Transform With GoGoCode Out Related Project Project | Description |…

完整内容见 GitHub 原始 README 或本页 。

常见问题

gogocode 用什么语言开发?

主要使用 JavaScript 编写,采用 MIT License 许可证,目前有 6.1k 个 Star。

gogocode 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 gogocode 的源码?

可以直接克隆仓库:git clone https://github.com/thx/gogocode.git,默认分支为 main;安装与运行步骤见仓库 README。

gogocode 最近还在维护吗?

仓库最近一次更新为 2024年4月11日,当前有 98 个未关闭 Issue;Star 数为 6.1k,可作为社区活跃度的参考。

简要分析

热度分
7066
价值分
3792
活跃状态
活跃

语言占比

HTML
JavaScript
Less
Vue

README

Code transform has never been easier: GoGoCode

npm version license

详细文档点击这里

What is GoGoCode?

中文 README

GoGoCode is a transformer for JavaScript/Typescript/HTML based on AST but providing an intuitive API:

  • A jQuery-like API to select and transform AST.
  • A Regex-like syntax to match and replace code.

Learn more at GoGoCode Document

Intro

Let’s show you how to select and modify code with our API

In

const a = 1;
const b = 2;

Transform With GoGoCode

const $ = require('gogocode');
const script = $(source);
// use $_$ as a wildcard to match AST element at any position you want
const aAssignment = script.find('const a = $_$');
// get matched AST element value
const aValue = aAssignment.match?.[0]?.[0]?.value;
// replace AST as same as replace a string
// but ignore code format (space、indent or linebreak)
script.replace('const b = $_$', `const b = ${aValue}`);
// generate ast to string
const outCode = script.generate();

Out

const a = 1;
const b = 1;
Project Description
gogocode-plugin-vue transform a project from vue2 to vue3
gogocode-plugin-element transform a project from ElementUI to ElementPlus
gogocode-cli command-line tool for gogocode
gogocode-playground test gogocode at browser instantly
gogocode-vscode refactor your project with gogocode in vscode

Support

  • issues
  • Ding Group:34266233
  • QQ Group:735216094

License

MIT

评论

暂无评论