Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including notify-used-or-free with all npm packages installed. Try it out:

var notifyUsedOrFree = require("notify-used-or-free")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

notify-used-or-free v0.0.4

Notify by email of free disk space on server or when a certain amount of disk space has been used.




$ npm install -g notify-used-or-free

Notify by email or sms of free disk space on server or when a certain amount of disk space has been used.

Suggestion: Install and run notify-used-or-free on your server using a daily cron job that runs around lunch time, so you can fix any issues after lunch.

How to use

show help

Usage: notify-used-or-free <disk> <options>

notify-used-or-free / -a 5GB -R user@email.example -u username -p password -S sendgrid


-V, --version                                                                                                          output the version number
-i, --info                                                                                                             print data info
-r, --round                                                                                                            return integer instead of floating point number eg. 1GB not 1.23GB
-d, --detect [<used>|<free>]                                                                                           used or free space, free by default
-m, --modifier [<less>|<more>]                                                                                         less or more than detected amount, less by default
-a, --amount <10GB>                                                                                                    amount of space used or free on disk, eg. 1024MB, 1TB; 5GB by default
-t, --template <{{name}} detected {{disk}} has {{out}} {{detect}} on {{hostname}}, which is {{modifier}} than {{in}}>  
-s, --subject <[LOW|HIGH] DISK SPACE>                                                                                  send email with this subject title
-R, --recipients [email@exam.ple, send@here.too]                                                                       email addresses to send message to
-e, --sender-email <sender@exam.ple>                                                                                   sender email address
-n, --sender-name <NotifyUsedOrFree>                                                                                   sender name
-S, --service <Mailgun|Mailjet|Postmark|SendGrid|SES|SES-US-EAST-1|SES-US-WEST-2|SES-EU-WEST-1|Sparkpost>              service to use, instead of using host:port
-H, --host <host.server>                                                                                               host of mail server, or provide service instead
-P, --port <587>                                                                                                       port of mail server, or provide service instead
-c, --secure                                                                                                           secure connection to send email, true by default
-u, --user <name>                                                                                                      username on mail server
-p, --pass <word>                                                                                                      password on mail server for username
-L, --log <logDir>                                                                                                     save to logfile in <logDir>/.notify-used-or-free.log
-X, --debug                                                                                                            show debug messages, false by default
-j, --json                                                                                                             json log output, false by default
-q, --quite                                                                                                            suppress logger output, false by default
-A, --account-sid <ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX>                                                                 valid Twilio account sid
-T, --auth-token <your_auth_token>                                                                                     valid Twilio auth token
-O, --phones [+13105551234, +12065551234]                                                                              phone numbers to send message to
-o, --sender-phone <+13105551234>                                                                                      valid Twilio phone number
-h, --help                                                                                                             output usage information

run command

using sendgrid --service, no --host and --port params required

$ notify-used-or-free / -a 10GB -R -S sendgrid -u username -p password

using --host and --port, instead of a --service

$ notify-used-or-free / -a 10GB -R -H smtp.mail.server -P 587 -u username -p password


$ cd notify-used-or-free/
$ npm i -g
$ npm link


$ npm test


MIT © Alex Goretoy

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free