readify 9.0.0 → 10.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ChangeLog CHANGED
@@ -1,3 +1,24 @@
1
+ 2024.08.16, v10.0.1
2
+
3
+ feature:
4
+ - cba73a1 readify: @cloudcmd/formatify v2.0.0
5
+ - 76b6045 readify: putout v36.0.3
6
+ - a4597a1 readify: eslint v9.9.0
7
+ - 0511e66 readify: c8 v10.1.2
8
+
9
+ 2024.03.29, v10.0.0
10
+
11
+ feature:
12
+ - 2b6413c readify: drop support of node < 18
13
+ - ff9b38a readify: eslint-plugin-n v16.6.2
14
+ - 300ac78 readify: eslint-plugin-putout v22.5.0
15
+ - 2de9bc7 readify: madrun v10.0.1
16
+ - 53810f6 readify: supertape v10.5.0
17
+ - 943f96a readify: putout v35.7.6
18
+ - f26b1cf readify: nodemon v3.1.0
19
+ - 3e6e321 readify: eslint v8.57.0
20
+ - d92788a readify: c8 v9.1.0
21
+
1
22
  2021.03.01, v9.0.0
2
23
 
3
24
  feature:
package/README.md CHANGED
@@ -1,12 +1,10 @@
1
- # Readify [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
1
+ # Readify [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
2
2
 
3
3
  [NPMIMGURL]: https://img.shields.io/npm/v/readify.svg?style=flat
4
4
  [BuildStatusURL]: https://github.com/coderaiser/readify/actions?query=workflow%3A%22Node+CI%22 "Build Status"
5
5
  [BuildStatusIMGURL]: https://github.com/coderaiser/readify/workflows/Node%20CI/badge.svg
6
- [DependencyStatusIMGURL]: https://img.shields.io/david/coderaiser/readify.svg?style=flat
7
6
  [LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat
8
7
  [NPMURL]: https://npmjs.org/package/readify "npm"
9
- [DependencyStatusURL]: https://david-dm.org/coderaiser/readify "Dependency Status"
10
8
  [LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License"
11
9
  [CoverageURL]: https://coveralls.io/github/coderaiser/readify?branch=master
12
10
  [CoverageIMGURL]: https://coveralls.io/repos/coderaiser/readify/badge.svg?branch=master&service=github
@@ -52,7 +50,10 @@ console.log(data);
52
50
  }],
53
51
  });
54
52
 
55
- readify('/', {type: 'raw'}).then(console.log);
53
+ readify('/', {
54
+ type: 'raw',
55
+ }).then(console.log);
56
+
56
57
  // output
57
58
  ({
58
59
  path: '/',
@@ -66,7 +67,12 @@ readify('/', {type: 'raw'}).then(console.log);
66
67
  }],
67
68
  });
68
69
 
69
- readify('/', {type: 'raw', sort: 'size', order: 'desc'}).then(console.log);
70
+ readify('/', {
71
+ type: 'raw',
72
+ sort: 'size',
73
+ order: 'desc',
74
+ }).then(console.log);
75
+
70
76
  // output
71
77
  ({
72
78
  path: '/',
package/lib/readdir.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const {join, extname} = require('path');
4
- const {readdir} = require('fs/promises');
3
+ const {join, extname} = require('node:path');
4
+ const {readdir} = require('node:fs/promises');
5
5
 
6
6
  const tryToCatch = require('try-to-catch');
7
7
  const superstat = require('superstat');
@@ -73,4 +73,3 @@ function getType({name, isDir, isLink}) {
73
73
 
74
74
  return `${type}${link}`;
75
75
  }
76
-
package/lib/readify.js CHANGED
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ const process = require('node:process');
4
+
3
5
  const format = require('format-io');
4
6
  const currify = require('currify');
5
7
  const tryToCatch = require('try-to-catch');
@@ -7,14 +9,12 @@ const tryToCatch = require('try-to-catch');
7
9
  const sortify = require('@cloudcmd/sortify');
8
10
  const formatify = require('@cloudcmd/formatify');
9
11
 
12
+ const readdir = require('./readdir');
10
13
  const WIN = process.platform === 'win32';
11
-
12
- const ifRaw = currify(_ifRaw);
13
- const replaceProperty = currify(_replaceProperty);
14
-
14
+ const isUndefined = (a) => typeof a === 'undefined';
15
15
  const nicki = !WIN && require('nicki');
16
-
17
- const readdir = require('./readdir');
16
+ const replaceProperty = currify(_replaceProperty);
17
+ const ifRaw = currify(_ifRaw);
18
18
  const isString = (a) => typeof a === 'string';
19
19
 
20
20
  module.exports = readify;
@@ -97,7 +97,7 @@ function _replaceProperty(obj, prop, item) {
97
97
  const n = item[prop];
98
98
  const data = obj[n];
99
99
 
100
- if (typeof data === 'undefined')
100
+ if (isUndefined(data))
101
101
  return item;
102
102
 
103
103
  return {
@@ -105,4 +105,3 @@ function _replaceProperty(obj, prop, item) {
105
105
  [prop]: data,
106
106
  };
107
107
  }
108
-
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "readify",
3
- "version": "9.0.0",
3
+ "version": "10.0.1",
4
+ "type": "commonjs",
4
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
6
  "description": "Read directory content with file attributes: size, date, owner, mode",
6
7
  "homepage": "http://github.com/coderaiser/readify",
@@ -19,7 +20,7 @@
19
20
  "watcher": "madrun watcher"
20
21
  },
21
22
  "dependencies": {
22
- "@cloudcmd/formatify": "^1.0.0",
23
+ "@cloudcmd/formatify": "^2.0.0",
23
24
  "@cloudcmd/sortify": "^2.0.0",
24
25
  "currify": "^4.0.0",
25
26
  "format-io": "^2.0.0",
@@ -43,20 +44,17 @@
43
44
  "license": "MIT",
44
45
  "main": "lib/readify.js",
45
46
  "engines": {
46
- "node": ">=14"
47
+ "node": ">=18"
47
48
  },
48
49
  "devDependencies": {
49
- "@cloudcmd/stub": "^3.0.0",
50
- "c8": "^7.6.0",
51
- "coveralls": "^3.0.0",
52
- "eslint": "^7.0.0",
53
- "eslint-plugin-node": "^11.0.0",
54
- "eslint-plugin-putout": "^7.2.1",
55
- "madrun": "^8.0.0",
50
+ "c8": "^10.1.2",
51
+ "eslint": "^9.9.0",
52
+ "eslint-plugin-putout": "^22.5.0",
53
+ "madrun": "^10.0.1",
56
54
  "mock-require": "^3.0.2",
57
- "nodemon": "^2.0.1",
58
- "putout": "^15.4.3",
59
- "supertape": "^5.0.0",
55
+ "nodemon": "^3.1.0",
56
+ "putout": "^36.0.3",
57
+ "supertape": "^10.5.0",
60
58
  "try-catch": "^3.0.0"
61
59
  },
62
60
  "publishConfig": {