react-native-lite-fs

0.0.7 • Public • Published

react-native-lite-fs

Install

npm install --save react-native-lite-fs

API

type Callback = (error: Error, result: any)=> any;
type Path = string;
type Content = Buffer | string | ArrayBuffer;
exists (p: Path)=> Promise
  • 0 不存在
  • 1 文件夹
  • 2 文件
stat (p: Path)=> Promise<{length: number, ctime: number, mtime: number, flag: number}>

Android 中没有 ctime;

mkdir (p: Path, auto: boolean = false)=> Promise
touch (p: Path, auto: bool)=> Promise
readir (p: Path)=> Promise
copy (src: Path, to: Path)=> Promise
move (src: Path, to: Path=> Promise
remove (item: Path)=> Promise
writeFile (p: Path, content: Content)=> Promise

返回写入的字节数

readFile (p: Path)=> Promise
open (p: Path)=> Promise

File

close ()=> Promise
tell ()=> Promise
seek (offset = 0, )=> Promise
read (length: number = DEFAULT_BUFFER_LENGTH, )=> Promise
write (content: Content, )=> Promise
truncate (length: number, )=> Promise

Readme

Keywords

Package Sidebar

Install

npm i react-native-lite-fs

Weekly Downloads

8

Version

0.0.7

License

Apache-2.0

Last publish

Collaborators

  • littocats