You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -15,46 +17,55 @@ An [npm initializer][npm/init] to scaffold a node project and include basic tool
15
17
16
18
## Usage
17
19
18
-
`npm init node-project path/to/project`
20
+
1. Install the package as global
21
+
```
22
+
npm install -g create-nodejs-project
23
+
```
24
+
25
+
2. You will be prompted for your Github information
26
+
If you do not have the information at the moment, you can keep it empty.
27
+
In order to create projects with Github integration, you will need to add the authentication information later. See [Github Auth](#configure-Github-authentication)
28
+
29
+
3. Create your project
30
+
```
31
+
npm init nodejs-project path/to/new/project
32
+
```
19
33
20
34
## What it does
21
35
22
36
1. Create the folder for the new project
23
37
1. Guide you through a questionnarie to setup the project
24
-
2. Initialize a git repo
38
+
2. Initialize a git repository
25
39
3. Copy the template files (src, eslintrc, gitignore, readme, etc)
26
40
4. Can create a Github repository
27
-
5. Install eslint
41
+
5. Handle the Github tokens for multiple accounts/users
42
+
5. Install eslint dependencies
28
43
5. Install the selected testing dependencies
29
44
6. Generate package.json with all the project details
30
45
7. Commit and push the initial commit
31
46
32
47
## About this package
33
48
34
-
So, this started as a dry thing.
35
-
I'm not expert with NodeJS, but every time that I start a new project, I hate to go to other project, copy files like eslintrc, editorconfig, install the same dependencies, create folder structure, etc.
36
-
So, the idea is to have a create package to use it in the form of:
37
-
`npm init node-project path/to/project`
38
-
and with this have a new folder my-new-project with everything ready to work.
49
+
The motivation started as a **DRY** thing.
50
+
51
+
I'm not expert with NodeJS, but every time that I start a new project, I hate to go to other project, copy files like eslintrc, editorconfig, install the same dependencies, create folder structure, etc.
52
+
53
+
So, the idea is to have an automated way to initialize new NodeJS projects and with this have a new folder with everything ready to work in what really matters.
39
54
40
-
I know there are a lot of similar packages out there, but the idea is to learn more about nodejs api, handling files, packages, etc.
41
55
42
56
## Future features
43
57
44
-
1. Fix the structure of modules, classes and etc
45
-
4. Add unit testing
46
-
7. Add options to create the project with params instead of questionnaire
47
-
10. Add a good error handler
58
+
1. Unit testing
59
+
7. Options to create the project with params instead of questionnaire
60
+
10. A good error handler
48
61
11. Color for the console messages
49
-
12.Modify template structure (the one that is generated in the new project) to include unit test
62
+
12.Improve the template structure (the one that is generated in the new project) to include unit test
50
63
13. Include license files to the template copy/update process
51
-
14. A logger ? (just for learning)
52
-
17. Ability to handle auth for different github accounts
53
64
18. Option to questionnaire with all the default values
54
65
55
-
## Github Auth
66
+
## Configure Github Authentication
56
67
57
-
If you are planning to allow this script to create your github repositories, is required to generate a Github Token.
68
+
If you are planning to allow this script to create your Github repositories, is required to generate a Github Token.
58
69
59
70
1. Visit https://github.com/settings/tokens.
60
71
2. Click Generate new token.
@@ -70,24 +81,31 @@ If you are planning to allow this script to create your github repositories, is
70
81
```
71
82
3. Click Generate token.
72
83
4. Copy the generated string to a safe place, such as a password safe.
73
-
5. Open Terminal and add the github token. Note: The file may be empty, you can use `auth-example.json` to copy and paste.
0 commit comments