to-read-file
v1.5.5
Published
Read a file content by glob patterns
Downloads
11
Readme
Getting Started
npm install to-read-file
Usage
readFile(source?: string | fg.Pattern[], options?: Options): Buffer
readFiles(source?: string | fg.Pattern[], options?: Options): Buffer
a.json
{ "name": "a" }
b.json
{ "name": "b" }
import readFile, { readFiles } from 'to-read-file'
readFile('a.*').toString()
// { "name": "a" }
readFiles('*.json').toString()
// { "name": "a" },{ "name": "b" }
Options
Inherited from fast-glob options
{
cwd: process.cwd()
}
With additional options:
{
encoding?: null
flag?: string
}