to-read-file
TypeScript icon, indicating that this package has built-in type declarations

1.5.5 • Public • Published

Read a file content by glob patterns

NPM Version NPM Version NPM package ( download / month ) Follow @mastercorg Github release actions


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
}

NPM Version

Package Sidebar

Install

npm i to-read-file

Homepage

aron.tw

Weekly Downloads

1

Version

1.5.5

License

MIT

Unpacked Size

7.57 kB

Total Files

5

Last publish

Collaborators

  • 1aron