📅  最后修改于: 2022-03-11 15:01:53.445000             🧑  作者: Mango
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');
}