Function findObject

  • Parameters

    • filePath: string

      The path to the JSON file.

    • id: any

      The ID to search for.

    Returns Promise<any>

    The found object or undefined if no match is found.


    • The findObject function searches for an object with a matching ID in a JSON file.

    Example

    const filePath = "data.json";
    const id = 123;
    const result = await findObject(filePath, id);
    console.log(result);

Generated using TypeDoc