stample
TypeScript icon, indicating that this package has built-in type declarations

1.0.10 • Public • Published

Mini tree mirroring tool with placeholders replacement capabilities.

Usage

Install

sudo npm i -g stample

Command

stample SOURCE DEST GLOB1 [GLOB2, ...] [-<placeholder-name>=<placeholder-value>, ...]

(short version stpl is also available.)

Example

Let say we have

../shared/templates/index.html:

<!DOCTYPE html>
<html>
	<head>
		<title>%title%</title>
	</head>
	<body>
		%content%
	</body>
</html>

With Stample we can easily copy this template somewhere else on the filesystem along with resolving the placeholders:

stample ../shared/templates . index.html

The command will prompt for %title% and %content%.

Placeholders can also be passed through the command directly to bypass user interaction, for instance

stample ../shared/templates . index.html -title=MyCoolApp -content='<h1>Hello</h1>'

Glob patterns

Stample revolves around glob patterns, for instance

stample ./coding-templates/webdev ./src/ '**/*.ts' '**/*.html'

The command above will copy all TypeScript and HTML files from base ./coding-templates/webdev to/in src with their respective paths.

Note that: globs need to be surrounded in quotes (singles or doubles)

Help

Use stample without any arguments to see the help in the command line.

License

2023-2024 (C) MIT License. Valentin Degenne

/stample/

    Package Sidebar

    Install

    npm i stample

    Weekly Downloads

    0

    Version

    1.0.10

    License

    MIT

    Unpacked Size

    41.8 kB

    Total Files

    31

    Last publish

    Collaborators

    • vdegenne