size-on-disk

Wrapper over the du command to get a file/folder's size on disk.

Usage no npm install needed!

<script type="module">
  import sizeOnDisk from 'https://cdn.skypack.dev/size-on-disk';
</script>

README

size-on-disk

Wrapper over the du command to get a file/folder's size on disk.

Usage

getSize(process.env.FOLDER || process.cwd(), function(err, bytes) {
  if (err) { throw err; }

  console.log(bytes + ' bytes');
  console.log((bytes / 1024 / 1024).toFixed(2) + ' Mb');
});

License

MIT