GithubHelp home page GithubHelp logo

diskinfo's People

Contributors

benoitgauthier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

diskinfo's Issues

Add macOS support

I tryed this under windows machine and works perfectly, on mac npm don't let me install.

So I downloaded the lib and runned under mac and it works with some imprecisions, so adding macOS support can be possible if you want.

diskinfo in setInterval repeat the previous value

Example:

const diskinfo = require('diskinfo');
setInterval(function(){
 diskinfo.getDrives(function(err, aDrives) {
  		if(!err){
  			  console.log(aDrives)
  		}
 });
},2000)

/output of the console.log after repeat twice
[ { filesystem: '/dev/mapper/vg_root-LogVol01',
blocks: '36819652',
used: '28908684',
available: '6033976',
capacity: '83%',
mounted: '/' },
{ filesystem: 'tmpfs',
blocks: '16441032',
used: '28964',
available: '16412068',
capacity: '1%',
mounted: '/dev/shm' } ]
[ { filesystem: '/dev/mapper/vg_root-LogVol01',
blocks: '36819652',
used: '28908684',
available: '6033976',
capacity: '83%',
mounted: '/' },
{ filesystem: 'tmpfs',
blocks: '16441032',
used: '28964',
available: '16412068',
capacity: '1%',
mounted: '/dev/shm' },
{ filesystem: '/dev/mapper/vg_root-LogVol01',
blocks: '36819652',
used: '28908684',
available: '6033976',
capacity: '83%',
mounted: '/' },
{ filesystem: 'tmpfs',
blocks: '16441032',
used: '28964',
available: '16412068',
capacity: '1%',
mounted: '/dev/shm' } ]

diskinfo in setInterval or setTimeout always returns the same value

The module always returns the same value, even when the size on disk has changed.

Example:

 var d           = require('diskinfo');

var interval = setTimeout(du, 2500);

function du () {
d.getDrives(function (error, result){
    console.log(result);
});
interval = setTimeout(du, 2500)
}

function stopinterval() {
clearTimeout(interval);

}

/output of the console.log

[ { filesystem: '/dev/loop0',
blocks: '2519792',
used: '2215180',
available: '176612',
capacity: '93%',
mounted: '/' },
{ filesystem: '/dev/block/vold/259:3',
blocks: '12063840',
used: '10099392',
available: '1964448',
capacity: '84%',
mounted: '/mnt/sdcard0' } ]
[ { filesystem: '/dev/loop0',
blocks: '2519792',
used: '2215180',
available: '176612',
capacity: '93%',
mounted: '/' },
{ filesystem: '/dev/block/vold/259:3',
blocks: '12063840',
used: '10099392',
available: '1964448',
capacity: '84%',
mounted: '/mnt/sdcard0' } ]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.