2.0.0 • Published 4 years ago

template-folder v2.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

template-folder

This package is a CLI, which allows you to copy the contents of a directory A to a directory B, with the great difference that tempalte-folder allows you to manipulate the content to be copied as you generate the reading, this with the idea that the generation is dynamic, eg:

template-folder ./a ./b --data {"name":"custom-name"}

./a/
   {{name}}/
      file-{{name}}.md
./b/
   custom-name/
      file-custom-name.md

The template system defined for this process is mustache

Flags

-f, --force: force the replacement of the files if they already exist -d, --data: define a json object to share with template.config.js

template.config.js

It allows to extend the behavior of template-folder, by means of a function capable of modifying the variable data shared with the template, by default tempalte-folder couples the package prompts to improve the experience of data generation through the terminal, eg:

import prompts from "prompts";

const questions = [
  {
    type: "text",
    name: "title",
    message: "What is your GitHub username?"
  }
];

export default function() {
  return prompts(questions);
}

This file should only be in the main directory of the template

2.0.0

4 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago