Skip to content

LittoCats/react-native-lite-fs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

native file system interface for RN.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published