Skip to content

v3.1.0: YAML parsing

Compare
Choose a tag to compare
@divmgl divmgl released this 19 Jan 20:38
· 19 commits to master since this release

After years of maintaining a zero-dependency library, this release introduces yaml as our first dependency. This change enables proper TypeScript types for all list and stats commands, eliminating the need for users to implement their own YAML parsing.

πŸ”¨ Breaking Changes

  • Added yaml as a dependency (previously zero dependencies)
  • Renamed getCurrentTube() to listTubeUsed() for better alignment with Beanstalkd protocol
  • All stats and list commands now return parsed JavaScript objects instead of raw YAML strings:
    • listTubes() β†’ string[]
    • listTubesWatched() β†’ string[]
    • listTubeUsed() β†’ string
    • stats() β†’ SystemStats
    • statsJob() β†’ JobStats
    • statsTube() β†’ TubeStats
  • All YAML keys are now camelCased (e.g., current-tubes β†’ currentTubes)

πŸ› Bug Fixes

  • Fixed package.json exports configuration
    • Added types export
    • Added default export
    • Properly configured CJS/ESM exports

Migration Guide

If you were previously parsing YAML responses manually, you can now use the parsed objects directly.

// Before
const tubesYAML = await client.listTubes();
const tubes = parseYAML(tubesYAML);

// After
const tubes = await client.listTubes(); // Returns string[] directly