0.5.5 • Published 1 month ago

go-get-folder-size v0.5.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

README 🦉

简体中文 | English

features

motivation

I want to know the folder size quickly, but the nodejs implementation of get-folder-size is slow, so using go implements a recursive get folder size that runs in nodejs and is 7 ~ 20 times faster than the node native solution under normal circumstances。

Usage

npm

install

npm install go-get-folder-size

cli

# Binary go, fastest
npx go-get-folder-size

program

import {
  getFolderSize,
  getFolderSizeBin,
  getFolderSizeWasm,
} from "go-get-folder-size";

const base = "./"; // The directory path you want to get

await getFolderSizeBin(base); // Binary go, fastest

await getFolderSize(base); // native node

await getFolderSizeWasm(base); // Wasm go,slowest
IPC

Suitable for multi-path

import { createGetFolderSizeBinIpc } from "go-get-folder-size";

const { getFolderSizeWithIpc, close } = createGetFolderSizeBinIpc();

Promise.all([
  getFolderSizeWithIpc("./"),
  getFolderSizeWithIpc("../"),
])
  .then((vs) => console.log(vs))
  .finally(close); // Manual close is required

go

cli

go install github.com/markthree/go-get-folder-size
go-get-folder-size

program

# Super invincible fast
go get github.com/markthree/go-get-folder-size
package main

import (
	getFolderSize "github.com/markthree/go-get-folder-size/src"
)

func main() {
	size, err := getFolderSize.Invoke("./") // Concurrent running, invincible fast

  size2 := getFolderSize.LooseInvoke("./") // Sometimes we may encounter inaccessible files, and we can set 'loose' to ignore them
}

loose

Sometimes we may encounter inaccessible files, and we can set loose to ignore them

cli

go-get-folder-size --loose

program

import {
  getFolderSize,
  getFolderSizeBin,
  getFolderSizeWasm,
} from "go-get-folder-size";

const base = "./"; // The directory path you want to get
const pretty = false; // Human readable way
const loose = true;

await getFolderSizeBin(base, pretty, { loose }); // Binary go, fastest

await getFolderSize(base, pretty, { loose }); // native node

await getFolderSizeWasm(base, pretty, { loose }); // Wasm go,slowest

stack

License

Made with markthree

Published under MIT License.

0.5.5

1 month ago

0.5.4

2 months ago

0.5.3

4 months ago

0.5.2

8 months ago

0.5.1

8 months ago

0.5.0

9 months ago

0.3.6

10 months ago

0.3.5

10 months ago

0.4.1

10 months ago

0.3.2

12 months ago

0.4.0

10 months ago

0.3.1

12 months ago

0.4.3

10 months ago

0.3.4

10 months ago

0.4.2

10 months ago

0.3.3

10 months ago

0.0.18

1 year ago

0.2.15

1 year ago

0.2.14

1 year ago

0.2.13

1 year ago

0.2.12

1 year ago

0.2.11

1 year ago

0.2.10

1 year ago

0.2.1

1 year ago

0.1.2

1 year ago

0.2.0

1 year ago

0.1.1

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.9

1 year ago

0.2.8

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.1.3

1 year ago

0.2.5

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.1

1 year ago