Skip to content
Snippets Groups Projects
Commit 9a34fdf2 authored by OZGCloud's avatar OZGCloud
Browse files

change import of fs-extra

parent 79cee4a7
No related branches found
No related tags found
No related merge requests found
import { readdir, remove } from 'fs-extra';
import { Db, Long, MongoClient, ObjectId } from 'mongodb';
const fsExtra = require('fs-extra');
const Binary = require('mongodb').Binary;
......@@ -317,8 +317,7 @@ function dropCollections(databaseUrl, databaseName, collections) {
}
function countFiles(folderName) {
return fsExtra
.readdir(folderName)
return readdir(folderName)
.then((files) => files.length)
.catch((err) => {
throw new Error(`Counting files failed: ${err.message}`);
......@@ -326,8 +325,7 @@ function countFiles(folderName) {
}
function deleteFolder(folderName: string): void {
return fsExtra
.remove(folderName)
return remove(folderName)
.then(() => {
return null;
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment