undyno
v1.0.2
Published
Activates/Deactivates an app running on the PaaS Heroku without wasting free dynos in one go.
Downloads
4
Readme
WHAT IT IS
Activates/Deactivates an app that is deployed on the PaaS platform Heroku without wasting any dynos in one go. Less to write, faster to accomplish.
INSTALLATION
Node package manager NPM is required.
heroku-undyno.js
is working with the official Heroku CLI, install it:npm i -g heroku
- Then install
undyno
using NPM:npm i undyno --save
- Create a JavaScript file with the following content that loads and sets up the module:
const Heroku = require('./heroku-undyno.js') // imports the module
const undyno = new Heroku({
app: 'myApp', // the app's name you specified on Heroku
resource: 'Worker' // the process dyno type (there exist only 'Worker" or 'web')
})
undyno.exec() // executes the code together with the settings made above
Or just copy the demo file and configure.
USAGE
Assuming you created a file called undyno.js
in the root folder of your project:
Open the terminal. The syntax is:
node undyno -<option>
Choose an option to execute it.
Example: node undyno -off
This turns off the app completely by turning on maintenance mode and deactivates the process resource (Dyno) type in one go.
METHODS
const undyno = new Heroku(
app: '<AppNameHere>',
resource: <'Worker' or 'web'>
})
(required) The arguments configure the options upon creating a new instance. The options are used for the Heroku app. For app
use the name of your deployed Heroku app. For resource
chose either Worker
or web
for the dyno process resource type. You may leave this blank and use .config()
later on instead.
undyno.config({
app: '<AppNameHere>',
resource: <'Worker' or 'web'>
})
(optional) Use this method instead if you haven't set the options yet.
undyno.exec()
(required) This method simply executes the code together with the configured options.
OPTIONS
-off
Turns off the app on Heroku by turning on maintenance mode and process resource type off.
-on
Turns the app on again by turning the maintenance mode off and enables the specific resource type defined in the configuration, see installation.
-log
Displays the log of the app in a new terminal window.
-restart
Restarts the app on Heroku.
-dynos
Looks up the remaining dynos and used up resources.
-update
Updates the Heroku CLI (Heroku module required)