Created
January 26, 2018 10:19
-
-
Save juliangruber/1298d38a991748284e2745a3642d8f7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const src = `/tmp/${Math.random()}` | |
Dat(src, (err, dat) => { | |
if (err) throw err | |
dat.archive.writeFile('/dat.json', 'hi', err => { | |
if (err) throw err | |
console.log(fs.readFileSync(`${src}/dat.json`)) // => empty | |
dat.archive.readFile('/dat.json', (err, data) => { | |
if (err) throw err // => error (couldn't satisfy length) | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment