MCPcopy Create free account
hub / github.com/Unitech/pm2 / uninstall

Function uninstall

lib/API/Modules/NPM.js:307–325  ·  view source on GitHub ↗
(CLI, module_name, cb)

Source from the content-addressed store, hash-verified

305}
306
307function uninstall(CLI, module_name, cb) {
308 var module_name_only = Utility.getCanonicModuleName(module_name)
309 var proc_path = path.join(cst.DEFAULT_MODULE_PATH, module_name_only);
310 Configuration.unsetSync(cst.MODULE_CONF_PREFIX + ':' + module_name_only);
311
312 CLI.deleteModule(module_name_only, function(err, data) {
313 console.log('Deleting', proc_path)
314 if (module_name != '.' && proc_path.includes('modules') === true) {
315 deleteFolderRecursive(proc_path)
316 }
317
318 if (err) {
319 Common.printError(err);
320 return cb(err);
321 }
322
323 return cb(null, data);
324 });
325}
326
327function getModuleConf(app_name) {
328 if (!app_name) throw new Error('No app_name defined');

Callers 1

installFunction · 0.70

Calls 2

deleteFolderRecursiveFunction · 0.85
cbFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…