{"modulePath":"github.com/dracory/nodebase","version":"v0.7.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package csv\n\nPackage csv contains the csv node implementation.\n\n## Types\n\n```go\ntype CSVConfig struct {\n\t// Property is the message field to convert; \"payload\" (default)\n\t// targets msg.Payload, otherwise a dotted path inside the data map\n\tProperty string `json:\"property\"`\n\t// Headers treats the first row as a header line: parsed rows become\n\t// objects keyed by the header names; serializing objects writes a\n\t// header row derived from the first object's keys\n\tHeaders bool `json:\"headers\"`\n\t// HdrIn is Node-RED's header flag (serialized \"hdrin\"); same effect\n\t// as Headers\n\tHdrIn bool `json:\"hdrin\"`\n\t// HdrOut controls header emission when serializing (serialized\n\t// \"hdrout\"): \"none\" (default) never emits a header row, \"all\" emits\n\t// one on every output, \"once\" emits one until a message carrying a\n\t// reset property arrives\n\tHdrOut string `json:\"hdrout\"`\n\t// Temp is the column-name template (serialized \"temp\"): a\n\t// separator-delimited list of column names used to key parsed rows\n\t// and to select/order columns when serializing objects\n\tTemp string `json:\"temp\"`\n\t// Multi is Node-RED's output mode (serialized \"multi\"): \"one\"\n\t// emits one message per row as a parts sequence; \"mult\" produces a\n\t// single message whose payload is the whole parsed table. Unset\n\t// keeps the nodebase expansion behavior (one message per row).\n\tMulti string `json:\"multi\"`\n\t// Sep is the column separator (serialized \"sep\"); default \",\"\n\tSep string `json:\"sep\"`\n\t// Ret is the row terminator hint (serialized \"ret\", e.g. \"\\n\");\n\t// informational only — the parser accepts both endings\n\tRet string `json:\"ret\"`\n\t// Skip skips this many leading lines before parsing (serialized \"skip\")\n\tSkip int `json:\"skip\"`\n\t// Strings is Node-RED's \"strings\" flag: true (and unset) coerces\n\t// numeric-looking cells to numbers via parseFloat\n\tStrings *bool `json:\"strings\"`\n}\n```\nCSVConfig holds configuration for the csv node — a simplified Node-RED CSV parser equivalent.\n\n```go\ntype CSVNode struct {\n\t*nodebase.BaseNode\n\t// contains filtered or unexported fields\n}\n```\nCSVNode 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.\n\n```go\nfunc NewCSVNode(node nodestore.NodeInterface, config *CSVConfig, host nodebase.NodeHost) *CSVNode\n```\nNewCSVNode creates a new csv node\n\n```go\nfunc (n *CSVNode) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)\n```\nExecute 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.\n\n```go\nfunc (n *CSVNode) Expand(output nodestore.MessageInterface) []nodestore.MessageInterface\n```\nExpand emits one message per parsed row. Each row is an object keyed by the resolved column names — the header row, the configured template, message-provided columns, or generated col1..colN. Every message carries parts metadata (id, type \"csv\", index, count) so a downstream join node can reassemble the table.\n\n","path":"github.com/dracory/nodebase/csv","name":"csv","synopsis":"Package csv contains the csv node implementation.","isRedistributable":true}
