project generators & project scaffold

project generators & project scaffold

how to write a node cli & Project Scaffold

https://www.sitepoint.com/scaffolding-tool-caporal-js/

Copying the Template Files

shellJS

http://documentup.com/shelljs/shelljs#cpoptions-source--source--dest


if (fs.existsSync(templatePath)) {
  logger.info('Copying files…');
  shell.cp('-R', `${templatePath}/*`, localPath);
  logger.info(' The files have been copied!');
} else {
  logger.error(`The requested template for ${args.template} wasn't found.`)
  process.exit(1);
}

https://medium.com/northcoders/creating-a-project-generator-with-node-29e13b3cd309

https://javascriptplayground.com/writing-a-command-line-node-tool/

select options

checkbox

image

https://www.sitepoint.com/javascript-command-line-interface-cli-node-js/

https://github.com/sitepoint-editors/ginit

creating directories

https://scotch.io/tutorials/building-cli-applications-with-nodejs

mkd directory_name


# Create a new directory and enter it
function mkd() {
    mkdir -p "$@" && cd "$_";
}

shit live share bug

stuck

740516-20190527163324804-483472634.png


babel 7.0.0

https://babeljs.io/setup#installation

https://babeljs.io/setup#installation

shell

https://github.com/shelljs/shelljs#cpoptions-source--source--dest

https://github.com/shelljs/shelljs#shellstringstr

740516-20190527215458012-1546721041.png

https://www.sitepoint.com/javascript-command-line-interface-cli-node-js/

https://github.com/sitepoint-editors/ginit

https://www.npmjs.com/package/clui

ASCII Art

https://www.npmjs.com/package/figlet

https://github.com/patorjk/figlet.js

dependencies & devDependencies


$ npm i -D app-node-env commander shelljs colors

$ npm i -D inquirer optionator chalk

$ npm i -D @babel/cli @babel/core @babel/preset-env rimraf

$ npm i -D clear clui figlet

css grid

https://junon.me/

view-source:https://junon.me/


            html, body {
                margin: auto 0;
                padding: auto 0;
                width: 100vw;
                height: 100vh;
            }

            body {
                display: grid;
                grid-template-rows: 1fr 1fr 1fr;
                grid-template-columns: 1fr auto 1fr;
                font-family: "Anonymous Pro", monospace;
                font-size: 1rem;
                background: #111;
            }

            body > .master {
                color: #EEE;
                text-shadow: 1px  0   0 rgba(0, 0, 0, 0.2),
                            -1px  0   0 rgba(0, 0, 0, 0.2),
                             0    1px 0 rgba(0, 0, 0, 0.2),
                             0   -1px 0 rgba(0, 0, 0, 0.2),
                             1px  1px   rgba(0, 0, 0, 0.2),
                            -1px -1px 0 rgba(0, 0, 0, 0.2),
                             1px -1px 0 rgba(0, 0, 0, 0.2),
                            -1px  1px 0 rgba(0, 0, 0, 0.2);
            }

            body > div {
                grid-row: 2 / 3;
                grid-column: 2 / 3;
                margin: 1rem;
            }

            .master > div, #shift > div > div {
                margin-top: 2rem;
            }

            body * {
                position: relative;
                transition: transform 2s cubic-bezier(0,.97,.31,1.15);
            }

            #shift {
                user-select: none;
            }

            #shift > * {
                mix-blend-mode: screen;
                position: absolute;
                width: 100%;
            }

            .code {
                padding: 0.5rem;
                background: #222;
                text-shadow: none;
                color: #ffd300;
            }

            .code::before {
                color: #ff007b;
                text-shadow: none;
                content: '$ ';
            }

            hr {
                visibility: hidden;
                margin: 2rem 0;
            }

            .master h1, .master hr {
                border: 0;
                border-bottom: 1px dashed #ff007b;
                visibility: visible;
            }

            h1 {
                padding-bottom: 1rem;
            }

            a {
                color: inherit;
            }

            .social {
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 4rem;
            }

转载于:https://www.cnblogs.com/xgqfrms/p/10930225.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值