TabularJS
All examples
framework

Express.js upload endpoint

Parse files uploaded to a Node.js server.

An Express route that uses Multer for uploads and TabularJS for conversion — ready for production.

js
import express from 'express';
import multer from 'multer';
import tabularjs from 'tabularjs';

const app = express();
const upload = multer();

app.post('/convert', upload.single('file'), async (req, res) => {
  try {
    const result = await tabularjs(req.file.buffer, { name: req.file.originalname });
    res.json(result);
  } catch (err) {
    res.status(400).json({ error: err.message });
  }
});

app.listen(3000);

Live Preview

Sample output for a file with employee data.

stdout
{
  "worksheets": [
    {
      "name": "Sheet1",
      "data": [
        ["Name", "Department", "Salary", "Start Date"],
        ["Alice Johnson", "Engineering", 95000, "2021-03-15"],
        ["Bob Smith", "Marketing", 72000, "2022-01-10"],
        ["Carol Williams", "Engineering", 88000, "2020-07-22"],
        ["David Brown", "Design", 68000, "2023-02-08"],
        ["Eve Davis", "Engineering", 102000, "2019-11-30"]
      ]
    }
  ]
}