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.
- Host: GitHub
- URL: https://github.com/jaid/stat-size-text
- Owner: Jaid
- License: mit
- Created: 2021-01-07T10:38:16.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-07-27T08:29:58.000Z (almost 4 years ago)
- Last Synced: 2025-09-22T12:42:07.246Z (9 months ago)
- Language: JavaScript
- Homepage: https://github.com/Jaid/stat-size-text
- Size: 1.84 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license.txt
Awesome Lists containing this project
README
# stat-size-text
**Promise that returns the size of a file or directory as string.**
## Installation
```bash
npm install --save stat-size-text@^1.0.0
```
```bash
yarn add stat-size-text@^1.0.0
```
(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)