BoolJS/booljs-mongoose

View on GitHub
lib/reader.js

Summary

Maintainability
A
0 mins
Test Coverage
'use strict';

const { join } = require('path');
const { readFile } = require('fs');

module.exports = filepath => new Promise((resolve, reject) => {
    readFile(join(require.resolve('..'), '..', filepath), (error, data) => {
        if (error) {
            return reject(error);
        }

        return resolve(data.toString());
    });
});