Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/csv-write-stream

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/csv-write-stream

TypeScript definitions for csv-write-stream

  • 2.0.3
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.5K
increased by4.16%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/csv-write-stream

Summary

This package contains type definitions for csv-write-stream (https://github.com/maxogden/csv-write-stream).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/csv-write-stream.

index.d.ts

/// <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;
    }
}

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: @types/node

Credits

These definitions were written by BendingBender.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc