shaun-h / nodejs-disks Goto Github PK
View Code? Open in Web Editor NEWGets current disk information from Server hosting nodejs application
License: MIT License
Gets current disk information from Server hosting nodejs application
License: MIT License
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.
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.
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 \'/.*\''
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 -> /
CentOS 6 default 'df' output can't be parsed properly.
Replacing all occurrences of 'df |' with 'df -P|' fixes problem
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.