lib/commands/plugins/remove.js   A
last analyzed

Complexity

Total Complexity 4
Complexity/F 2

Size

Lines of Code 21
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 4
c 1
b 0
f 0
nc 1
mnd 1
bc 4
fnc 2
dl 0
loc 21
rs 10
bpm 2
cpm 2
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A module.exports 0 17 2
1
/*
2
 * Copyright (c) 2018 Includable.
3
 * Created by Thomas Schoffelen.
4
 */
5
6
const uninstall = require('spawn-npm-install').uninstall
7
const Plugins = require('../../util/Plugins')
8
const output = require('../../output')
9
10
module.exports = function (name) {
11
  if (name.indexOf('cli-') < 0) {
12
    name = '@includable/cli-' + name
13
  }
14
15
  uninstall(name, {
16
    cwd: Plugins.directory,
17
    noShrinkwrap: true,
18
    production: true,
19
    noBinLinks: true,
20
    save: true
21
  }, function (err) {
22
    if (err) {
23
      output.errSimple(err.message)
24
    }
25
  })
26
}
27