happy-opfs
    Preparing search index...

    Function writeJsonFile

    • Writes an object to a file as JSON.

      Type Parameters

      • T

        The type of the object to write.

      Parameters

      • filePath: string

        The absolute path of the file to write.

      • data: T

        The object to serialize and write.

      Returns AsyncVoidIOResult

      A promise that resolves to an AsyncVoidIOResult indicating success or failure.

      1.0.0

      const config = { name: 'app', version: 1 };
      (await writeJsonFile('/config.json', config))
      .inspect(() => console.log('Config saved'));