docs: read file
This commit is contained in:
@@ -5,6 +5,12 @@
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads a file from path and returns its content as a string.
|
||||||
|
* @param path The path to the file.
|
||||||
|
* @returns {Promise<string>}
|
||||||
|
* @category WorkflowManagement-Storage
|
||||||
|
*/
|
||||||
export const readFile = (path: string): Promise<string> => {
|
export const readFile = (path: string): Promise<string> => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
fs.readFile(path, 'utf8', (err, data) => {
|
fs.readFile(path, 'utf8', (err, data) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user