search

Home  >  Q&A  >  body text

javascript - How to abstract commonly used working directories?

For example, if I want to make a demo of a front-end page, my most commonly used structure is as follows

frontend
    |---img/
        |---img01.jpg
    |---css/
        |---style1.css
    |---js/
        |---js1.js
    |---page1.html
    |---page2.html
    |---page3.html

So, the structure must be established step by step every time. Or right-click to package .zip as a template.

Every time you want to use it, create a folder and extract .zip. It just doesn’t feel very elegant. .

So what method can be used to abstract the above structure, so that the directory structure can be quickly created with just one command or something?

phpcn_u1582phpcn_u15822753 days ago523

reply all(5)I'll reply

  • 天蓬老师

    天蓬老师2017-05-19 10:34:56

    Create a git project, then git clone
    or other projects

    reply
    0
  • 某草草

    某草草2017-05-19 10:34:56

    Write a script command to execute the action of creating folders and files. (Use BAT under Windows, use Shell script under Linux, and use the fs library of nodeJs to write cross-platform, or you can also use python)

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-19 10:34:56

    Write your own boilerplate

    When digging a new hole, clone and rebuild.git, or simply download the zip from github

    reply
    0
  • 阿神

    阿神2017-05-19 10:34:56

    You can try http://yeoman.io/

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-19 10:34:56

    Scaffolding can be developed using gulp-based slush. Link description

    reply
    0
  • Cancelreply