{"id":13694965,"url":"https://github.com/sail-sail/ejsExcel","last_synced_at":"2025-05-03T04:31:20.871Z","repository":{"id":25781537,"uuid":"29219956","full_name":"sail-sail/ejsExcel","owner":"sail-sail","description":"nodejs excel template engine. node export excel","archived":false,"fork":false,"pushed_at":"2024-06-18T13:49:27.000Z","size":3051,"stargazers_count":714,"open_issues_count":8,"forks_count":115,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-04-11T23:02:15.950Z","etag":null,"topics":["ejsexcel","excel","nodejs","template-engine"],"latest_commit_sha":null,"homepage":"https://ejsexcel.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sail-sail.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-14T00:58:11.000Z","updated_at":"2025-03-11T04:01:12.000Z","dependencies_parsed_at":"2022-07-27T05:46:12.520Z","dependency_job_id":"08ada1fd-59a9-49c0-8d51-0e0fdeae1968","html_url":"https://github.com/sail-sail/ejsExcel","commit_stats":{"total_commits":245,"total_committers":8,"mean_commits":30.625,"dds":"0.46122448979591835","last_synced_commit":"7d328ffe2efa12b34ab2a79cdbc6123b2a026edf"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sail-sail%2FejsExcel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sail-sail%2FejsExcel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sail-sail%2FejsExcel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sail-sail%2FejsExcel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sail-sail","download_url":"https://codeload.github.com/sail-sail/ejsExcel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252144560,"owners_count":21701434,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ejsexcel","excel","nodejs","template-engine"],"created_at":"2024-08-02T17:01:53.224Z","updated_at":"2025-05-03T04:31:15.860Z","avatar_url":"https://github.com/sail-sail.png","language":"JavaScript","readme":"ejsExcel\n--------\n\u003e nodejs excel template engine. node export excel, ejsExcel\n\n\n### How to use?\n```bash\nnpm install ejsexcel\n```\n   \n### How to test?\n- 执行 test/test.bat\n    ```bash\n    test/test.bat\n    ```\n- test/test.xlsx 为完整示例 demo\n\n- e.g\n   ```js\n    const ejsexcel = require(\"ejsexcel\");\n    const fs = require(\"fs\");\n    const util = require(\"util\");\n    const readFileAsync = util.promisify(fs.readFile);\n    const writeFileAsync = util.promisify(fs.writeFile);\n    \n   (async function() {\n     //获得Excel模板的buffer对象\n     const exlBuf = await readFileAsync(\"./test.xlsx\");\n     //数据源\n     const data = [];\n     //用数据源(对象)data渲染Excel模板\n     //cachePath 为编译缓存路径, 对于模板文件比较大的情况, 可显著提高运行效率, 绝对路径, 若不设置, 则无缓存\n     const exlBuf2 = await ejsexcel.renderExcel(exlBuf, data, { cachePath: __dirname+\"/cache/\" });\n     await writeFileAsync(\"./test2.xlsx\", exlBuf2);\n     console.log(\"生成test2.xlsx\");\n   })();\n   ```\n\n## Syntax\n\n| Syntax                | Description                               |\n|-----------------------|-------------------------------------------|\n| `_data_`                | `_data_` 为内置对象, 数据源                   |\n| `\u003c%forRow`              | 循环一行                                  |\n| `\u003c%#`                   | 输出动态公式                               |\n| `\u003c%~`                   | 输出数字类型格式                           |\n| `\u003c%=`                   | 输出字符串                                |\n| `\u003c%forCell`             | 循环单元格                                |\n| `\u003c%forRBegin`           | 循环多行                                  |\n| `\u003c%forCBegin`           | 循环多个单元格                             |\n| `\u003c%_mergeCellFn_(\"C2:E2\")%\u003e`     | 合并单元格`C2:E2`                   |\n| `\u003c%_dataValidation_({ sqref: \"A1:A3\", formula1: \"\\\"序列1,序列2\\\"\" })%\u003e`     | 数据验证 |\n| `\u003c%_hideSheet_()%\u003e`     | 隐藏所在工作表                             |\n| `\u003c%_showSheet_()%\u003e`     | 显示所在工作表                             |\n| `\u003c%_deleteSheet_()%\u003e`   | 删除所在工作表                             |\n| `\u003c%   %\u003e`               | 内部可执行 任意 `javascript`,可以用 `\u003c%console.log(_data_)%\u003e` 打印临时变量到控制台,进行调试 |\n\n## Author\n+ Author: Sail\n    - QQ: 151263555\n    - QQ群: 470988427\n    - email: 151263555@qq.com\n\n## Templates\n\u003e 做一个这样的模版\n![模板](http://dn-cnode.qbox.me/Frs_RuLXJxYQgYoIUhGJJ1zspCJE)\n\n## Result\n\u003e ## 加数据渲染之后,导出结果\n![导出结果](http://dn-cnode.qbox.me/FnRDa5Zyjg-dI7ykCNR0T8SorWyC)\n\n\n## 捐赠鼓励支持此项目,支付宝扫描:\n![捐赠鼓励支持此项目](http://dn-cnode.qbox.me/FucPKV4XWewhakoqTSngU3AsaP0Z)\n\n## 项目贡献人列表\n- @Hello World  ¥50\n- @德爾文  ¥50\n- @Explore®  ¥50\n- @向左转  ¥50\n- @吴燕飞  ¥50\n- @strive-ming  ¥10\n- @MR.P  ¥16.66\n- @不求来生  ¥6.60\n- @羊刀  ¥6.66\n- @Leo  ¥8.88\n- @不摇碧莲  ¥6.66\n- @天涯海角  ¥10\n- @刚刚好  ¥5\n- @Aptenodytes forsteri  ¥15\n- @HHB  ¥30\n- @Original  ¥88.88\n- @半日  ¥10\n- @狗狗踏青去了  ¥50\n- @zzzzzzzz  ¥50\n- @zzzzzzzz  ¥30\n- @九尾之狐  ¥66.66\n- @小小青尘  ¥50\n- @亲眼 ¥6.66\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsail-sail%2FejsExcel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsail-sail%2FejsExcel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsail-sail%2FejsExcel/lists"}