1.0.4 • Published 1 year ago
templord v1.0.4
Table of contents
Getting Started
npm i templord enquirer -D
Usage
How to use
- Create directory matching pattern
_template_${name}
in project. - Create
_decree.ts
file inside that directory. - Drop any files you want into directory prefixed with
_template
. Suffix them with.ejs
if you wish to use data returned by getDecree method. - By default templord will always ask you for directoryName to generate from template which can be used in ejs templates via
<%- directoryName %>
. - Run
npx templord
.
Example _decree.ts
import type * as Enquirer from 'enquirer';
const getDecree = async (enquirer: Enquirer) => {
const responses = await enquirer.prompt([
{
message: `Name:`,
name: `name`,
type: `input`,
},
]);
return responses;
};
export default getDecree;