@alevnyacow/get-directory-files
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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;

Package Sidebar

Install

npm i @alevnyacow/get-directory-files

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

7.54 kB

Total Files

11

Last publish

Collaborators

  • alevnyacow