# @bigbinary/neeto-commons-frontend 中文文档

规范地址：https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/

版本：4\.16\.0
npm 元数据更新时间：2026-11-07T05:59:53.572Z
中文译文更新时间：2026-11-08T01:53:25.274Z
软件包许可：Apache-2\.0

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40bigbinary/neeto-commons-frontend
原文对照：https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/?lang=original
源码仓库：https://github.com/bigbinary/neeto-commons-frontend

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：6.5 MB，1471 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- Node.js 要求：\>=22\.13
- 运行依赖：0 个
- peer 依赖：qs 6\.16\.1，yup 0\.32\.11，antd 5\.22\.1，sass 1\.62\.0，util ^0\.12\.5，uuid 13\.0\.1，vite ^8\.0\.0，axios 1\.20\.0，dayjs 1\.11\.13，husky 7\.0\.4，ramda 0\.29\.1，react 18\.3\.1，formik 2\.4\.6，esbuild 0\.28\.1，i18next 22\.5\.1，webpack ^5\.75\.0，zustand 4\.4\.2，dompurify ^3\.2\.4，js-logger 1\.6\.1，linkifyjs 4\.3\.2，react-dom 18\.3\.1，shakapacker ^6\.5\.5，tailwindcss 4\.1\.11，@svgr/rollup 8\.1\.0，autoprefixer 10\.4\.20，react-helmet ^6\.1\.0，ua-parser-js ^2\.0\.10，esbuild-rails ^1\.0\.7，framer-motion 11\.11\.11，linkify-react 4\.3\.2，react-i18next 12\.3\.1，@tippyjs/react 4\.2\.6，dotenv-webpack ^8\.0\.1，react-colorful 5\.6\.1，react-toastify 8\.0\.2，@faker-js/faker 10\.6\.0，avvvatars-react 0\.4\.2，react-resizable 3\.0\.5，enhanced-resolve ^5\.18\.1，react-router-dom 5\.3\.3，@bigbinary/neetoui 8\.8\.3，@honeybadger-io/js 6\.10\.1，@rails/actioncable 7\.2\.100，esbuild-plugin-svgr ^3\.1\.0，esbuild-sass-plugin ^3\.3\.1，react-drag-listview 2\.0\.0，@tailwindcss/postcss ^4\.1\.18，@vitejs/plugin-react ^5\.2\.0，@bigbinary/neeto-cist 1\.0\.17，@honeybadger-io/react 6\.1\.25，@tanstack/react-query 5\.59\.20，@bigbinary/neeto-atoms 1\.0\.101，@bigbinary/neeto-icons 1\.20\.89，@bigbinary/neeto-hotkeys 1\.0\.9，@bigbinary/neeto-molecules 5\.11\.2，@bigbinary/neeto-time-zones 0\.8\.26，@bigbinary/babel-preset-neeto 1\.0\.14，@bigbinary/eslint-plugin-neeto 1\.9\.1，@tailwindcss/container-queries ^0\.1\.1，@tanstack/react-query-devtools 5\.59\.20，@bigbinary/neeto-editor-frontend 2\.0\.1，@bigbinary/neeto-commons-frontend 4\.13\.148，esbuild-plugins-node-modules-polyfill ^1\.6\.8
- 首次发布：2022-07-20T09:57:55.681Z
- 最新版本发布：2026-11-07T05:59:53.381Z
- 近 30 天下载量：126698（2026-10-08 至 2026-11-06，npm 官方下载统计）
- 已发布版本数：543（近 12 个月 120 个）

## 中文简介

一个包封装了所有neto项目的通用代码,包括初始化器,公用功能,通用组件和钩子等.

## 安装

```sh
npm install @bigbinary/neeto-commons-frontend
```

也可以使用：`pnpm add @bigbinary/neeto-commons-frontend`、`yarn add @bigbinary/neeto-commons-frontend`、`bun add @bigbinary/neeto-commons-frontend`

## README

# 需要使用常用前端

用于包装所有 neto 所需的普通锅炉板前端代码的库 产品.

| 
类别

 | 

名称

 |
| --- | --- |
| 

初始化剂 [↗](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/initializers/README.md)

 | 

-   [设置轴线](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/initializers/axios.md)
-   [设置全局方案](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/initializers/globalProps.md)
-   [设置翻译](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/initializers/translation.md)
-   [设置日志](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/initializers/logger.md)
-   [生产中禁用反应开发工具](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/initializers/reactDevTools.md)

 |

| 

反应公用事业 [↗](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/README.md)

 | 

