tik-forge
v1.3.8
Published
A high-performance document processing library for Node.js, built with Zig. Provides native implementations for Excel, Word, and PDF manipulation with optimized memory usage and multi-threading capabilities.
Downloads
15
Maintainers
Readme
TikForge
A high-performance PDF and Excel generator library for Node.js
Installation
npm install tik-forgeyarn add tik-forgebun add tik-forgeRequirements
- Node.js >= 14.0.0
- Python (for node-gyp)
- C++ build tools
- wkhtmltopdf (for PDF generation)
- ssconvert (for Excel conversion)
System Requirements
Supported Operating Systems
- Windows (x64)
- macOS (Intel x64 & Apple Silicon ARM64)
- Linux (x64 & ARM64)
Prerequisites
- Node.js >= 14.0.0
- Zig compiler
- Python (for node-gyp)
- C/C++ build tools:
- Windows: Visual Studio Build Tools
- macOS: Xcode Command Line Tools
- Linux: GCC and development tools
Supported Apple Silicon Macs
- M1
- M2
- M3
- Future Apple Silicon chips
Usage
const tikForge = require('tik-forge');
async function generateDocuments() {
try {
await tikForge.generateFiles({
template: '<h1>{{title}}</h1>',
data: {
title: 'Hello World'
},
output: {
path: './output',
format: 'file',
pdf: {
filename: 'output.pdf'
},
excel: {
filename: 'output.xlsx'
}
}
});
} catch (error) {
console.error('Generation failed:', error);
}
}Configuration
Environment variables:
TEMP_DIR: Directory for temporary filesMAX_CONCURRENT_OPS: Maximum concurrent operationsCACHE_SIZE: Cache size in bytesTIMEOUT_MS: Operation timeout in milliseconds
API Reference
generateFiles(options)
Generates PDF and Excel files from templates.
Options:
template: HTML template stringdata: Data to inject into templateoutput: Output configurationpath: Output directoryformat: 'file' | 'base64' | 'buffer'pdf: PDF generation optionsexcel: Excel generation options
Returns: Promise
zig build -freference-trace
