@trayio/tray-generator
TypeScript icon, indicating that this package has built-in type declarations

0.35.0 • Public • Published

Tray Template Generator allows users to create customized templates by replacing specific placeholders with user-provided values. It supports both zip files and folders

Usage

import { NodeFsGenerator } from '@trayio/tray-generator';
	
const templatePath = 'path/to/template';
const outputPath = 'output/path';
const values = {
	name: 'foo',
	};

const generator = new NodeFsGenerator();
await generator.generate(
	templatePath,
	outputPath,
	values
)();

Template Source

The template source can be either a zip file or a folder. If the template is a zip file, ensure the file extension is .zip. If it's a folder, provide the path to the folder.

Placeholder Syntax

Placeholders could be defined using the $placeholder$ syntax on file/folder names or withing the content of files.

Readme

Keywords

none

Package Sidebar

Install

npm i @trayio/tray-generator

Weekly Downloads

0

Version

0.35.0

License

MIT

Unpacked Size

16.3 kB

Total Files

12

Last publish

Collaborators

  • trayprod
  • johnbastian_trayio
  • thomaschaplin
  • simone_trayio