# x2t

> `x2t` 是用于将 `.xlsx` 和 `.xls` 文件转换为 `HTML Table` 的一个工具

Latest version **1.1.1** (published 2022-03-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install x2t
pnpm add x2t
yarn add x2t
bun add x2t
```

Provides the command `x2t`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2022-03-16 |
| First published | 2022-03-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 27.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | zlh-npm |
| Keywords | xlsx, xls, excel, table, x2t, xlsx2table, xlsxToTable, xlsx to table, excel2table, excelToTable, excel to table |

## Links

- npm: https://www.npmjs.com/package/x2t
- Homepage: https://github.com/zlh-GitHub/xlsx2table
- Issues: https://github.com/zlh-GitHub/xlsx2table/issues
- npm.io page: https://npm.io/package/x2t

## Dependencies (11)

- [ejs](https://npm.io/package/ejs.md) ^3.1.6
- [ora](https://npm.io/package/ora.md) ^5.4.1
- [chalk](https://npm.io/package/chalk.md) ^4.0.0
- [moment](https://npm.io/package/moment.md) ^2.29.1
- [rimraf](https://npm.io/package/rimraf.md) ^3.0.2
- [core-js](https://npm.io/package/core-js.md) ^3.21.1
- [exceljs](https://npm.io/package/exceljs.md) ^4.3.0
- [commander](https://npm.io/package/commander.md) ^9.0.0
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.17.5
- [cli-progress](https://npm.io/package/cli-progress.md) ^3.10.0
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.16.11

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2022-03-16

## README

# x2t

`x2t` 是用于将 `.xlsx` 和 `.xls` 文件转换为 `HTML Table` 的一个工具

> x2t 目前仅支持单元格数据比较简单的表格，如字符串，数字，链接等，对于单元格数值是公式、根据其他单元格计算得出以及复杂富文本等情况支持不太好，如有场景无法转换成功，欢迎提 issue

## 安装
```shell
  npm i x2t -g
```

## 使用

1. 转换文件
```shell
  x2t [path]
```
  * 转换当前 `终端目录` 下的所有 `.xlsx` 和 `.xls` 文件
```shell
  x2t
```

  * 转换指定 `文件夹` 或 `文件`
```shell
  x2t path
```
Tips: 如果 `path` 指向一个文件夹，则会递归遍历转换里面所有的 `.xlsx` 和 `.xls` 文件

2. 设置时间格式化的格式，默认值 `yyyy-MM-dd`
```shell
  x2t config.set.fmt <fmt>
```
Tips: 因为 `.xlsx` 和 `.xls` 的日期格式有多种尚未见过的 `fmt` ，当单元格值是日期格式的时候，获取到单元格的 `numFmt` 后使用现有的 `moment` 库可能无法正确的格式化时间，故提供 `config.set.fmt` 的配置，可以统一单元格的日期格式

---
_Source: https://npm.io/package/x2t · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
