1.0.10 • Published 1 year ago

stample v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago