@gondel/core

中文文档
1.2.10发布于 2026/10/29MITTypeScriptESM + CJS零依赖近 30 天下载 3488

The base core of the gondel library

原始使用文档
文档目录8 节
  1. Installation
  2. Hello World
  3. Module format
  4. Plugins
  5. Playground
  6. Examples
  7. Contributing to Gondel
  8. License

NPM version Build Status Size License Commitizen friendly Prettier

🚡 Gondel

Gondel is a tiny (3kb) non-intrusive library to help you modularize your code.
It does not ship with a rendering engine to be a perfect fit for most client side rendering engines (e.g. React or Angular) and server side rendering engines (e.g. Java or PHP)

Installation

npm i @gondel/core

Hello World

This button will listen to all click events events coming from all elements with data-g-name="Button" and will show an alert message.

HTML

 <button data-g-name="Button">Click me</button>

 <button data-g-name="Button">Or click me</button>

JS

import {Component, EventListener, GondelBaseComponent} from '@gondel/core';

// The @Component decorator will connect the class with `data-g-name="Button"` elements.
@Component('Button')
export class Button extends GondelBaseComponent {
  @EventListener('click') 
  _handleChange(event) {
    alert('Hello World')
  }
}

Hello World Example

Module format

Gondel follows the rollup recommendations which includes on the one hand ESM for bundle size optimisations and on the other hand a UMD version to be compatible with every former javascript bundling/concatenation strategy.

Gondel is fully typed and exports optional typescript declaration files for typescript projects.

Plugins

  • Data Plugin - Provide auto binding of data attributes - Demo
  • Hot Plugin - Adds support for hot-module-reloading (hmr) for Gondel components. - Demo
  • jQuery Plugin - Adds support for easy access to the current ctx as jQuery collection.
  • Media Queries Plugin - Provide a custom gondel event which will fire once a given media query is met - Demo
  • React Plugin - Adds support to bootstrap React widgets and apps using Gondel and vice versa - Demo
  • Resize Plugin - Provides an event when the window or the component resized - Demo

Playground

https://codesandbox.io/s/github/merkle-open/gondel/tree/master/examples/hello-world

Examples

Contributing to Gondel

All contributions are welcome: use-cases, documentation, code, patches, bug reports, feature requests, etc.
The following commands will get you started to work locally:

npm install
npm run build

Running tests:

npm run test:watch

Thanks to all who have contributed (emoji key) so far:


Jan Nicklas

💻 📖 🐛 💡 🚇 🔌 ⚠️ 👀

Ernst Ammann

💻 📖 🚇 📦 👀

Dušan Perković

💻 📖 🔌 🤔 ⚠️

Jan R. Biasi

💻 📖 🤔 ⚠️ 👀

Jan Widmer

💻 📖 💡 🤔 🔌

Claudio Bianucci

💻 🤔

License

MIT license

版本与发布记录

@gondel/core 共发布 21 个版本,首次发布于 2018/05/09;过去 12 个月发布了 1 个版本。

版本发布日期距今
1.2.10latest2026/10/2918 天前
1.2.92025/10/081.1 年前
1.2.82023/05/203 年前
1.2.72021/05/065 年前
1.2.7-beta.0test2021/05/065 年前
1.2.62020/11/175 年前

其他发布通道:next → 1.0.0-alpha.29,test → 1.2.7-beta.0。

关于 @gondel/core 的常见问题

@gondel/core 是什么?

The base core of the gondel library

如何安装 @gondel/core?

在项目目录运行 npm install @gondel/core,或使用 pnpm add / yarn add / bun add。

@gondel/core 支持 TypeScript 吗?

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

@gondel/core 支持 ESM 还是 CommonJS?

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

@gondel/core 可以商用吗?

@gondel/core 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@gondel/core 的下载量有多少?

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

@gondel/core 还在维护吗?

最新版本 1.2.10 发布于 2026/10/29(18 天前);至今共发布 21 个版本,其中过去 12 个月发布了 1 个;首次发布于 2018/05/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。