https://github.com/ressuman/csv-writer-project
CSV Writer with TypeScript. This project demonstrates my implementation of a CSV writer using plain TypeScript and JavaScript, without relying on any frameworks.
https://github.com/ressuman/csv-writer-project
data javascript typescript
Last synced: about 1 month ago
JSON representation
CSV Writer with TypeScript. This project demonstrates my implementation of a CSV writer using plain TypeScript and JavaScript, without relying on any frameworks.
- Host: GitHub
- URL: https://github.com/ressuman/csv-writer-project
- Owner: ressuman
- Created: 2024-07-23T21:07:44.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-23T21:17:10.000Z (almost 2 years ago)
- Last Synced: 2025-01-10T03:42:39.208Z (over 1 year ago)
- Topics: data, javascript, typescript
- Language: TypeScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
---
# CSV Writer with TypeScript
This project demonstrates my implementation of a CSV writer using plain TypeScript and JavaScript, without relying on any frameworks.
## Key Features
- **TypeScript**: Ensures type safety and a better development experience.
- **CSV Writing**: Creates and writes data to CSV files using native JavaScript methods.
- **No Frameworks**: Built with plain TypeScript and JavaScript for simplicity and flexibility.
## Getting Started
### Prerequisites
Make sure you have Node.js and npm installed on your machine.
### Installation
1. Clone the repository:
```bash
git clone https://github.com/yourusername/csv-writer-typescript.git
cd csv-writer-typescript
```
2. Install dependencies:
```bash
npm install
```
### Building the Project
1. Build the project:
```bash
npm run build
```
### Running the CSV Writer
1. Run the CSV writer script:
```bash
node dist/index.js
```
## Usage
This project includes a simple CSV writer script that you can customize to suit your needs. Modify the `src/index.ts` file to add the data you want to write to the CSV file.
Example `src/index.ts`:
```typescript
import { writeFileSync } from "fs";
const data = [
["Name", "Age", "Email"],
["John Doe", "30", "john.doe@example.com"],
["Jane Smith", "25", "jane.smith@example.com"],
];
const csvContent = data.map((row) => row.join(",")).join("\n");
writeFileSync("output.csv", csvContent);
console.log("CSV file written successfully");
```
## Contributing
Feel free to fork this repository, make improvements, and submit pull requests. Contributions are always welcome!
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
Feel free to explore and contribute!