git-ignore-generator-creator-cli 0.1.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/README.md +63 -0
- package/bin/index.js +35 -0
- package/package.json +38 -0
- package/templates/node.txt +3 -0
- package/templates/react.txt +2 -0
package/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# git-ignore-gen-cli
|
2
|
+
|
3
|
+
A simple CLI tool to generate `.gitignore` files for multiple tech stacks quickly.
|
4
|
+
No need to search online — create your `.gitignore` instantly from common templates like **Node.js**, **React**, **Python**, and more.
|
5
|
+
|
6
|
+
---
|
7
|
+
|
8
|
+
## Features
|
9
|
+
- Generate `.gitignore` files for multiple technologies in one command.
|
10
|
+
- Works offline — no API calls needed.
|
11
|
+
- Includes templates for Node.js, React, Python, VSCode, and more.
|
12
|
+
- Lightweight and fast.
|
13
|
+
|
14
|
+
---
|
15
|
+
|
16
|
+
## Installation
|
17
|
+
npm install -g git-ignore-generator-creator-cli
|
18
|
+
|
19
|
+
---
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Generate a `.gitignore` for Node.js:
|
24
|
+
git-ignore-gen node
|
25
|
+
|
26
|
+
Combine multiple templates:
|
27
|
+
git-ignore-gen node react vscode
|
28
|
+
|
29
|
+
List all available templates:
|
30
|
+
git-ignore-gen --list
|
31
|
+
|
32
|
+
---
|
33
|
+
|
34
|
+
## Example
|
35
|
+
Running:
|
36
|
+
git-ignore-gen node react
|
37
|
+
creates:
|
38
|
+
# Node
|
39
|
+
node_modules/
|
40
|
+
npm-debug.log
|
41
|
+
.env
|
42
|
+
|
43
|
+
# React
|
44
|
+
build/
|
45
|
+
.cache/
|
46
|
+
|
47
|
+
---
|
48
|
+
|
49
|
+
## Testing
|
50
|
+
Run all tests with:
|
51
|
+
npm test
|
52
|
+
|
53
|
+
---
|
54
|
+
|
55
|
+
## Versioning
|
56
|
+
Release a new version:
|
57
|
+
npm version patch
|
58
|
+
git push origin main --tags
|
59
|
+
|
60
|
+
---
|
61
|
+
|
62
|
+
## License
|
63
|
+
MIT License © 2025 cavani21
|
package/bin/index.js
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
import fs from "fs";
|
3
|
+
import path from "path";
|
4
|
+
|
5
|
+
const args = process.argv.slice(2);
|
6
|
+
const templatesDir = path.join(path.dirname(new URL(import.meta.url).pathname), "../templates");
|
7
|
+
|
8
|
+
if (args.length === 0 || args.includes("--help")) {
|
9
|
+
console.log("Usage: git-ignore-gen <template1> <template2> ...\nUse --list to view available templates.");
|
10
|
+
process.exit(0);
|
11
|
+
}
|
12
|
+
|
13
|
+
if (args.includes("--list")) {
|
14
|
+
const files = fs.readdirSync(templatesDir).map(f => f.replace(".txt", ""));
|
15
|
+
console.log("Available templates:", files.join(", "));
|
16
|
+
process.exit(0);
|
17
|
+
}
|
18
|
+
|
19
|
+
const combined = args.map(template => {
|
20
|
+
const filePath = path.join(templatesDir, `${template}.txt`);
|
21
|
+
if (fs.existsSync(filePath)) {
|
22
|
+
return fs.readFileSync(filePath, "utf-8");
|
23
|
+
} else {
|
24
|
+
console.warn(`Template not found: ${template}`);
|
25
|
+
return "";
|
26
|
+
}
|
27
|
+
}).join("\n");
|
28
|
+
|
29
|
+
if (!combined.trim()) {
|
30
|
+
console.error("No valid templates provided.");
|
31
|
+
process.exit(1);
|
32
|
+
}
|
33
|
+
|
34
|
+
fs.writeFileSync(".gitignore", combined);
|
35
|
+
console.log("✅ .gitignore generated successfully!");
|
package/package.json
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
{
|
2
|
+
"name": "git-ignore-generator-creator-cli",
|
3
|
+
"version": "0.1.1",
|
4
|
+
"description": "Generate .gitignore files quickly for multiple tech stacks",
|
5
|
+
"bin": {
|
6
|
+
"git-ignore-gen": "./bin/index.js"
|
7
|
+
},
|
8
|
+
"type": "module",
|
9
|
+
"scripts": {
|
10
|
+
"start": "node ./bin/index.js",
|
11
|
+
"test": "npx vitest run"
|
12
|
+
},
|
13
|
+
"keywords": [
|
14
|
+
"gitignore",
|
15
|
+
"git",
|
16
|
+
"cli",
|
17
|
+
"ignore",
|
18
|
+
"generator",
|
19
|
+
"template",
|
20
|
+
"project setup",
|
21
|
+
"automation",
|
22
|
+
"node",
|
23
|
+
"react",
|
24
|
+
"python",
|
25
|
+
"java",
|
26
|
+
"docker",
|
27
|
+
"devops",
|
28
|
+
"ci",
|
29
|
+
"cd",
|
30
|
+
"gitignore generator",
|
31
|
+
"create gitignore"
|
32
|
+
],
|
33
|
+
"author": "cavani21",
|
34
|
+
"license": "MIT",
|
35
|
+
"devDependencies": {
|
36
|
+
"vitest": "^3.2.4"
|
37
|
+
}
|
38
|
+
}
|