Skip to content

Commit

Permalink
Remove fs-extra and use Bluebird.promisify.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Nov 6, 2019
1 parent dfe7fb4 commit 1f169fe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 26 deletions.
5 changes: 3 additions & 2 deletions lib/resolver.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
const path = require('path');
const url = require('url');
const fs = require('fs-extra');
const fs = require('fs');
const request = require('request');
const mime = require('mime');
const Bluebird = require('bluebird');
Expand All @@ -11,6 +11,7 @@ const reduce = require('lodash.reduce');
const globby = require('globby');

const cache = {};
const readFile = Bluebird.promisify(fs.readFile);

function isUrl(resource) {
return /(^\/\/)|(:\/\/)/.test(resource);
Expand Down Expand Up @@ -97,7 +98,7 @@ function requestAsync(resource, opts = {}) {
* @returns {Promise} Promise
*/
function readAsync(resource) {
return fs.readFile(resource).then(body => {
return readFile(resource).then(body => {
const mimeType = mime.getType(resource);

debug('Fetched:', resource);
Expand Down
23 changes: 0 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"dependencies": {
"bluebird": "^3.7.1",
"debug": "^4.1.1",
"fs-extra": "^8.1.0",
"globby": "^8.0.2",
"lodash.defaults": "^4.2.0",
"lodash.map": "^4.6.0",
Expand Down

0 comments on commit 1f169fe

Please sign in to comment.