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

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

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

Last synced: 8 months ago
JSON representation

Promise that returns the size of a file or directory as string.

Awesome Lists containing this project

README

          

# stat-size-text

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

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

## Installation

stat-size-text on npm

```bash
npm install --save stat-size-text@^1.0.0
```

stat-size-text on Yarn

```bash
yarn add stat-size-text@^1.0.0
```

@jaid/stat-size-text 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-text@^1.0.0
```

## Example

```javascript
import statSizeText from "stat-size-text"

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

Variable `result` will be:

```javascript
"129 B"
```

## Development

Setting up:
```bash
git clone git@github.com:jaid/stat-size-text.git
cd stat-size-text
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-text/master/license.txt)
Copyright © 2020, Jaid \ (https://github.com/jaid)