ts-init-template 1.0.4 → 1.0.6

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 (3) hide show
  1. package/index.js +6 -1
  2. package/package.json +2 -2
  3. package/readme.md +14 -1
package/index.js CHANGED
@@ -9,7 +9,12 @@ const __dirname = import.meta.dirname
9
9
  const execAsync = promisify(exec);
10
10
  //install dependencies
11
11
  try{
12
- const { stdout, stderr } = await execAsync('yarn add -D typescript ts-node @types/node fast-glob esbuild');
12
+ const isYarn = await fs.access('yarn.lock').then(() => true).catch(() => false);
13
+ const installCmd = isYarn
14
+ ? 'yarn add -D yarn add -D typescript ts-node @types/node fast-glob esbuild'
15
+ : 'npm install -D yarn add -D typescript ts-node @types/node fast-glob esbuild';
16
+
17
+ const { stdout, stderr } = await execAsync(installCmd);
13
18
  console.log('Dependencies installed successfully:', stdout);
14
19
  if(stderr){
15
20
  console.error('Error during installation:', stderr);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ts-init-template",
3
- "version": "1.0.4",
4
- "description": "A TS project template for my ts projects. This script will setup all the ts enviroment with 1 command. ",
3
+ "version": "1.0.6",
4
+ "description": "A TS project template for TS projects. This script will setup all the ts enviroment with 1 command. ",
5
5
  "main": "index.js",
6
6
  "author": "SigismundBT",
7
7
  "license": "MIT",
package/readme.md CHANGED
@@ -16,8 +16,21 @@
16
16
 
17
17
  ## 📦 Usage
18
18
 
19
+ ### 💡 With Yarn
20
+
19
21
  ```bash
22
+
20
23
  yarn init
21
24
  npx ts-init-template
22
25
  yarn build
23
- yarn start
26
+ yarn start
27
+
28
+
29
+ ### 💡 With NPM
30
+
31
+ ```bash
32
+
33
+ npm init
34
+ npx ts-init-template
35
+ npm run build
36
+ npm run start