@techor/fs
TypeScript icon, indicating that this package has built-in type declarations

3.0.23 • Public • Published

A human-friendly file system

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


Getting Started

npm install @techor/fs

Usage

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", ... }

Options

declare type Options = ObjectEncodingOptions & { encoding?: BufferEncoding | null }

NPM Version

/@techor/fs/

    Package Sidebar

    Install

    npm i @techor/fs

    Homepage

    aron.tw

    Weekly Downloads

    168

    Version

    3.0.23

    License

    MIT

    Unpacked Size

    10.1 kB

    Total Files

    11

    Last publish

    Collaborators

    • 1aron