Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Latest commit

 

History

History
33 lines (22 loc) · 814 Bytes

file-contract.md

File metadata and controls

33 lines (22 loc) · 814 Bytes

File

This is representing the contract which is exposed as part of File class.

// For ES6
import { File } from '@itchef/rg-lib';

// For Non ES6
const { File } = require('@itchef/rg-lib');

const file = new File('./some-path');

Instance Variables

Variable Type Field Type
_path String Required
_data any Optional
_extension String None

Methods

Method Name Return Type Arguments Default
read() File (new Instance)
update(key, value) File (this) key: String, value: any (Only for JSON type data update)
write(path) <string[]> / <Buffer[]> / <fs.Dirent[]> path: String

See the implementation for more info: File.js