Code Monkey home page Code Monkey logo

nodejs-disks's Introduction

Hi there ๐Ÿ‘‹

My name is Shaun and I am a developer from Australia ๐Ÿ‡ฆ๐Ÿ‡บ

You can find me on Mastodon ๐Ÿ˜

nodejs-disks's People

Contributors

jbetancur avatar shaun-h avatar silentrob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nodejs-disks's Issues

Return inode stats in addition to disk space.

Maybe with an additional parameter.
iOS return in df by default
Linux needs df -i

Currently when using docker and you deploy repeatedly an image for each deployment it is easy to get out of inodes instead of actual disk space.

It would be nice to be able to use this npm module to find when you are low of inodes and run a cleanup task.

CentOS fix

CentOS 6 default 'df' output can't be parsed properly.
Replacing all occurrences of 'df |' with 'df -P|' fixes problem

Windows fork

How's the windows support coming along?
What do you think of https://github.com/apla/nodejs-disks?
Your module is the only one that produces consistent results for Mac and Linux. Somehow, I thought I was able to install it on Windows 10. Tried to install it on Windows 7 and realized that there was an actual os block on it.

Thanks.

On OS X (I suppose on linux too) returns wrong mount point if space used in drive's name

If, for example, my drive name would be some data, then nodejs-disks interprets mount point as /Volumes/some. This happens because mount point searching algorithm prints with awk 6th parameter.
I suggest (it is my quick and dirty hack because I do not know awk) replacing this line
'df | grep ' + drive + ' | awk \'{print $6}\''
with this
'df | grep ' + drive + ' | grep -oh \' /.*\' | grep -oh \'/.*\''

If mount point has a space, the whole mount point isn't parsed correctly

It looks like the mount point splits the string by space and returns the first part, for example, if the mount point is NO NAME then the mount point of that disk would be NO, example output below:

{ 
  used: '2.34 MB',
  available: '1.84 GB',
  mountpoint: '/Volumes/NO',
  freePer: '100',
  usedPer: '0',
  total: '1.84 GB',
  drive: '/dev/disk2s1' 
}

Volumes available

luke:/ $ ls -lah /Volumes

drwxrwxr-x  74 root    admin        2.5K 12 Oct 10:34 Dev
drwxrwxrwx@  1 luke    1451579101    16K 31 Dec  1979 NO NAME
lrwxr-xr-x   1 root    admin          1B  5 Oct 14:08 OSX -> /

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.