这是我的 cli 我想要人们对此发表意见所以如果可以的话请发表意见

问题描述 投票:0回答:0

我想知道你对我的客户有什么看法

#!/usr/bin/env node
import inquirer from 'inquirer';
import * as child from 'node:child_process'

inquirer
  .prompt([
    {
    type:'list',
    message:'what is your project',
    name:'framework',
    choices: ['angular','react','vue','svelte','preact']
    }
  ])
  .then((answers) => {
    if (answers.framework === 'angular'  ){
    child.exec(`git clone https://github.com/subhodi/angular-simple-app.git`)
    console.log("now install the angular cli with")
    console.log("npm i @angular/cli")
    }
    if (answers.framework === 'react'  ){
    child.exec(`git clone https://github.com/imcycle/simple-react-app.git`)
    console.log("now install react with")
    console.log("npm i react")
    }
    if (answers.framework === 'vue'  ){
    child.exec(`git clone https://github.com/aditya-sridhar/simple-vuejs-app.git`)
    console.log("now install vue with")
    console.log("npm i vue")
    }
    if (answers.framework === 'svelte'  ){
    child.exec(`npm create svelte@latest myapp`)
    console.log("here is the app")
    }
    if (answers.framework === 'preact'  ){
    child.exec(`git clone https://github.com/github/codespaces-preact.git`)
    console.log("now install preact with")
    console.log("npm i preact")
    }  
})

你怎么看?我知道这很愚蠢,所以我将其命名为 stupid projects cli。祝你有美好的一天,随心所欲

node.js command-line-interface
© www.soinside.com 2019 - 2024. All rights reserved.