Skip to content

v0.53.0 - DataFrame serialization: toJson and toCsv (2026-03-28)

What Changed?

This release adds two serialization methods to BareFrame: toJson() and toCsv(). Both methods convert DataFrame contents to a string format suitable for export, logging, or external processing. This release also fixes broken links and incomplete code examples in the documentation homepage.


What's New

Main Feature: BareFrame.toJson() and BareFrame.toCsv()

What it does: Converts a BareFrame to a JSON string or a CSV string in row-oriented format. toJson() delegates to the existing toObjects() method and serializes via JSON.stringify. toCsv() generates a header row followed by data rows, with RFC-4180-compliant double-quote escaping.

How to use it:

JavaScript
const df = gaslamp.BareFrame.fromColumns({
  name: ["Alice", "Bob"],
  age:  [25, 30],
});

// JSON (compact)
df.toJson();
// '[{"name":"Alice","age":25},{"name":"Bob","age":30}]'

// JSON (pretty-printed)
df.toJson(2);

// CSV (comma-separated)
df.toCsv();
// 'name,age\nAlice,25\nBob,30'

// CSV (tab-separated)
df.toCsv("\t");

Added

  • BareFrame.toJson(indent?: number): string — serializes to a JSON string; optional indent for pretty-printing
  • BareFrame.toCsv(separator?: string): string — serializes to a CSV string; optional custom separator (default: ",")
  • Tests for toJson and toCsv (12 cases) in __tests__/v2/frame.test.ts

Changed

  • docs/index.md: fixed Documentation section links (modules/guides/, cookbooks/dev/)
  • docs/index.md: completed FlameWright Quick Start snippet with fromSchema usage
  • docs/index.md: fixed Expression snippet — added missing sheet variable definition

Fixed

  • Nothing

Is It Safe to Upgrade?

  • Breaking Changes: No
  • Backward Compatible: Yes

No existing API was changed. The two new methods are purely additive.


Release Details

  • Date: 2026-03-28
  • Version: v0.53.0
  • gaslamp: 111
  • pilotlamp: 69
  • Files Changed: 3
  • Commits:
    • 8bdf802b feat(frame): add BareFrame.toJson()
    • c19d440e feat(frame): add BareFrame.toCsv()
    • 8e8c4dc8 test(frame): add tests for toJson and toCsv
    • b2de088f docs(index): fix links and code examples in homepage

Known Issues

  • None

Next Steps

  • Consider adding toJson / toCsv to LazyFrame for consistency with BareFrame