Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
422 B

  1. 'use strict';
  2. const path = require('path');
  3. const fs = require('graceful-fs');
  4. const stripBom = require('strip-bom');
  5. const parseJson = require('parse-json');
  6. const pify = require('pify');
  7. const parse = (data, fp) => parseJson(stripBom(data), path.relative('.', fp));
  8. module.exports = fp => pify(fs.readFile)(fp, 'utf8').then(data => parse(data, fp));
  9. module.exports.sync = fp => parse(fs.readFileSync(fp, 'utf8'), fp);