🚨 Shai-Hulud Strikes Again:More than 500 packages and 700+ versions compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@planetarium/check-free-space

Package Overview
Dependencies
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@planetarium/check-free-space

Checks free space.

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
0
-100%
Maintainers
5
Weekly downloads
 
Created
Source

@planetarium/check-free-space

This package uses native OS APIs to get free size available on specified path. It is powered by fs2 under the hood.

APIs

getFreeSpace

import { getFreeSpace } from '@planetarium/check-free-space';

getFreeSpace('./')

Gets free space available on specified path. It returns BigInt.

checkFreeSpace

import { checkFreeSpace } from '@planetarium/check-free-space';

if (checkFreeSpace('./', BigInt(1_000_000_000_000))) {
  console.log('Enough space available');
}

Checks if there are enough space to store specified amount of bytes in a specified path. You can provide a BigInt, string, or number value for bytes.

If you passed a string as bytes, it may throw if the string cannot be parsed as numerical value. If BigInt is passed, it will be converted to Rust u64 during the process.

FAQs

Package last updated on 26 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts