deps: remove byte-size · npm/cli@a1bdbea (original) (raw)

1

1

`const tar = require('tar')

`

2

2

`const ssri = require('ssri')

`

3

3

`const npmlog = require('npmlog')

`

4

``

`-

const byteSize = require('byte-size')

`

``

4

`+

const formatBytes = require('./format-bytes.js')

`

5

5

`const columnify = require('columnify')

`

6

6

``

7

7

`const logTar = (tarball, opts = {}) => {

`

`@@ -11,9 +11,9 @@ const logTar = (tarball, opts = {}) => {

`

11

11

`log.notice('=== Tarball Contents ===')

`

12

12

`if (tarball.files.length) {

`

13

13

`log.notice('', columnify(tarball.files.map((f) => {

`

14

``

`-

const bytes = byteSize(f.size)

`

``

14

`+

const bytes = formatBytes(f.size, false)

`

15

15

`return (/^node_modules//.test(f.path)) ? null

`

16

``

`` -

: { path: f.path, size: ${bytes.value}${bytes.unit} }

``

``

16

`` +

: { path: f.path, size: ${bytes} }

``

17

17

`}).filter(f => f), {

`

18

18

`include: ['size', 'path'],

`

19

19

`showHeaders: false,

`

`@@ -28,8 +28,8 @@ const logTar = (tarball, opts = {}) => {

`

28

28

`{ name: 'name:', value: tarball.name },

`

29

29

`{ name: 'version:', value: tarball.version },

`

30

30

`tarball.filename && { name: 'filename:', value: tarball.filename },

`

31

``

`-

{ name: 'package size:', value: byteSize(tarball.size) },

`

32

``

`-

{ name: 'unpacked size:', value: byteSize(tarball.unpackedSize) },

`

``

31

`+

{ name: 'package size:', value: formatBytes(tarball.size) },

`

``

32

`+

{ name: 'unpacked size:', value: formatBytes(tarball.unpackedSize) },

`

33

33

`{ name: 'shasum:', value: tarball.shasum },

`

34

34

`{

`

35

35

`name: 'integrity:',

`