npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pardnchiu/nanojson

v1.2.0

Published

A lightweight JSON editor built with pure JavaScript and native APIs. It features visual editing, dynamic type switching, and file import/export capabilities. Suitable for website embedding and JSON data editing.

Downloads

1,581

Readme

[!NOTE] 此 README 由 SKILL 生成,英文版請參閱 這裡

NanoJSON

npm downloads license version

以純 JavaScript 和原生 DOM API 打造的輕量 JSON 視覺編輯器,無需任何第三方依賴即可嵌入任何網頁。

目錄

功能特點

npm i @pardnchiu/nanojson · 完整文件

零依賴嵌入式設計

NanoJSON 完全基於原生瀏覽器 API 構建,無任何執行期依賴。透過 id 設定即可掛載至頁面上任意已存在的 DOM 元素,CSS 樣式也以動態載入方式注入,整合流程僅需一個 script 標籤或一行 npm 安裝指令。

動態型別切換與結構化視覺編輯

每個節點均支援在 string、number、boolean、array、object 五種型別之間即時切換,切換過程中保留既有資料結構。樹狀介面以可折疊的巢狀方式呈現層級 JSON,初始展開狀態(collapsed)與移除確認行為(confirmKeyRemove)皆可透過設定靈活控制。

完整生命週期控制與彈性資料匯入

提供 beforeRender、rendered、beforeUpdate、updated、beforeDestroy、destroyed 六個生命週期鉤子,各事件均支援回傳 false 取消操作,更新事件並附有 300ms Debounce 機制以避免頻繁觸發。import() 方法接受物件、File 物件、URL 字串三種格式,export() 則一鍵下載格式化 JSON 檔案。

架構

graph LR
    U[Developer] -->|config| JE[JSONEditor]
    JE -->|jsonToChildren| JEN[JSONEditorNode]
    JEN -->|nested| JEN
    JE -->|hooks| LC[Lifecycle]
    LC -->|debounce 300ms| U

檔案結構

NanoJSON/
├── dist/
│   ├── NanoJSON.js           # UMD 壓縮版本
│   ├── NanoJSON.esm.js       # ES Module 版本
│   ├── NanoJSON.debug.js     # 除錯用未壓縮版本
│   └── NanoJSON.css          # 樣式表
├── src/
│   ├── model/
│   │   ├── JSONEditor.js     # 主要編輯器類別
│   │   ├── JSONEditorNode.js # 節點模型類別
│   │   └── Lifecycle.js      # 生命週期管理
│   └── function/             # DOM 工具與元件函式
├── page/
│   └── live.html             # 線上展示頁面
└── package.json

授權

本專案採用 MIT LICENSE

Author

Stars

Star


©️ 2025 邱敬幃 Pardn Chiu