npm install @techor/fs
readFileSync(filepath: string, options?: Options): Buffer
readFileAsNormalizedStrSync(filepath: string, options?: Options): string
readJSONFileSync(filepath: string, options?: Options): any
writeToFile(filePath: string, data: any, options?: WriteToFileOptions): void
a.json
{ "name": "a" }
b.json
{ "name": "b" }
import { readFileSync } from '@techor/fs'
readFileSync('a.*')
// Buffer
readFileSync('./fewjiogw/wiefoiwe')
// undefined
readFileAsNormalizedStrSync('a.*')
// '{ "name": "a" }'
readJSONFileSync('./package.json')
// { "name": "root", ... }
readJSONFileSync('./package.json')
// { "name": "a", ... }
declare type Options = ObjectEncodingOptions & { encoding?: BufferEncoding | null }