diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2019-12-04 18:04:30 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2019-12-04 18:04:30 +0100 |
commit | fcc2328a3bf49eb5310413058cc9ebaf8e7819f8 (patch) | |
tree | c6faabae8badd96455453b72472ac08a2fe0b1c2 /docker/netiquette/src/io/files.mjs | |
parent | 0b3eb8ec1b3ba3691410744f6397437c9832e74d (diff) | |
download | infrastructure-fcc2328a3bf49eb5310413058cc9ebaf8e7819f8.tar.gz infrastructure-fcc2328a3bf49eb5310413058cc9ebaf8e7819f8.zip |
WIP netiquette
Diffstat (limited to 'docker/netiquette/src/io/files.mjs')
-rw-r--r-- | docker/netiquette/src/io/files.mjs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/docker/netiquette/src/io/files.mjs b/docker/netiquette/src/io/files.mjs new file mode 100644 index 0000000..c3eca1b --- /dev/null +++ b/docker/netiquette/src/io/files.mjs @@ -0,0 +1,8 @@ +'use strict' + +import fs from 'fs' + +export const readFile = (file, opts) => + new Promise((resolve, reject) => + fs.readFile(file, opts, (err, data) => + err ? reject(err) : resolve(data))) |