Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@types/csv-write-stream
Advanced tools
TypeScript definitions for csv-write-stream
npm install --save @types/csv-write-stream
This package contains type definitions for csv-write-stream (https://github.com/maxogden/csv-write-stream).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/csv-write-stream.
/// <reference types="node" />
import { Transform } from "node:stream";
export = makeCsvWriteStream;
/**
* Creates a CSV encoder stream that produces properly escaped CSVs.
*
* Write arrays of strings (or JS objects) and you will receive a properly escaped CSV stream out the other end.
*
* @example
* // example of auto headers
*
* import * as fs from 'node:fs'
* import csvWriter = require('csv-write-stream')
*
* const writer = csvWriter()
*
* writer.pipe(fs.createWriteStream('out.csv'))
* writer.write({hello: 'world', foo: 'bar', baz: 'taco'})
* writer.end()
*
* // produces: hello,foo,baz\nworld,bar,taco\n
*
* @example
* // example of specifying headers
*
* import * as fs from 'node:fs'
* import csvWriter = require('csv-write-stream')
*
* const writer = csvWriter({ headers: ['hello', 'foo'] })
*
* writer.pipe(fs.createWriteStream('out.csv'))
* writer.write(['world', 'bar'])
* writer.end()
*
* // produces: hello,foo\nworld,bar\n
*
* @example
* // example of not sending headers
*
* import * as fs from 'node:fs'
* import csvWriter = require('csv-write-stream')
*
* const writer = csvWriter({ sendHeaders: false })
*
* writer.pipe(fs.createWriteStream('out.csv'))
* writer.write({hello: 'world', foo: 'bar', baz: 'taco'})
* writer.end()
*
* // produces: world,bar,taco\n
*/
declare function makeCsvWriteStream(options?: makeCsvWriteStream.Options): makeCsvWriteStream.CsvWriteStream;
declare namespace makeCsvWriteStream {
interface Options {
/**
* If set to `false`, the headers will be used for ordering the data but will never
* be written to the stream.
*
* @default true
*/
sendHeaders?: boolean;
/**
* Can be an array of strings to use as the header row. If you don't specify a header
* row the keys of the first row written to the stream will be used as the header row
* IF the first row is an object.
*
* @default null
*/
headers?: string[];
/**
* @default ','
*/
separator?: string;
/**
* @default '\n'
*/
newline?: string;
}
interface CsvWriteStream extends Transform {
readonly sendHeaders: boolean;
readonly headers: string[] | null;
readonly separator: string;
readonly newline: string;
}
}
These definitions were written by BendingBender.
FAQs
TypeScript definitions for csv-write-stream
The npm package @types/csv-write-stream receives a total of 8,424 weekly downloads. As such, @types/csv-write-stream popularity was classified as popular.
We found that @types/csv-write-stream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.