pkgenhance 4.3.2

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/bin/cli.js +11 -0
  4. package/package.json +22 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Nishu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # PackageJSON Rater and Upgrader
2
+
3
+ A robust, interactive CLI tool to analyze and upgrade your `package.json` files. No external dependencies required.
4
+
5
+ ## Features
6
+
7
+ - **Completeness Rating:** Rates your `package.json` before and after upgrade.
8
+ - **Missing Fields Detection:** Lists all recommended fields missing from your `package.json`.
9
+ - **Interactive Upgrade:** Prompts you to add missing fields, with the option to provide a value or leave empty (empty fields are still added for completeness).
10
+ - **Summary Output:** Shows a summary of your package, including scripts and key metadata.
11
+ - **No External Libraries:** Uses only Node.js built-in modules (`readline`, `fs/promises`).
12
+
13
+ ## Usage
14
+
15
+ 1. Place the CLI script (`index.js`) and your `package.json` in the same directory.
16
+ 2. Run the analyzer:
17
+
18
+ ```sh
19
+ npx pkgjson
20
+ ```
21
+
22
+ 3. The CLI will:
23
+ - Rate your current `package.json` completeness.
24
+ - List missing recommended fields.
25
+ - Ask if you want to upgrade by adding missing fields.
26
+ - Prompt for each missing field (default is empty if you skip).
27
+ - Save the upgraded `package.json` and show the new completeness rating and summary.
28
+
29
+ ## Example Output
30
+
31
+ ```
32
+ File has been read successfully
33
+ Current completeness: 40%
34
+ Missing fields: version, description, author, ...
35
+ Do you want to upgrade? (y/n): y
36
+ Enter value for version (default empty): 1.0.0
37
+ Enter value for description (default empty):
38
+ ...
39
+ Upgrade complete!
40
+ New completeness: 100%
41
+ Summary:
42
+ Author: ...
43
+ Main: ...
44
+ Scripts: ...
45
+ ...
46
+ ```
47
+
48
+ ## Notes
49
+
50
+ - If you skip a field, it will be added with an empty value.
51
+ - No external dependencies are used.
52
+ - Designed for Node.js 16+.
53
+
54
+ ## License
55
+
56
+ MIT
package/bin/cli.js ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { runAnalyzer } from "../lib/analyzer.js";
3
+
4
+ const args = process.argv.slice(2);
5
+
6
+ const flags = {
7
+ auto: args.includes("--auto"),
8
+ validate: args.includes("--validate"),
9
+ };
10
+
11
+ runAnalyzer(flags);
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "pkgenhance",
3
+ "version": "4.3.2",
4
+ "type": "module",
5
+ "bin": {
6
+ "pkgjson": "./bin/cli.js"
7
+ },
8
+ "license": "MIT",
9
+ "main": "index.js",
10
+ "scripts": {
11
+ "test": "echo \"No test specified\""
12
+ },
13
+ "repository": {
14
+ "url": "https://github.com/nishur31/pkgenhance",
15
+ "type": "git"
16
+ },
17
+ "bugs": {},
18
+ "homepage": "",
19
+ "engines": {},
20
+ "contributors": [],
21
+ "files": []
22
+ }