Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/jaid/stat-size

Promise that returns the size of a file or directory.
https://github.com/jaid/stat-size

bytes directory disk file folder fs node node-js promise size utility volume

Last synced: 12 days ago
JSON representation

Promise that returns the size of a file or directory.

Awesome Lists containing this project

README

        

# stat-size

License Sponsor stat-size
Build status Commits since v1.0.2 Last commit Issues
Latest version on npm Dependents Downloads

**Promise that returns the size of a file or directory.**

## Installation

stat-size on npm

```bash
npm install --save stat-size@^1.0.2
```

stat-size on Yarn

```bash
yarn add stat-size@^1.0.2
```

@jaid/stat-size on GitHub Packages
(if [configured properly](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-npm-for-use-with-github-packages))

```bash
npm install --save @jaid/stat-size@^1.0.2
```

## Example

```javascript
import statSize from "stat-size"

const result = statSize("pikachu_8x8.png")
```

Variable `result` will be:

```javascript
129
```

## Development

Setting up:
```bash
git clone [email protected]:jaid/stat-size.git
cd stat-size
npm install
```
Testing:
```bash
npm run test:dev
```
Testing in production environment:
```bash
npm run test
```

## License
[MIT License](https://raw.githubusercontent.com/jaid/stat-size/master/license.txt)
Copyright © 2020, Jaid \ (https://github.com/jaid)