1.0.4 • Published 7 months ago
cd-space v1.0.4
cd-space
cd-space
is a lightweight Node.js module for calculating the size of a folder and providing the result in bytes, kilobytes (KB), and megabytes (MB).
Installation
To install cd-space
, you can use npm or yarn:
npm install cd-space
# or
yarn add cd-space
Usage
// Import the "cd-space" module for calculating folder size.
const cdspace = require("cd-space");
// Define the folder name as a string. For example, you can use "public" here.
const folderName = "public";
// Calculate the size of the specified folder.
const result = cdspace.getSize(folderName);
// Output the result.
console.log(result);
Output
{ BYTES: 29074222, KB: 28392.794921875, MB: 27.727338790893555 }
Author
Satya Prakash Nandy