@bigcommerce/stencil-utils

中文文档
6.23.0发布于 2026/04/08BSD-4-ClauseCommonJS构建来源已验证近 30 天下载 1.2万

Utility library used by BigCommerce Stencil Framework themes

原始使用文档
文档目录3 节
  1. Documentation
  2. Getting Started
  3. Installing Stencil Utils on your theme

Stencil Utils

Build Status npm (scoped)

Stencil utils is a utility library that contains the BigCommerce Stencil Events system and other tools that will help and enhance the experience of building a theme with the Stencil framework.

Documentation

https://developer.bigcommerce.com/stencil-docs/adding-event-hooks-to-your-theme/stencil-utils-api-reference

Getting Started

Stencil Utils is written in ES6 and is currently transpiled to ES5 with babel for running client side within browsers. Stencil utils can either be imported to your theme as a module, or included as a standalone script.

Installing Stencil Utils on your theme

As an ES6 module

  • Run npm install @bigcommerce/stencil-utils to install the latest tagged version of stencil-utils for use with your theme.
  • Import the library import utils from 'bigcommerce/stencil-utils'; in modules that depend on it.

Using standalone

If you do not want to support es6 modules, Stencil Utils can be included as a normal script:

  • Copy the bundled script from dist/stencil-utils.min.js to your theme.
  • Include the script in your HTML document
  • Access stencil utils from window.stencilUtils.

Now you are playing with power!

Testing

Just simply run npm run test

License

Copyright (c) 2015-present, BigCommerce Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Bigcommerce Inc.
  4. Neither the name of Bigcommerce Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY BIGCOMMERCE INC ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BIGCOMMERCE INC BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

版本与发布记录

@bigcommerce/stencil-utils 共发布 53 个版本,首次发布于 2016/03/08;过去 12 个月发布了 3 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
6.23.0latest2026/04/087 个月前
6.22.02026/04/077 个月前
6.21.02026/04/017 个月前
6.20.02025/09/101.2 年前
6.19.02024/12/181.9 年前
6.18.02024/10/072 年前

关于 @bigcommerce/stencil-utils 的常见问题

@bigcommerce/stencil-utils 是什么?

Utility library used by BigCommerce Stencil Framework themes

如何安装 @bigcommerce/stencil-utils?

在项目目录运行 npm install @bigcommerce/stencil-utils,或使用 pnpm add / yarn add / bun add。

@bigcommerce/stencil-utils 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/bigcommerce__stencil-utils 是否存在。

@bigcommerce/stencil-utils 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@bigcommerce/stencil-utils 需要什么版本的 Node.js?

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

@bigcommerce/stencil-utils 可以商用吗?

@bigcommerce/stencil-utils 使用 BSD-4-Clause 许可。声明的许可为 BSD-4-Clause,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@bigcommerce/stencil-utils 的下载量有多少?

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

@bigcommerce/stencil-utils 还在维护吗?

最新版本 6.23.0 发布于 2026/04/08(7 个月前);至今共发布 53 个版本,其中过去 12 个月发布了 3 个;首次发布于 2016/03/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。