GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • GitHub
  • Generate
  • Parse
  • Transform
  • Stringify
  • How to contribute
  • GitHub
  • Issue Tracker
  • License
  • Homepage
  • Converter
  • API
  • Stream
  • Callback

This view

  • Original page
  • New address

GeezerVison is showing csv.js.org — CSV Generate - Examples

CSV Generate examples

This package proposes different API flavors. Every example is available on GitHub.

Using the pipe function

One useful function part of the Stream API is pipe to interact between multiple streams. You may use this function to pipe a stream.Readable source to a stream.Writable destination.

The pipe example, generates a dataset of 2 rows with 2 columns. The first columns contains integer values and the second column contains boolean values. It prints the generated dataset to stdout. the function generate return a readable stream which is then piped to process.stdout which is a writable stream.

import { generate } from "csv-generate";

generate({
  columns: ["int", "bool"],
  length: 2,
}).pipe(process.stdout);
./packages/csv-generate/samples/pipe.js

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.