-   [调试](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useDebounce.md)
-   [调试](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useFuncDebounce.md)
-   [上一个](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/usePrevious.md)
-   [使用预览](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/usePrefetch.md)
-   [使用更新效果](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useUpdateEffect.md)
-   [使用本地服务器](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useLocalStorage.md)
-   [使用 Click 外部](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useOnClickOutside.md)
-   [使用字段投递](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useFieldSubmit.md)
-   [使用键盘ShortcutsPane State](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useKeyboardShortcutsPaneState.md)
-   [使用 Display 错误页面](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useDisplayErrorPage.md)
-   [使用 ErrorDisplay 系统](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useDisplayErrorPage.md#useerrordisplaystore-source-code)
-   [使用计时器](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useTimer.md)
-   [使用注册标记检查点](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useRegisterNavigationCheckpoint.md)
-   [使用导航检查点](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useNavigationCheckpoints.md)
-   [使用Restore 滚动](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/reaact/hooks/useRestoreScrollPosition.md)
-   [使用 Remove Navigation 检查点](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useRemoveNavigationCheckpoint.md)
-   [组合 具有有效性](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useMutationWithInvalidation.md)
-   [使用 FetchNeeto 应用程序](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useFetchNeetoApps.md)
-   [使用已存在的查询](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/usePersistedQuery.md)
-   [使用率减少运动](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/usePrefersReducedMotion.md)
-   [使用元素可见inDom](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useIsElementVisibleInDom.md)
-   [独立状态](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useStateWithDependency.md)
-   [使用查询](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useQueryParams.md)
-   [使用断点](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useBreakpoints.md)
-   [使用 Column 配置](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/hooks/useColumnConfig.md)
-   [二等兵鲁特](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/components/PrivateRoute.md)
-   [应用程序](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/components/AppContainer.md)
-   [查询客户端](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/components/QueryClientProvider.md)
-   [蜜蜂斑点错误](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/components/HoneybadgerErrorBoundary.md)
-   [不可移动的行动](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/utils/withImmutableActions.md)
-   [标题](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/utils/withTitle.md)
-   [注册浏览器](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/utils/registerBrowserNotifications.md)
-   [销毁浏览器订阅](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/utils/destroyBrowserSubscription.md)
-   [控点( M)](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/utils/handleMetaClick.md)
-   [是 MetaKey 预览](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/utils/isMetaKeyPressed.md)
-   [带T](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/utils/withT.md)
-   [懒于重试](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/utils/lazyWithRetry.md)

 |

| 

纯公用功能 [↗](https://github.com/bigbinary/neeto-cist)

 | 

移动到 [@ bigbinary/ neto- cist](https://github.com/bigbinary/neeto-cist)

 |

| 

Web 实用功能 [↗](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/README.md)

 | 

-   [以Event目标值](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/withEventTargetValue.md)
-   [获取子域](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/getSubdomain.md)
-   [模拟呼叫](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/simulateApiCall.md)
-   [复制到剪贴板](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/copyToClipboard.md)
-   [构建Url](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/buildUrl.md)
-   [日期格式](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/dateFormat.md)
-   [日数](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/dayjs.md)
-   [改为当地](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/toLocale.md)
-   [获取查询](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/getQueryParams.md)
-   [加入 HyphenCase 语句](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/joinHyphenCase.md)
-   [连字符化](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/hyphenize.md)
-   [弹跳](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/debounce.md)
-   [有许可](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/hasPermission.md)
-   [任何许可](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/hasAnyPermission.md)
-   [已全部许可](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/hasAllPermissions.md)
-   [创建订阅](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/createSubscription.md)
-   [从本地仓库获取](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/getFromLocalStorage.md)
-   [设置为本地集](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/setToLocalStorage.md)
-   [从本地仓库删除](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/removeFromLocalStorage.md)
-   [货币格式](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/currencyFormat.md)
-   [显示 Thumbs Uptoast](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/showThumbsUpToastr.md)
-   [抓取分析事件](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/captureAnalyticsEvent.md)
-   [抓取分析 PageView](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/captureAnalyticsPageView.md)
-   [新建属性](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/buildNestedAttributesPayload.md)
-   [装入 GoogleFonts](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/loadGoogleFonts.md)

 |

## 安装指令

从 npm 安装 :

```bash
yarn add "@bigbinary/neeto-commons-frontend@latest"
```

这个软件包依赖于主机项目的尾风配置. 所以加点 需要您工程的后风前端 。 config.js 文件 :

```js
module.exports = {
  purge: {
    content: [
      // ... other content directories
      "./node_modules/@bigbinary/neeto-commons-frontend/**/*.js",
    ],
  },
  // ... other tailwind config options
};
```

## 使用量

此套件会输出五套不同的功能和组件. 点击 更多信息:

1.  [初始化剂](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/initializers/README.md)
2.  [反应公用事业](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/react/README.md)
3.  [Web 实用功能](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/utils/README.md)
4.  [默认配置](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/configs/README.md)
5.  [常见常数](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/constants#common-constants)

## 其他参考资料

-   [发展指示](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/general/development-instructions.md)
-   [建造和释放](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/general/building-and-releasing.md)
-   [从 v1 移到 v2](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/general/migrating-from-1-to-2.md)
-   [API 文献后勤](https://npmcn.com/package/%40bigbinary/neeto-commons-frontend/docs/general/api-documentation-logistics.md)

## 使用雅尔克进行测试

我们的构建文件都在 `dist` 文件夹,所以当您发布时确保通过 迪尔.

```bash
yalc publish dist
```

## 常见问题

### @bigbinary/neeto-commons-frontend 是什么？

一个包封装了所有neto项目的通用代码,包括初始化器,公用功能,通用组件和钩子等\.

### 如何安装 @bigbinary/neeto-commons-frontend？

在项目目录运行 npm install @bigbinary/neeto-commons-frontend，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：qs（6\.16\.1）、yup（0\.32\.11）、antd（5\.22\.1）、sass（1\.62\.0）、util（^0\.12\.5）、uuid（13\.0\.1）、vite（^8\.0\.0）、axios（1\.20\.0）、dayjs（1\.11\.13）、husky（7\.0\.4）、ramda（0\.29\.1）、react（18\.3\.1）、formik（2\.4\.6）、esbuild（0\.28\.1）、i18next（22\.5\.1）、webpack（^5\.75\.0）、zustand（4\.4\.2）、dompurify（^3\.2\.4）、js-logger（1\.6\.1）、linkifyjs（4\.3\.2）、react-dom（18\.3\.1）、shakapacker（^6\.5\.5）、tailwindcss（4\.1\.11）、@svgr/rollup（8\.1\.0）、autoprefixer（10\.4\.20）、react-helmet（^6\.1\.0）、ua-parser-js（^2\.0\.10）、esbuild-rails（^1\.0\.7）、framer-motion（11\.11\.11）、linkify-react（4\.3\.2）、react-i18next（12\.3\.1）、@tippyjs/react（4\.2\.6）、dotenv-webpack（^8\.0\.1）、react-colorful（5\.6\.1）、react-toastify（8\.0\.2）、@faker-js/faker（10\.6\.0）、avvvatars-react（0\.4\.2）、react-resizable（3\.0\.5）、enhanced-resolve（^5\.18\.1）、react-router-dom（5\.3\.3）、@bigbinary/neetoui（8\.8\.3）、@honeybadger-io/js（6\.10\.1）、@rails/actioncable（7\.2\.100）、esbuild-plugin-svgr（^3\.1\.0）、esbuild-sass-plugin（^3\.3\.1）、react-drag-listview（2\.0\.0）、@tailwindcss/postcss（^4\.1\.18）、@vitejs/plugin-react（^5\.2\.0）、@bigbinary/neeto-cist（1\.0\.17）、@honeybadger-io/react（6\.1\.25）、@tanstack/react-query（5\.59\.20）、@bigbinary/neeto-atoms（1\.0\.101）、@bigbinary/neeto-icons（1\.20\.89）、@bigbinary/neeto-hotkeys（1\.0\.9）、@bigbinary/neeto-molecules（5\.11\.2）、@bigbinary/neeto-time-zones（0\.8\.26）、@bigbinary/babel-preset-neeto（1\.0\.14）、@bigbinary/eslint-plugin-neeto（1\.9\.1）、@tailwindcss/container-queries（^0\.1\.1）、@tanstack/react-query-devtools（5\.59\.20）、@bigbinary/neeto-editor-frontend（2\.0\.1）、@bigbinary/neeto-commons-frontend（4\.13\.148）、esbuild-plugins-node-modules-polyfill（^1\.6\.8）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。它还提供命令行工具 dead-code-eliminator、remove-unused-translation-keys，可以用 npx dead-code-eliminator 直接运行。

### @bigbinary/neeto-commons-frontend 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @bigbinary/neeto-commons-frontend 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @bigbinary/neeto-commons-frontend 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=22\.13。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @bigbinary/neeto-commons-frontend 可以商用吗？

@bigbinary/neeto-commons-frontend 使用 Apache-2\.0 许可。宽松许可：允许商业使用、修改和再分发，并附带明确的专利授权；分发时需保留许可与 NOTICE 文件，修改过的文件要注明改动。以上为概括，不构成法律意见，请以许可原文为准。

### @bigbinary/neeto-commons-frontend 的下载量有多少？

根据 npm 官方下载统计，@bigbinary/neeto-commons-frontend 在 2026/10/08 – 2026/11/06 这 30 天内被下载 126,698 次，日均约 4,223 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @bigbinary/neeto-commons-frontend 还在维护吗？

最新版本 4\.16\.0 发布于 2026/11/07（1 天前）；至今共发布 543 个版本，其中过去 12 个月发布了 120 个；首次发布于 2022/07/20。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

