@fintoc/fintoc-js

中文文档
1.1.2发布于 2022/03/02MITTypeScriptESM + CJS近 30 天下载 3.9万

Use the Fintoc widget as an ES module.

原始使用文档
文档目录5 节
  1. Installation
  2. Usage
  3. TypeScript support
  4. Developing
  5. Acknowledgements

Fintoc.js ES Module

Use the Fintoc widget as an ES module.

NPM - Version Linters

Installation

Install using npm! (or your favourite package manager)

# Using npm
npm install @fintoc/fintoc-js

# Using yarn
yarn add @fintoc/fintoc-js

Note: This library requires Node 10+.

Usage

Fintoc.js exports a single method called getFintoc. This is an async method that returns the Fintoc object from the documentation. To get the Fintoc object, use the following snippet:

import { getFintoc } from '@fintoc/fintoc-js';

const Fintoc = await getFintoc();

After retrieving the Fintoc object, you are ready to instantiate the widget:

const options = { ... };

const widget = Fintoc.create(options);

Here, options corresponds to an object with the parameters received by the widget (you can read more about these parameters here).

Finally, you can use any of the widget methods:

widget.open();
widget.close();
widget.destroy();

You can read more about these methods here.

TypeScript support

This package includes TypeScript declarations for the Fintoc widget.

Developing

To develop the package, you need to use npm. Install the dependencies:

npm install

Build the library and watch for changes to the code:

npm run watch:build

If you want to create a new release, you can run:

git switch master
npm run bump! <major|minor|patch>

This will create a new branch with the updated version from master.

Acknowledgements

The first raw implementation of a chunk of code to load the Fintoc script was co-authored by @daleal and @naquiroz, and served as a starting point for the general idea of this library.

版本与发布记录

@fintoc/fintoc-js 共发布 5 个版本,首次发布于 2022/01/26;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.1.2latest2022/03/024 年前
1.1.12022/03/024 年前
1.1.02022/03/014 年前
1.0.12022/01/284 年前
1.0.02022/01/264 年前

关于 @fintoc/fintoc-js 的常见问题

@fintoc/fintoc-js 是什么?

Use the Fintoc widget as an ES module.

如何安装 @fintoc/fintoc-js?

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

@fintoc/fintoc-js 支持 TypeScript 吗?

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

@fintoc/fintoc-js 支持 ESM 还是 CommonJS?

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

@fintoc/fintoc-js 需要什么版本的 Node.js?

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

@fintoc/fintoc-js 可以商用吗?

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

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

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

@fintoc/fintoc-js 还在维护吗?

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