happy-opfs
    Preparing search index...

    Function writeJsonFileSync

    • Synchronous version of 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 VoidIOResult

      A VoidIOResult indicating success or failure.

      writeJsonFile for the async version.

      1.1.0

      const config = { name: 'app', version: 1 };
      writeJsonFileSync('/config.json', config);