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

  • Data-Forge FS
  • IAsyncFileReader
  • ICsvSerializer
  • IJsonSerializer
  • ISyncFileReader

This view

  • Original page
  • New address

GeezerVison is showing data-forge.github.io — Data-Forge FS

Index

Interfaces

  • IAsyncFileReader
  • ICsvSerializer
  • IJsonSerializer
  • ISyncFileReader

Functions

  • asCSV
  • asJSON
  • readFile
  • readFileSync

Functions

asCSV

  • asCSV<IndexT, ValueT>(this: IDataFrame<IndexT, ValueT>, options?: ICSVOutputOptions): ICsvSerializer
    • Defined in index.ts:370

    Treat the dataframe as CSV data for purposes of serialization. This is the first step you need in serializing a dataframe to a CSV data file.

    example
    df.asCSV().writeFileSync("my-data-file.csv");
    
    example
    await df.asCSV().writeFile("my-data-file.csv");
    
    example
    const options = { ... };
    await df.asCSV(options).writeFile("my-data-file.csv");
    

    Type parameters

    • IndexT

    • ValueT

    Parameters

    • this: IDataFrame<IndexT, ValueT>
    • Optional options: ICSVOutputOptions

      Options for CSV output. The options object is passed directly to PapaParse.unparse, please see PapaParse docs for additional options.

    Returns ICsvSerializer

    Returns a ICsvSerializer that represents the dataframe for serialization in the CSV format. Call writeFile or writeFileSync to output the CSV data to a text file.

asJSON

  • asJSON<IndexT, ValueT>(this: IDataFrame<IndexT, ValueT>): IJsonSerializer
    • Defined in index.ts:392

    Treat the dataframe as JSON data for purposes of serialization. This is the first step you need in serializing a dataframe to a JSON data file.

    example
    df.asJSON().writeFileSync("my-data-file.json");
    
    example
    await df.asJSON().writeFile("my-data-file.json");
    

    Type parameters

    • IndexT

    • ValueT

    Parameters

    • this: IDataFrame<IndexT, ValueT>

    Returns IJsonSerializer

    Returns a IJsonSerializer that represents the dataframe for serialization in the JSON format. Call writeFile or writeFileSync to output the JSON data to a text file.

readFile

  • readFile(filePath: string): IAsyncFileReader
    • Defined in index.ts:728

    Read a file asynchronously from the file system. Works in Nodejs, doesn't work in the browser.

    example
    const df = await dataForge.readFile("my-data-file.csv").parseCSV();
    
    example
    const options = {
         // ...
    };
    const df = await dataForge.readFile("my-data-file.csv").parseCSV(options);
    
    example
    const df = await dataForge.readFile("my-data-file.json").parseJSON();
    

    Parameters

    • filePath: string

      The path to the file to read.

    Returns IAsyncFileReader

    Returns an object that represents the file. Use parseCSV or parseJSON to deserialize to a DataFrame.

readFileSync

  • readFileSync(filePath: string): ISyncFileReader
    • Defined in index.ts:766

    Read a file synchronously from the file system. Works in Nodejs, doesn't work in the browser.

    memberof

    Data-Forge

    example
    const df = dataForge.readFileSync("my-data-file.csv").parseCSV();
    
    example
    const options = {
         // ...
    };
    const df = dataForge.readFileSync("my-data-file.csv").parseCSV(options);
    
    example
    const df = dataForge.readFileSync("my-data-file.json").parseJSON();
    

    Parameters

    • filePath: string

      The path to the file to read.

    Returns ISyncFileReader

    Returns an object that represents the file. Use parseCSV or parseJSON to deserialize to a DataFrame.

Generated using TypeDoc

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.