@cloudcmd/formatify 2.0.0 → 3.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,22 @@
1
+ 2026.03.17, v3.0.0
2
+
3
+ feature:
4
+ - ef0d29b @cloudcmd/formatify: export: default -> named
5
+ - 42be3e4 @cloudcmd/formatify: migrate to ESM
6
+ - 563ac54 @cloudcmd/formatify: drop support of node < 22
7
+ - c188667 @cloudcmd/formatify: try-catch v4.0.9
8
+ - 441ca8f @cloudcmd/formatify: supertape v12.10.5
9
+ - e821920 @cloudcmd/formatify: putout v42.2.3
10
+ - 8bd76a4 @cloudcmd/formatify: madrun v13.0.1
11
+ - 4a7d093 @cloudcmd/formatify: eslint-plugin-putout v31.1.1
12
+ - e941576 @cloudcmd/formatify: eslint v10.0.3
13
+ - b0c23f3 @cloudcmd/formatify: superc8 v12.3.1
14
+
15
+ 2024.08.16, v2.0.1
16
+
17
+ fix:
18
+ - 1d6d2fa readme: badge
19
+
1
20
  2024.08.16, v2.0.0
2
21
 
3
22
  feature:
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Formatify [![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/@cloudcmd/formatify.svg?style=flat
4
- [BuildStatusIMGURL]: https://img.shields.io/travis/cloudcmd/formatify/master.svg?style=flat
4
+ [BuildStatusIMGURL]: https://github.com/cloudcmd/formatify/actions/workflows/nodejs.yml/badge.svg
5
5
  [LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat
6
6
  [NPMURL]: https://npmjs.org/package/@cloudcmd/formatify "npm"
7
- [BuildStatusURL]: https://travis-ci.org/cloudcmd/formatify "Build Status"
7
+ [BuildStatusURL]: https://github.com/cloudcmd/formatify/actions/workflows/nodejs.yml
8
8
  [LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License"
9
9
 
10
10
  Format directory content received by [readify](https://github.com/coderaiser/readify).
@@ -24,6 +24,8 @@ npm i @cloudcmd/formatify --save
24
24
  ## Examples
25
25
 
26
26
  ```js
27
+ import {formatify} from '@cloudcmd/formatify';
28
+
27
29
  const files = [{
28
30
  name: 'sortify.js',
29
31
  size: 3538,
package/lib/formatify.js CHANGED
@@ -1,9 +1,10 @@
1
- 'use strict';
1
+ import format from 'format-io';
2
+ import shortdate from 'shortdate';
2
3
 
3
- const format = require('format-io');
4
- const shortdate = require('shortdate');
4
+ const {assign} = Object;
5
+ const {isArray} = Array;
5
6
 
6
- module.exports = (files) => {
7
+ export const formatify = (files) => {
7
8
  check(files);
8
9
 
9
10
  return files
@@ -13,7 +14,7 @@ module.exports = (files) => {
13
14
  };
14
15
 
15
16
  function check(files) {
16
- if (!Array.isArray(files))
17
+ if (!isArray(files))
17
18
  throw Error('files should be an array!');
18
19
  }
19
20
 
@@ -22,7 +23,7 @@ function replaceDate(stat) {
22
23
  order: 'little',
23
24
  });
24
25
 
25
- return Object.assign(stat, {
26
+ return assign(stat, {
26
27
  date,
27
28
  });
28
29
  }
@@ -31,7 +32,7 @@ function replaceMode(stat) {
31
32
  const octal = Number(stat.mode).toString(8);
32
33
  const mode = format.permissions.symbolic(octal);
33
34
 
34
- return Object.assign(stat, {
35
+ return assign(stat, {
35
36
  mode,
36
37
  });
37
38
  }
@@ -39,7 +40,7 @@ function replaceMode(stat) {
39
40
  function replaceSize(stat) {
40
41
  const size = format.size(stat.size);
41
42
 
42
- return Object.assign(stat, {
43
+ return assign(stat, {
43
44
  size,
44
45
  });
45
46
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@cloudcmd/formatify",
3
- "version": "2.0.0",
4
- "type": "commonjs",
3
+ "version": "3.0.0",
4
+ "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "format directory content",
7
7
  "homepage": "http://github.com/cloudcmd/formatify",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "git://github.com/cloudcmd/formatify.git"
10
+ "url": "git+https://github.com/cloudcmd/formatify.git"
11
11
  },
12
12
  "scripts": {
13
13
  "lint": "madrun lint",
@@ -36,19 +36,19 @@
36
36
  "license": "MIT",
37
37
  "main": "lib/formatify.js",
38
38
  "engines": {
39
- "node": ">=18"
39
+ "node": ">=22"
40
40
  },
41
41
  "devDependencies": {
42
- "c8": "^10.1.2",
43
42
  "coveralls": "^3.0.0",
44
- "eslint": "^9.9.0",
45
- "eslint-plugin-putout": "^22.10.0",
46
- "madrun": "^10.1.0",
43
+ "eslint": "^10.0.3",
44
+ "eslint-plugin-putout": "^31.1.1",
45
+ "madrun": "^13.0.1",
47
46
  "mkdirp": "^3.0.1",
48
47
  "nodemon": "^3.1.4",
49
- "putout": "^36.0.4",
50
- "supertape": "^10.7.2",
51
- "try-catch": "^3.0.1"
48
+ "putout": "^42.2.3",
49
+ "superc8": "^12.3.1",
50
+ "supertape": "^12.10.5",
51
+ "try-catch": "^4.0.9"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"