T6e: scaffold any local template into a custom file

Overview

T6e: scaffold any local template into a custom file

T6e is a small tool (no dependencies, 50 lines of code) to scaffold any local template and speed up the creation of files in a project using your custom templates or templates from the community.

It will make you save seconds at every file scaffolding, minutes every day. hours every month.

And you will not need to copy/past/delete anymore to duplicate a file.

The problem

We developers are lazy and we love our way of writing code.

Everytime we create new file, we already have its template in mind.

Now you can write that template once, and use it anytime with your custom params.

How does it work?

Suppose you love Svelte (or any other framework).

Suppose you love tailwind (or any other custom library you want to always integrate in your files).

You can save your perfect template into a file. With your custom libraries and your custom snippets.

Then you can re-use it to scaffold your components based on your template.

Example

Let's look at the Svelte example. Here I'm creating a template with a $name parameter.

This parameter can be used in the file name and in the file content.

And you may have as many parameters as you like.

They will all be replaced properly.

Here is a template example for svelte:

// saved as $name.svelte somewhere import { createEventDispatcher } from 'svelte'; import { writable } from 'svelte/store'; const dispatch = createEventDispatcher(); const store = writable({ hello: "" });
{$store.hello}
">



{$store.hello}

Suppose you save it in templates/$name.svelte

Now run

npx t6e templates/$name.svelte src/components name=counter

And boom!!

You now have a new svelte component in src/components/counter.svelte.

$name was replaced with "counter".

The content is as follows:

{$store.hello}
">



{$store.hello}
You might also like...

Quikly scaffold a postman collection for a GraphQL API. Compatible with Insomnia.

Quikly scaffold a postman collection for a GraphQL API. Compatible with Insomnia.

GraphMan Quickly scaffold a postman collection for a GraphQL API. GraphMan CLI generates an complete collection from a GraphQL endpoint, containing on

Dec 28, 2022

Scaffold a full-stack SvelteKit application with tRPC and WindiCSS out of the box

create-sweet-app Interactive CLI to quickly set up an opinionated, full-stack, typesafe SvelteKit project. Inspired by the T3 Stack and create-t3-app

Dec 16, 2022

CLI to scaffold tailwindcss-ready projects

CLI to scaffold tailwindcss-ready projects

Create TailwindCSS Project (create-tw) The easiest way to get started with TailwindCSS. It uses popular scaffolding scripts like create-next-app or cr

Dec 29, 2022

The proposal of this repository is having a scaffold with some scenarios where you can challenge your front-end knowledge.

Frontend Kata / Interview 👋 Hello developer! The proposal of this repository is having a scaffold with some scenarios where you can challenge your fr

Nov 11, 2022

A sdk scaffold with typescript.

sdk-scaffold A sdk scaffold with vite & typescript. Start git clone --depth=1 https://github.com/Alioth1017/sdk-scaffold my-sdk cd my-sdk pnpm i confi

Sep 7, 2022

A high-resolution local database that uses precise algorithms to easily record data in local files within a project with persistent JSON and YAML support designed to be easy to set up and use

A high-resolution local database that uses precise algorithms to easily record data in local files within a project with persistent JSON and YAML support designed to be easy to set up and use

About A high-resolution local database that uses precise algorithms to easily record data in local files within a project with persistent JSON and YML

Dec 28, 2022

Register your username, log into the app and create your list of a to-do with local storage.

Register your username, log into the app and create your list of a to-do with local storage.

Todofy Todofy is a web app to create your to-do list with local storage. Explore the docs » View Demo · Report Bug · Request Feature Table of Contents

Jun 30, 2022

Atlan is a CLI that helps you to manage local dockerized infrastructure without any needed knowledge on Docker and Docker Compose.

Atlan is a CLI that helps you to manage local dockerized infrastructure without any needed knowledge on Docker and Docker Compose.

Atlan CLI Atlan is a CLI that helps you to manage local dockerized infrastructure without any needed knowledge on Docker and Docker Compose. What is A

Aug 17, 2022

On this page, you can save and load all the awesome books you have and save the name and the author into the local storage. this project uses Javascript to interact with the pages

Awesome Books: refactor to use JavaScript classes In this project, We add the links to the applications into the final project Getting Started if you

Nov 29, 2022
Owner
Butopen
open source projects, persistent open revenues shared between developers, open business data
Butopen
A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM deffiniation and appropriate file structure.

Welcome to function-stencil ?? A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM

Ben Smith 21 Jun 20, 2022
Kuldeep 2 Jun 21, 2022
Ready to manipulate partitions file? Create a custom partition, apply custom security system, hide the partition and share your hidden data on the www

Paranoia ?? Ready to manipulate partitions file? Create a custom partition, apply custom security system, hide the partition and share your hidden dat

Alice Snow 3 Dec 29, 2022
With this File Manager prepared for PHP/Js, you can perform all file operations on your server without any problems.

FileManager With this File Manager prepared for PHP/Js, you can perform all file operations on your server without any problems. Instead of downloadin

Tanzer Demir 4 Sep 23, 2022
CLI utility that parses argv, loads your specified file, and passes the parsed argv into your file's exported function. Supports ESM/TypeScript/etc out of the box.

cleffa CLI tool that: Parses argv into an object (of command-line flags) and an array of positional arguments Loads a function from the specified file

Lily Scott 9 Mar 6, 2022
Serve file server with single zip file as file system in Deno.

zipland Serve file server with one-single zip file in Deno. Support zip just zip32 with deflated or uncompressed serving plaintext deflate Examples Yo

Yongwook Choi 18 Nov 2, 2022
Feel free to create new file, don't hesitate to pull your code, the most important thing is that the file name here must match your nickname so that file does not conflict with other people.

Hacktoberfest Indonesia Apa Itu Hacktoberfest ? Hacktoberfest adalah acara tahunan yang bertujuan untuk mendorong berkontribusi kedalam ekosistem open

Juan Daniel 5 Dec 15, 2022
Base Rails app that includes login, social login, homepage, and basic model for serving as a scaffold app.

Rails7Base I created the Rails7Base as a scaffold application. Countless times, I had to create apps that must have the following features: Login syst

Chim Kan 14 Jul 2, 2022
A toolkit to rapidly scaffold out a new tauri-apps project using the framework of their choice.

create-tauri-app Component Version create-tauri-app About Tauri Tauri is a polyglot and generic system that is very composable and allows engineers to

Tauri 408 Jan 4, 2023
A starter kit for scaffold-eth projects

?? scaffold-eth-cli As simple as running this in your terminal: npx scaffold-eth Clones scaffold-eth into the current folder as fast as possible ⚡️ ⁉

qedk 3 Jun 11, 2022