A LIGHTWEIGHT VISUAL JSON EDITOR BUILT WITH PURE JAVASCRIPT
Pure JavaScript 函式庫,具備零依賴視覺化樹狀編輯、逐節點動態型別切換與完整生命週期鉤子
目錄
功能特點
npm install @pardnchiu/nanojson· 完整文件
- 零依賴視覺化編輯 — 純 JavaScript 與原生 DOM API 實作樹狀 JSON 編輯器,無需任何前端框架。
- 逐節點動態型別切換 — 每個節點可在 string / number / boolean / object / array / null 間即時切換並重繪。
- 完整生命週期鉤子 — 提供 beforeRender / rendered / beforeUpdate / updated / beforeDestroy / destroyed 六個掛鉤,更新並帶 300ms 防抖。
- 彈性資料匯入匯出 — 支援 JavaScript 物件、File 物件、URL 字串三種資料來源,並可一鍵下載目前 JSON。
架構
graph TB
A[JSON 輸入] --> B[JSONEditor]
B --> C[JSONEditorNode 樹]
C --> D[DOM 渲染函式]
B --> E[Lifecycle 鉤子]
B --> F[匯入 / 匯出]
授權
本專案採用 MIT LICENSE。
Author
邱敬幃 Pardn Chiu
hi@pardn.io
https://www.linkedin.com/in/pardnchiu
https://github.com/pardnchiu
©️ 2025 邱敬幃 Pardn Chiu