1.2.0 • Published 7 years ago

textfile v1.2.0

Weekly downloads
41
License
ISC
Repository
github
Last release
7 years ago

textfile

引用

var textfile = require('textfile')

读取文件

textfile.read(path,type,cb)

textfile.read(path,type).then(cb)
  • path 必选 文件路径
  • type 可选 文件类型(xml/json/string)
  • cb 可选 回调函数,传入读取到的数据,xml/json类型会转为对象,xml对象操作请参考:https://www.npmjs.com/package/xmldom

写入文件

textfile.write(path,data,type,cb)

textfile.write(path,data,type).then(cb)
  • path 必选 文件路径
  • data 必选 要写入的数据
  • type 可选 文件类型(xml/json/string)
  • cb 可选 回调函数,失败会传入err对象
1.2.0

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago