Required Instance Methodtuist.filesystem 0.7.9FileSystem

writeAsJSON(_:at:encoder:)

Given an Encodable instance, it encodes it as a JSON, and writes it at the given path.

FileSystem.swift:227
func writeAsJSON<T>(_ item: T, at: AbsolutePath, encoder: JSONEncoder) async throws where T : Encodable

Parameters

item

Item to be encoded as JSON.

at

Path at which the JSON will be written.

encoder

The JSONEncoder instance to encode the item.