JavaScript Minifier
Compact JavaScript by stripping comments and collapsing safe whitespace — with strings, template literals, and regex literals preserved exactly. Runs in your browser, no upload.
ملخص الأداة
تستقبل هذه الأداة مدخلات منظمة وتُرجع مخرجات حتمية في المتصفح، دون رفع إلى الخادم.
- اسم الأداة
- JavaScript Minifier
- غرض المدخلات
- قدّم المحتوى المصدري لتحويله أو التحقق منه أو تحليله.
- غرض المخرجات
- احصل على مخرجات موحدة جاهزة للنسخ أو إعادة الاستخدام أو التصحيح.
- مدخل مثال
- // say hi function hi(name) { return `Hello, ${name}!`; }
- مخرج مثال
- function hi(name){return `Hello, ${name}!`;}
مقدمة الأداة
Compact JavaScript by stripping comments and collapsing safe whitespace — with strings, template literals, and regex literals preserved exactly. Runs in your browser, no upload.
نظرة عامة على الأداة
This is a lightweight, conservative JavaScript minifier. It walks your source one token at a time, leaving every string, template literal, and regular expression untouched while removing line and block comments and shrinking runs of whitespace where it is safe to do so. It does not rename identifiers, shorten property accesses, or perform tree-shaking — for that you want a full bundler. What it does well is compressing snippets, examples, inline scripts, and configuration code without changing their behavior.
حالات الاستخدام
- Inline a small snippet into HTML where every byte matters.
- Quickly minify a code sample for a documentation page or blog post.
- Pre-process configuration scripts before piping them into a CMS field.
أمثلة المدخلات/المخرجات
// say hi
function hi(name) {
return `Hello, ${name}!`;
}function hi(name){return `Hello, ${name}!`;}الأسئلة الشائعة
Does it rename variables (mangle)?+
Will it break template literals or regex?+
Is automatic semicolon insertion (ASI) handled?+
استكشف أدوات أخرى
اكتشف أدوات ذات صلة في الفئة المطورون أدناه.
أدوات ذات صلة
أدوات منتقاة قد تجدها مفيدة