@progress/kendo-csv
v1.0.0
Published
Kendo UI CSV package
Readme
kendo-csv
A lightweight, secure TypeScript library for generating CSV files from JavaScript data structures with built-in formula injection protection.
Features
- 🎯 Type-safe - Full TypeScript support with comprehensive type definitions
- 🔒 Secure - Built-in formula injection protection to prevent spreadsheet attacks
- 🚀 Flexible - Works with arrays, objects, and Maps
- 🌍 International - UTF-8 BOM support for proper Excel encoding
- ⚡ Lightweight - Zero dependencies for core functionality
- 🎨 Customizable - Configure delimiters, line endings, headers, and more
Installation
npm install @progress/kendo-csvQuick Start
Generate CSV String
import { toCSV } from '@progress/kendo-csv';
const data = [
{ id: 1, name: "John Doe", email: "[email protected]" },
{ id: 2, name: "Jane Smith", email: "[email protected]" }
];
const csv = toCSV({
data,
keys: ['id', 'name', 'email'],
names: ['ID', 'Name', 'Email']
});
console.log(csv);
// Output:
// ID,Name,Email
// 1,John Doe,[email protected]
// 2,Jane Smith,[email protected]Create CSV Blob for Download
import { toCSVBlob } from '@progress/kendo-csv';
import { saveAs } from '@progress/kendo-file-saver';
const data = [
{ id: 1, name: "John Doe", email: "[email protected]" },
{ id: 2, name: "Jane Smith", email: "[email protected]" }
];
const blob = toCSVBlob({
data,
keys: ['id', 'name', 'email'],
names: ['ID', 'Name', 'Email']
});
saveAs(blob, 'employees.csv');Documentation
- API Documentation - Complete reference for all functions and options
- Examples - Interactive examples demonstrating all features
License
See LICENSE.md for details.
