Function updateJsonFileSync

  • Updates a JSON file based on a provided update function. The update function takes the file's current source string as a parameter and should return an object.

    Parameters

    • filepath: string

      The path to the file to update.

    • update: ((o) => Record<string | number, unknown>)

      The function to update the file. Takes the parsed source string as a parameter and should return a string.

        • (o): Record<string | number, unknown>
        • Parameters

          • o: Record<string | number, unknown>

          Returns Record<string | number, unknown>

    • options: {
          read?: IJFReadOptions;
          write?: IJFWriteOptions;
      } = {}

    Returns void

Generated using TypeDoc