@alevnyacow/get-directory-files
v1.0.0
Published
Provides files content and names in given directory
Downloads
11
Maintainers
Readme
get-directory-files
Provides file names and content in given directory.
Usage
import { readDirectoryFiles } from "@alevnyacow/get-directory-files";
const directoryPath = "some_path";
const result = readDirectoryFiles(directoryPath);
/**
* result will be an object of following schema:
* {
* ["file_a.txt"]: "content of file_a",
* ["file_b.txt"]: "content of file_b"
* }
*/
Exported types
type FilesData = { [fileName: string]: string };
Package API
function readDirectoryFiles(directoryPath: string): FilesData;