Required Instance Methodtuist.filesystem 0.7.9FileSystem

writeAsJSON(_:at:encoder:options:)

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

FileSystem.swift:235
func writeAsJSON<T>(_ item: T, at: AbsolutePath, encoder: JSONEncoder, options: Set<WriteJSONOptions>) 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.

options

Options to configure the writing of the JSON file.