
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
react-preview-excel
Advanced tools

使用 canvas 实现的一个轻量的预览 .xlsx / .xls / .csv 格式文件的 react 组件。
在与 agent、知识库文档的交互过程中,通常会涉及到文件预览,比如 .xlsx / .docx / .ppt / .pdf / .wps / .dps 等等。
目前除了 excel 文件,其他格式几乎都可以转换为 pdf 后再去进行预览,方案比较成熟。
想要实现单纯的 excel 文件预览,而不需要编辑能力,目前已有的开源库几乎都很重。
import ExcelPreview from 'react-preview-excel'
export default function App() {
return (
<div style={{ width: '100%', height: '100vh' }}>
<ExcelPreview
url="/example1.xlsx"
onInitLoad={() => {
console.log('onInitLoad');
}}
onError={(err) => {
console.log('onError', err);
}}
LoadingComponent={({ message }) => (
<div>
<p style={{ color: 'blue' }}>{message}</p>
</div>
)}
/>
</div>
)
}
从零手撸一个 excel 文件预览,支持 .xlsx / .xls / .csv 格式文件预览。
依赖库:
{
"dayjs": "^1.11.13",
"exceljs": "^4.4.0",
"xlsx": "^0.18.5"
}
示例文件:
本项目使用 rsbuild 初始化,欢迎 PR 贡献代码,也欢迎提出 issue 讨论。
MIT
FAQs

We found that react-preview-excel demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.