readify 9.0.0 → 10.0.0

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,16 @@
1
+ 2024.03.29, v10.0.0
2
+
3
+ feature:
4
+ - 2b6413c readify: drop support of node < 18
5
+ - ff9b38a readify: eslint-plugin-n v16.6.2
6
+ - 300ac78 readify: eslint-plugin-putout v22.5.0
7
+ - 2de9bc7 readify: madrun v10.0.1
8
+ - 53810f6 readify: supertape v10.5.0
9
+ - 943f96a readify: putout v35.7.6
10
+ - f26b1cf readify: nodemon v3.1.0
11
+ - 3e6e321 readify: eslint v8.57.0
12
+ - d92788a readify: c8 v9.1.0
13
+
1
14
  2021.03.01, v9.0.0
2
15
 
3
16
  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,9 @@ 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
  // output
57
57
  ({
58
58
  path: '/',
@@ -66,7 +66,11 @@ readify('/', {type: 'raw'}).then(console.log);
66
66
  }],
67
67
  });
68
68
 
69
- readify('/', {type: 'raw', sort: 'size', order: 'desc'}).then(console.log);
69
+ readify('/', {
70
+ type: 'raw',
71
+ sort: 'size',
72
+ order: 'desc',
73
+ }).then(console.log);
70
74
  // output
71
75
  ({
72
76
  path: '/',
package/lib/readdir.js CHANGED
@@ -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
+ const isUndefined = (a) => typeof a === 'undefined';
3
5
  const format = require('format-io');
4
6
  const currify = require('currify');
5
7
  const tryToCatch = require('try-to-catch');
@@ -9,12 +11,10 @@ const formatify = require('@cloudcmd/formatify');
9
11
 
10
12
  const WIN = process.platform === 'win32';
11
13
 
12
- const ifRaw = currify(_ifRaw);
13
- const replaceProperty = currify(_replaceProperty);
14
-
15
- const nicki = !WIN && require('nicki');
16
-
17
14
  const readdir = require('./readdir');
15
+ const nicki = !WIN && require('nicki');
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.0",
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",
@@ -43,20 +44,18 @@
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": "^9.1.0",
51
+ "eslint": "^8.57.0",
52
+ "eslint-plugin-n": "^16.6.2",
53
+ "eslint-plugin-putout": "^22.5.0",
54
+ "madrun": "^10.0.1",
56
55
  "mock-require": "^3.0.2",
57
- "nodemon": "^2.0.1",
58
- "putout": "^15.4.3",
59
- "supertape": "^5.0.0",
56
+ "nodemon": "^3.1.0",
57
+ "putout": "^35.7.6",
58
+ "supertape": "^10.5.0",
60
59
  "try-catch": "^3.0.0"
61
60
  },
62
61
  "publishConfig": {