Home > @momentum-design/common > Json > read
Json.read() method
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Read a file as json at the provided target path.
Signature:
static read(target: string, encoding?: BufferEncoding): Promise<any>;
Parameters
Parameter | Type | Description |
---|---|---|
target | string | Path to the file to attempt to read as json. |
encoding | BufferEncoding | (Optional) Buffer encoding for the target file. |
Returns:
Promise<any>
- Promise resolving in a json object read from the target file.