Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. - /MyApp
  2. - /ios
  3. - data.json
  4. - index.ios.js
  5.  
  6. {
  7. "words": [
  8. {"word": "xxx", "done": false} // and more...
  9. ]
  10. }
  11.  
  12. var RNFS = require('react-native-fs');
  13. // create a path you want to write to
  14. var path = RNFS.DocumentDirectoryPath + '/test.txt';
  15.  
  16. // write the file
  17. RNFS.writeFile(path, 'Lorem ipsum dolor sit amet', 'utf8')
  18. .then((success) => {
  19. console.log('FILE WRITTEN!');
  20. })
  21. .catch((err) => {
  22. console.log(err.message);
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement