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.
16 lines
329 B
16 lines
329 B
'use strict';
|
|
|
|
const path = require('path');
|
|
const getSize = require('./');
|
|
|
|
if (!process.env.FOLDER) {
|
|
throw new Error('FOLDER env var needed');
|
|
}
|
|
|
|
getSize(path.resolve(process.env.FOLDER), (err, size) => {
|
|
if (err) { throw err; }
|
|
|
|
console.log(size + ' bytes');
|
|
console.log((size / 1024 / 1024).toFixed(2) + ' Mb');
|
|
});
|