csv

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package csv contains the csv node implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVConfig

type CSVConfig struct {
	// Property is the message field to convert; "payload" (default)
	// targets msg.Payload, otherwise a dotted path inside the data map
	Property string `json:"property"`
	// Headers treats the first row as a header line: parsed rows become
	// objects keyed by the header names; serializing objects writes a
	// header row derived from the first object's keys
	Headers bool `json:"headers"`
}

CSVConfig holds configuration for the csv node — a simplified Node-RED CSV parser equivalent.

type CSVNode

type CSVNode struct {
	*nodebase.BaseNode
	// contains filtered or unexported fields
}

CSVNode converts between a CSV string and row data. A string input is parsed and expanded into one message per row (parts metadata, like the split node); an array input is serialized into a CSV string.

func NewCSVNode

func NewCSVNode(node nodestore.NodeInterface, config *CSVConfig) *CSVNode

NewCSVNode creates a new csv node

func (*CSVNode) Execute

Execute converts the configured property. Strings are parsed and the rows stashed for Expand; slices are serialized to a CSV string and written back to the property.

func (*CSVNode) Expand

Expand emits one message per parsed row. With headers each row is a map keyed by the header line; otherwise a []string. Every message carries parts metadata (id, type "csv", index, count) so a downstream join node can reassemble the table.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL