@ema/js-base

中文文档
0.5.3发布于 2019/02/17MITTypeScriptESM + CJS近 30 天下载 2320

Emagine Reality: base Javascript and Webcomponents library

原始使用文档
文档目录4 节
  1. Base library for Javascript projects
  2. Using the webcomponents library
  3. Using the javascript modules library
  4. Dev: getting started

Base library for Javascript projects

Web components library

@ema/js-base/dist/webcomponents.js

  • Reusable Web Components
  • The web components are just standard HTML elements, so they work in any major framework or with no framework at all.
  • In many cases, the components can be used as a drop in replacement for traditional frontend frameworks to build widgets, microapps, apps, etc.

Built With Stencil

Generic javascript library

@ema/js-base/dist/lib/index

  • Javascript modules and classes library
  • Shareable among all Javascript projects
  • Config - api - translation - util etc.

Distribution: npm / http / https

Demo's and documentation

Using the webcomponents library

Script tag

  • Put the following script tag in the head of your index.html: <script src='https://unpkg.com/@ema/js-base/dist/webcomponents.js'></script>
  • You can then use the webcomponents anywhere in your template, JSX, html etc.

Node Modules

  • Run npm install @ema/js-base --save
  • Put a script tag similar to this <script src='node_modules/@ema/js-base/dist/webcomponents.js'></script> in the head of your index.html
  • Then you can use the webcomponents anywhere in your template, JSX, html etc

In a stencil-starter app

  • Run npm install @ema/js-base --save
  • Add an import to the npm packages import '@ema/js-base';
  • Then you can use the webcomponents anywhere in your template, JSX, html etc

Using the javascript modules library

  • Run npm install @ema/js-base --save
  • ES5 usage: import { ConfigService, DomUtil } from '@ema/js-base/dist/lib/index'
  • ES6 usage: import { ConfigService, DomUtil } from '@ema/js-base/dist/collection/index'

Dev: getting started

Clone the repo, then run:

npm install
npm start

To watch for file changes during develop, run:

npm run dev

To build the components and classes for production, run:

npm run build

To run the unit tests for the components and classes, run:

npm test

Need help? Check out the Stencil docs here.

Alt text

版本与发布记录

@ema/js-base 共发布 86 个版本,首次发布于 2018/06/03;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.5.3latest2019/02/177 年前
0.5.22019/02/057 年前
0.5.12019/01/097 年前
0.4.12019/01/067 年前
0.3.82018/12/227 年前
0.3.72018/12/037 年前

关于 @ema/js-base 的常见问题

@ema/js-base 是什么?

Emagine Reality: base Javascript and Webcomponents library

如何安装 @ema/js-base?

在项目目录运行 npm install @ema/js-base,或使用 pnpm add / yarn add / bun add。

@ema/js-base 支持 TypeScript 吗?

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

@ema/js-base 支持 ESM 还是 CommonJS?

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

@ema/js-base 可以商用吗?

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

@ema/js-base 的下载量有多少?

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

@ema/js-base 还在维护吗?

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