1.1.6 • Published 11 months ago

@mxydl2009/dir-size v1.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

dir-size

calculate the size of all files of a given directory, you can use it by cli or npm package.

Install

// install locally
$ npm install @mxydl2009/dir-size
// install globally
$ npm install @mxydl2009/dir-size -g

Usage

usage for npm package

// foo.js
const { size } = require('@mxydl2009/dir-size');

// size of current working directory, exclude node_modules directory
console.log(await size('./', 'node_modules'));

usage for cli

# calculate size of current working directory
$ dsize --dir . --exclude node_modules

API

size(path, exclude)

Returns a Promise<number> of all files size of path.

sizeSync(path, exclude)

Returns a number of all files size of path.

Options

path<string>

require absolute path or relative path, when relative path is relative to the current working directory

exclude<string>

option argument, require the whole directory name, exclude the directory that you don't want to include

1.1.6

11 months ago

1.1.5

11 months ago

1.1.4

11 months ago

1.1.3

11 months ago

1.1.2

11 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago