JavaScript格式化工具
為壓縮後的JavaScript加入縮排,並在分號和大括號處換行。
如何使用本工具
- 1
Paste or type your JavaScript into the input textarea.
- 2
Watch the indented version appear live in the output box below as you type — there is no Format button.
- 3
Select the formatted text in the output box and copy it with your keyboard (there is no copy button).
- 4
Scan the result for any line that split inside a string, regex, or comment, and fix those by hand if needed.
什麼是JavaScript格式化工具?
壓縮後的程式碼套件會移除所有空白:便於快速分發,卻讓人難以閱讀。這個基礎格式化工具會恢復縮排,並在分號和大括號處斷行。如需保留註解、遵循ASI規則的生產級重新格式化,請使用Prettier或你編輯器內建的格式化工具。
常見使用場景
Eyeballing a minified vendor bundle or one-line snippet to see its rough structure before debugging.
Quickly indenting a short config or object literal you pasted from a chat message or log line.
Spreading a dense JSON-like object across multiple lines so nesting becomes visible.
Teaching or demoing how braces and semicolons map to indentation levels for beginners.
Making a compressed third-party script readable enough to locate a specific function or variable.
Sanity-checking that brackets are balanced, since unbalanced input leaves the indentation visibly skewed.
常見問題
它和Prettier一樣好嗎?▼
相關工具
JWT 解碼器
即時解碼 JSON Web Token(JWT)。完全在你的瀏覽器中執行:權杖絕不會離開你的裝置,可安全用於正式環境的密鑰。
JSON格式化與驗證工具
線上格式化、驗證和壓縮JSON。完全在你的瀏覽器中執行:你的資料永遠不會離開你的裝置。
XML 格式化工具
格式化並美化 XML 文件。適用於 SOAP、網站地圖、RSS 訂閱源和設定檔。
Base64 編碼與解碼工具
將字串編碼為 Base64,或將 Base64 解碼為文字。尊重你的隱私:全部在你的瀏覽器中執行。
URL 編碼與解碼工具
將文字轉換為 URL 安全的編碼(百分號編碼),或進行反向轉換。適用於查詢字串、重新導向和 OAuth 流程。
HTML實體編碼與解碼工具
將特殊字元轉換為HTML實體(&、<等),或進行反向轉換。適用於將文字安全地嵌入HTML。