npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

als-diskinfo

v0.1.1

Published

Cross-platform tool to retrieve detailed disk storage information

Downloads

29

Readme

Als-diskinfo

This utility is a Node.js script to fetch information about disk space on Windows and Linux systems.

Features

Fetches disk information such as total space, used space, and free space. Works on Windows and Linux systems.

Usage

const diskInfo = require('als-diskinfo');
diskInfo().then(disks => console.log(disks)).catch(error => console.error(error));

The function getDisks() returns a Promise that resolves with an array of disk objects. Each disk object contains the following properties:

  • name: The identifier of the disk.
  • size: The total size of the disk in kilobytes.
  • used: The used space on the disk in kilobytes.
  • free: The free space on the disk in kilobytes. mountedOn: (Linux only) The mount point of the disk.

The Promise rejects with an Error if there is an issue in fetching or parsing the disk information.

Limitations

  1. Different Linux systems and df output: This utility parses the output from df -kP, which is relatively standardized across different Linux systems. However, there might be slight variations in the format or set of fields in some systems, especially older or non-standard distributions. While this is unlikely, it is always a good idea to test on the specific system.

  2. Command output encoding: The command output will generally be in the system's encoding, which is typically UTF-8 for many modern operating systems, including most Linux distributions and Windows. However, in rare cases, or if the command outputs text in a specific encoding (for instance, if it generates output in a non-English language), the output might be in a different encoding. In such cases, appropriate encoding would be needed to correctly decode the text.

For these limitations, the best approach would be to test the utility on the target systems to ensure it works as expected and to handle any exceptions that might occur during the parsing of command output.