RepositoryTypeScriptNZNew Zealand
adamreisnz

adamreisnz/replace-in-file

A simple utility to quickly replace contents in one or more files

617sao
67fork
2issue
1lượt xem

Thành tựu nổi bật

Những danh hiệu mới nhất của dự án

1
TINIX TRENDING·Quốc gia: NZ

#1 Repository của tháng

1
TINIX TRENDING·Chủ đề: asynchronously

#1 Repository của tháng

1
TINIX TRENDING·Chủ đề: callback

#1 Repository của tháng

🔧 replace-in-file: Thay thế nhanh nội dung trong file với TypeScript

Thay thế văn bản trong một hoặc nhiều file, hỗ trợ đồng bộ, bất đồng bộ, promise, callback, regex và glob — đơn giản và hiệu quả.

replace-in-file là một tiện ích nhỏ bằng TypeScript giúp thay thế nhanhan nội dung trong một hoặc nhiều tệp tin hoặc mẫu glob. Dự án hỗ trợ cả đồng bộ và bất đồng bộ, sử dụng promise hoặc callback. Có thể thực hiện một lần thay thế hoặc nhiều lần thay thế cùng lúc.

✨ Điểm nổi bật

  • Hỗ trợ đồng bộ và bất đồng bộ: Cung cấp hàm replaceInFile (bất đồng bộ) và replaceInFileSync (đồng bộ).
  • Promise và callback: Linh hoạt chọn cách gọi tùy theo nhu cầu.
  • Thay thế nhiều file hoặc glob: Hỗ trợ truyền mảng đường dẫn hoặc mẫu glob để xử lý hàng loạt.
  • Regex tùy biến: Cho phép sử dụng biểu thức chính quy tùy chỉnh cho from.
  • Đếm kết quả: Cờ countMatches giúp đếm số lần khớp và thay thế trong mỗi file.
  • Tùy chọn lưu đến file khác: Có thể lưu kết quả thay thế vào tệp tin khác thay vì ghi đè.
  • Bỏ qua file hoặc glob: Cấu hình để bỏ qua một hoặc nhiều file/glob không cần xử lý.
  • Dry run: Hỗ trợ chế độ thử nghiệm mà không thực sự ghi thay đổi.

💡 Vì sao đáng chú ý

replace-in-file khác biệt từ các công cụ thay thế khác ở sự đơn giản và linh hoạt trong cấu hình. Nó không chỉ là công cụ thay thế văn bản đơn thuần mà còn hỗ trợ rất nhiều tùy chọn nâng cao như xử lý đường dẫn mạng, mã hóa ký tự, hoặc sử dụng bộ xử lý tùy chỉnh. Phù hợp cho các dự án cần tích hợp nhanh chức năng thay thế file trong quy trình build, migration dữ liệu, hoặc tự động hóa cấu hình.


#TypeScript #OpenSource #FileReplacement #Glob #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
RepositoryPython
yt-dlp/yt-dlp

A feature-rich command-line audio/video downloader

212.4k
Dec 2, 2026
RepositoryTypeScript
n8n-io/n8n

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

212.9k
Dec 2, 2026
RepositoryJavaScript
bajankristof/nedb-promises

A dead-simple promise wrapper for nedb.

299
Aug 18, 2026
RepositoryShell
ohmyzsh/ohmyzsh

🙃 A delightful, community-driven framework for managing your zsh configuration. Built by 2,600+ contributors, with hundreds of plugins (git, rails, laravel, node, python, docker, kubectl, aws, and more), themes to spice up your terminal, and automatic updates to keep your command line feeling like home.

191.0k
Nov 29, 2026
RepositoryTypeScript
google-gemini/gemini-cli

An open-source AI agent that brings the power of Gemini directly into your terminal.

109.5k
Dec 2, 2026
RepositoryPython
sherlock-project/sherlock

Hunt down social media accounts by username across social networks

120.3k
Dec 2, 2026
RepositoryPython
Panniantong/Agent-Reach

Give your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.

116.7k
Nov 24, 2026
RepositoryMarkdown
DigitalPlatDev/FreeDomain

Free domain registration and practical DNS learning resources for everyone.

209.9k
Aug 12, 2026