Function tsCountExports

  • Counts the number of export statements in a given code string.

    Parameters

    • code: string

      The code string to analyze.

    Returns number

    The number of export statements found in the code.

    Example

    const code = `
    export const foo = 42;
    export function bar() {
    return "Hello, world!";
    }
    `;
    const count = tsCountExports(code);
    //=> 2

Generated using TypeDoc