node package manager
Loosely couple your services. Use Orgs to version and reuse your code. Create a free org »

sfold

sfold

Command line node program for scaffolding out project structures. sfold uses emmet style selectors to create files and folders.

Install

just npm install -g sfold and then it will be available in your terminal as sfold

Usage

sfold "<SCAFFOLD_EXPRESSION>"

The expression will be a a string of file and directory names seperated by the selectors >, +, or ^

  • > is the child selector. Put it after a directory name to nest files and directories. for example sfold "server>app.js" would create a folder called "server/" and create a file in it called "app.js" You can nest multiple levels. It is also possible to create folders without the child selector by just putting a "/" on the end of file name.
  • + is the sibling selector. Put it after a file or directory to put it in the same folder as the previous item. For example, sfold "routes/+main.js+style.css" would create a "routes" folder, a "main.js" file, and a "style.css" file all in the root directory wherever sfold was called.
  • ^ is the parent selector. Use it inside of a nested folder to jump up one level and then keep inserting files. For example sfold "server>main.js^index.html" would create a "server" folder and an "index.html" file in the root directory and a "main.js" file in the server folder.

Example Sfold

This is an example of what a common use might look ilke.

sfold "main.js+README.md+routes/+models>user.js^public>index.html+styles>main.css"

Which would create a file structure that looks like this.

main.js
README.md
routes/
models/
└ user.js
public
└ index.html
└ styles/
  └ main.css

If you have any issues or questions please let me know.