Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-express-reload

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-express-reload

Helps to refresh your application after changes. Reload application server (hosting and cloud), kill process and install NPM packages online

  • 0.1.22
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source



node-express-reload (Natan Cabral)

node-express-reload

Reload application server (hosting and cloud), kill process and install NPM packages online
  • Helps to refresh your application after changes
  • Automaticly reload your express.js server without bringing down the server
  • Reload server
  • Kill process
  • Kill port
  • List pid processes
  • List, fix and audit packages
  • Install new packages (get method)

WARNING: Do not use the development server in a production environment.

Install

NPM

npm install node-express-reload

Example 1 (reloaded manually)

view code example

const express = require("express");
const app = express();
const PORT = 8080;

// ** Secure change ** 
// ** change route /ner to /any-another-word **
app.use('/ner', require("node-express-reload")({
  username: 'admin', // if not defined, your username will be admin
  password: 'NeR777#',
  serverfile: __filename,
}));

// Open options 
// http://localhost:8080/ner/
// http://localhost:8080/any-another-word/
// Reloaded manually
// http://localhost:8080/ner/reload/
// http://localhost:8080/any-another-word/reload

app.get("/", (req, res) => res.send(`I'm pid ${process.pid} and port ${PORT}`));
app.listen(PORT);

Example 2 (without bringing down the server)

view code example

Silent reload module (express router)

const express = require("express");
const app = express();
const requireWatcher = require("node-express-reload")('require-watcher');
const PORT = 8080;

// silent reload
app.use('/home', requireWatcher( __dirname + '/home/index.js')) // or only '/home/'

app.get("/", (req, res) => res.send(`I'm pid ${process.pid} and port ${PORT}`));
app.listen(PORT);

Example 3 (watcher files)

view code example

const express = require("express");
const app = express();
const PORT = 8080;

app.use('/ner', require("node-express-reload")({
  serverfile: __filename,
  watcher: ['.'], // {array}  __filename | . | ./ | index.js | /path-name | . (dot is all depth files)
  depth: 10,
}));

app.get("/", (req, res) => res.send(`I'm pid ${process.pid} and port ${PORT}`));
app.listen(PORT);

Another resource to management

Screens

node-express-reload (Natan Cabral)

node-express-reload (Natan Cabral)

node-express-reload (Natan Cabral)

node-express-reload (Natan Cabral)

node-express-reload (Natan Cabral)

GET Method

GET http://localhost:8080/ner/reload/
GET http://localhost:8080/ner/kill/
GET http://localhost:8080/ner/kill/PID (pid is a number)
GET http://localhost:8080/ner/npm/i/pdfkit-table,cors

Actions

routeractionexample
/ner/killkill owner processhttp://localhost:8080/ner/kill
/ner/kill/:pid?kill processhttp://localhost:8080/ner/kill/123456
/ner/reload/:pid?kill process and restarthttp://localhost:8080/ner/reload
/ner/listpid listhttp://localhost:8080/ner/list
/ner/list-allbig pid listhttp://localhost:8080/ner/listall
/ner/pidshow process id (PID)http://localhost:8080/ner/pid
/ner/npm/:type/:packagesInstall and uninstall packages. type: i or u.http://localhost:8080/ner/npm/i/pdfkit-table,cors
/ner/npm/fixnpm fixhttp://localhost:8080/ner/npm/fix
/ner/npm/lsnpm lshttp://localhost:8080/ner/npm/ls
/ner/npm/auditnpm audithttp://localhost:8080/ner/npm/audit
/ner/npm/installnpm install package.jsonhttp://localhost:8080/ner/npm/install

Options

Soon.

License

The MIT License.

Author

Natan Cabral
natancabral@hotmail.com
https://github.com/natancabral/

Thank you

Keywords

FAQs

Package last updated on 04 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc