Module

Node.Stream.CSV.Stringify

Package
purescript-csv-stream
Repository
cakekindel/purescript-csv-stream

#CSVWrite Source

#CSVStringifier Source

type CSVStringifier :: Row Type -> Typetype CSVStringifier r = Stream (csv :: CSVWrite, read :: Read, write :: Write | r)

Stream transforming rows of stringified CSV values to CSV-formatted rows.

Write rows to the stream using write.

Stringified rows are emitted on the Readable end as string chunks, meaning it can be treated as a Node.Stream.Readable that has had setEncoding UTF8 invoked on it.

#Config Source

type Config :: Row Type -> Row Typetype Config r = (bom :: Boolean, delimiter :: String, escape :: String, escape_formulas :: Boolean, quote :: String, quoted :: Boolean, quoted_empty :: Boolean, quoted_match :: Regex, quoted_string :: Boolean, record_delimiter :: String | r)

https://csv.js.org/stringify/options/

#makeImpl Source

makeImpl :: forall r. Foreign -> Effect (Stream r)

#writeImpl Source

writeImpl :: forall r. Stream r -> Array String -> Effect Unit

#recordToForeign Source

#make Source

make :: forall @config @missing @extra. Union config missing (Config extra) => Array String -> Record config -> Effect (CSVStringifier ())

Create a raw Transform stream that accepts chunks of Array String, and transforms them into string CSV rows.

Requires an ordered array of column names.

#toObjectStream Source

toObjectStream :: CSVStringifier () -> Transform (Array String) String

Convert the raw stream to a typed ObjectStream

#write Source

write :: forall @r rl a. RowToList r rl => WriteCSVRecord r rl => CSVStringifier a -> Record r -> Effect Unit

Write a record to a CSVStringifier.

The record will be emitted on the Readable end of the stream as a string chunk.

#writeRaw Source

writeRaw :: forall a. CSVStringifier a -> Array String -> Effect Unit

Write a record to a CSVStringifier.

The record will be emitted on the Readable end of the stream as a string chunk.