web-csv-toolbox - v0.14.0
    Preparing search index...

    Function parseStringToArraySyncWASM

    • Beta

      Parse CSV string to record of arrays using WebAssembly (synchronous).

      Type Parameters

      Parameters

      Returns CSVObjectRecord<Header>[]

      Record of arrays

      This function uses WebAssembly to parse CSV string synchronously.

      WASM Initialization: WASM module is automatically initialized on first use. However, it is recommended to call loadWASM beforehand for better performance.

      // Recommended: Initialize WASM beforehand
      import { loadWASM, parseStringToArraySyncWASM } from 'web-csv-toolbox';
      await loadWASM();
      const result = parseStringToArraySyncWASM(csv);
      // Alternative: Automatic initialization (works but slower on first use)
      import { parseStringToArraySyncWASM } from 'web-csv-toolbox';
      const result = parseStringToArraySyncWASM(csv);

      Performance Characteristics:

      • Execution: Synchronous operation that blocks the calling thread
      • Memory usage: O(n) - loads entire result into memory
      • Use case: Suitable when you need synchronous parsing and can accept blocking behavior

      Limitations:

      • Only supports UTF-8 string (not UTF-16)
      • Only supports double quote (") as quotation character
      • Only supports single character as delimiter
      • WASM is automatically initialized on first use (optional preloading via loadWASM improves first-parse performance)
      import { loadWASM, parseStringToArraySyncWASM } from "web-csv-toolbox";

      // Recommended: Load WASM beforehand
      await loadWASM();

      const csv = "a,b,c\n1,2,3";
      const result = parseStringToArraySyncWASM(csv);
      console.log(result);
      // Prints: [{ a: "1", b: "2", c: "3" }]
      import { parseStringToArraySyncWASM } from "web-csv-toolbox";

      // WASM is automatically initialized on first use
      const result = parseStringToArraySyncWASM(csv);

      If provided options are invalid or WASM module initialization fails

      If provided options have invalid types

    • Beta

      Parse CSV string to record of arrays using WebAssembly (synchronous).

      Type Parameters

      • const CSVSource extends string
      • const Delimiter extends string = ","
      • const Quotation extends string = "\""
      • const Header extends readonly string[] = PickCSVHeader<CSVSource>

      Parameters

      Returns CSVObjectRecord<Header>[]

      Record of arrays

      This function uses WebAssembly to parse CSV string synchronously.

      WASM Initialization: WASM module is automatically initialized on first use. However, it is recommended to call loadWASM beforehand for better performance.

      // Recommended: Initialize WASM beforehand
      import { loadWASM, parseStringToArraySyncWASM } from 'web-csv-toolbox';
      await loadWASM();
      const result = parseStringToArraySyncWASM(csv);
      // Alternative: Automatic initialization (works but slower on first use)
      import { parseStringToArraySyncWASM } from 'web-csv-toolbox';
      const result = parseStringToArraySyncWASM(csv);

      Performance Characteristics:

      • Execution: Synchronous operation that blocks the calling thread
      • Memory usage: O(n) - loads entire result into memory
      • Use case: Suitable when you need synchronous parsing and can accept blocking behavior

      Limitations:

      • Only supports UTF-8 string (not UTF-16)
      • Only supports double quote (") as quotation character
      • Only supports single character as delimiter
      • WASM is automatically initialized on first use (optional preloading via loadWASM improves first-parse performance)
      import { loadWASM, parseStringToArraySyncWASM } from "web-csv-toolbox";

      // Recommended: Load WASM beforehand
      await loadWASM();

      const csv = "a,b,c\n1,2,3";
      const result = parseStringToArraySyncWASM(csv);
      console.log(result);
      // Prints: [{ a: "1", b: "2", c: "3" }]
      import { parseStringToArraySyncWASM } from "web-csv-toolbox";

      // WASM is automatically initialized on first use
      const result = parseStringToArraySyncWASM(csv);

      If provided options are invalid or WASM module initialization fails

      If provided options have invalid types

    • Beta

      Parse CSV string to record of arrays using WebAssembly (synchronous).

      Type Parameters

      • const Header extends readonly string[]
      • const Delimiter extends string = ","
      • const Quotation extends string = "\""

      Parameters

      Returns CSVObjectRecord<Header>[]

      Record of arrays

      This function uses WebAssembly to parse CSV string synchronously.

      WASM Initialization: WASM module is automatically initialized on first use. However, it is recommended to call loadWASM beforehand for better performance.

      // Recommended: Initialize WASM beforehand
      import { loadWASM, parseStringToArraySyncWASM } from 'web-csv-toolbox';
      await loadWASM();
      const result = parseStringToArraySyncWASM(csv);
      // Alternative: Automatic initialization (works but slower on first use)
      import { parseStringToArraySyncWASM } from 'web-csv-toolbox';
      const result = parseStringToArraySyncWASM(csv);

      Performance Characteristics:

      • Execution: Synchronous operation that blocks the calling thread
      • Memory usage: O(n) - loads entire result into memory
      • Use case: Suitable when you need synchronous parsing and can accept blocking behavior

      Limitations:

      • Only supports UTF-8 string (not UTF-16)
      • Only supports double quote (") as quotation character
      • Only supports single character as delimiter
      • WASM is automatically initialized on first use (optional preloading via loadWASM improves first-parse performance)
      import { loadWASM, parseStringToArraySyncWASM } from "web-csv-toolbox";

      // Recommended: Load WASM beforehand
      await loadWASM();

      const csv = "a,b,c\n1,2,3";
      const result = parseStringToArraySyncWASM(csv);
      console.log(result);
      // Prints: [{ a: "1", b: "2", c: "3" }]
      import { parseStringToArraySyncWASM } from "web-csv-toolbox";

      // WASM is automatically initialized on first use
      const result = parseStringToArraySyncWASM(csv);

      If provided options are invalid or WASM module initialization fails

      If provided options have invalid types