📜  反应原生创建文本文件 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:53.445000             🧑  作者: Mango

代码示例1
var RNFS = require('react-native-fs');

var path = `${abolute_path_to_file}/file_name.txt`;

// write the file
try {
    await RNFS.writeFile(absolute_path, 'text content to write to file...', 'utf8');
} catch(e) {
  console.log('Error in writing to text file');
}