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

storage-device-info

v1.4.2

Published

Obtain information about storage devices

Downloads

72

Readme

storage-device-info

Obtain information about storage devices.

This module is installed using node package manager (npm):

# This module contains C++ source code which will be compiled
# during installation using node-gyp.  A suitable build chain
# must be configured before installation.

npm install storage-device-info

It is loaded using the require() function:

var storage = require ("storage-device-info");

Storage information can then be obtained:

storage.getPartitionSpace("c:\\", function(error, space) {
   console.dir(space);
});

storage.getPartitionSpace("/opt", function(error, space) {
   console.dir(space);
});

Using This Module

Currently this module exports only the function getPartitionSpace().

storage.getPartitionSpace(path, callback)

The getPartitionSpace() function obtains space utilisation information for the partition on which the path exists.

For example, on Windows, the c:\\temp directory is located on the c:\\ partition, and so space utilisation information will be obtained for the c:\\ partition.

The callback function is called once space information has been obtained. The following arguments will be passed to the callback function:

  • error - Instance of the Error class, or null if no error occurred
  • space - An object which will have the following attributes:
    • totalMegaBytes
    • freeMegaBytes

The following example obtains space information for the / partition on which the /opt directory is located:

storage.getPartitionSpace("/opt", function(error, space) {
    if (error) {
        console.log(error);
    } else {
        console.log("total: " + space.totalMegaBytes + "\n"
            + "free: " + space.freeMegaBytes + "\n");
    }
});

Example Programs

Example programs are included under the modules example directory.

Changes

Version 1.0.0 - 08/08/2014

  • Initial release

Version 1.0.1 - 08/08/2014

  • Add more keywords to the package.json file

Version 1.0.2 - 15/12/2014

  • Support MAC OS X

Version 1.0.3 - 15/12/2014

  • Unused variables warnings seen during build on MAC OS X

Version 1.1.0 - 10/06/2015

  • Support Node.js 0.12.x using the Native Abstractions for Node interface

Version 1.1.1 - 10/06/2015

  • Update two missed variable instantiations to use NanNew

Version 1.1.2 - 10/06/2015

  • Do not use uv_last_error() as it is not available in 0.12, and do not use and uv_err_t as the types differ between 0.10 and 0.12 due to libuv changes

Version 1.1.3 - 08/08/2015

  • Add version dependency "<2.0.0" for the "nan" module to prevent build failures during installation because of breaking API changes

## Version 1.1.4 - 22/09/2015

  • Host repository on GitHub

Version 1.2.0 - 09/10/2015

  • Support Native Abstractions for Node 2.x

Version 1.3.0 - 15/05/2015

  • Require nan 2.3.x to support node version 6

Version 1.4.0 - 02/05/2018

  • Support Node.js 10

Version 1.4.1 - 06/06/2018

  • Set NoSpaceships Ltd to be the owner and maintainer

Version 1.4.2 - 07/06/2018

  • Remove redundant sections from README.md

License

Copyright (c) 2018 NoSpaceships Ltd [email protected]

Copyright (c) 2014 Stephen Vickers [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Author

Stephen Vickers [email protected]