An open API service indexing awesome lists of open source software.

https://github.com/coderaiser/trammel

Get directory size for node
https://github.com/coderaiser/trammel

cloudcmd javascript nodejs size

Last synced: about 2 months ago
JSON representation

Get directory size for node

Awesome Lists containing this project

README

          

# Trammel [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL]

[NPMIMGURL]: https://img.shields.io/npm/v/trammel.svg?style=flat
[BuildStatusURL]: https://github.com/coderaiser/trammel/actions?query=workflow%3A%22Node+CI%22 "Build Status"
[BuildStatusIMGURL]: https://github.com/coderaiser/trammel/workflows/Node%20CI/badge.svg
[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat
[NPMURL]: https://npmjs.org/package/trammel "npm"
[LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License"

Get directory size.

If you want get realtime size updates use [dirsize](https://github.com/coderaiser/node-dirsize).

## Example

```js
import trammel from 'trammel';

await trammel('.');
// returns
'58.47kb';

await trammel('.', {
type: 'raw',
});

// returns
59_974;

await trammel('do not exist', {
stopOnError: true,
});

// throws
Error;
```

## License

MIT