{"id":19258896,"url":"https://github.com/lassehaslev/templater","last_synced_at":"2026-05-08T16:43:39.333Z","repository":{"id":57126315,"uuid":"86384210","full_name":"LasseHaslev/templater","owner":"LasseHaslev","description":"CLI (Command Line Interface) template engine for all sorts of files","archived":false,"fork":false,"pushed_at":"2017-04-25T09:23:27.000Z","size":29,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T17:44:17.093Z","etag":null,"topics":["cli","cli-app","nodejs","productivity","template","templater","utility"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LasseHaslev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-27T21:09:03.000Z","updated_at":"2024-05-21T04:12:57.000Z","dependencies_parsed_at":"2022-08-31T08:11:30.499Z","dependency_job_id":null,"html_url":"https://github.com/LasseHaslev/templater","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseHaslev%2Ftemplater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseHaslev%2Ftemplater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseHaslev%2Ftemplater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseHaslev%2Ftemplater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LasseHaslev","download_url":"https://codeload.github.com/LasseHaslev/templater/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240356192,"owners_count":19788513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cli-app","nodejs","productivity","template","templater","utility"],"created_at":"2024-11-09T19:14:40.287Z","updated_at":"2026-05-08T16:43:39.272Z","avatar_url":"https://github.com/LasseHaslev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @lassehaslev/templater\n\u003e CLI (Command Line Interface) template engine for all sorts of files\n\n## Install\n```bash\nnpm install @lassehaslev/templater --save\n```\n\n## Usage\nTemplater takes 2 parameters\n1. [Inquirer.js objects](https://github.com/sboudrias/Inquirer.js#objects) (Array)\n2. Options (Object)\n    - ```templateFolder``` default:```__dirname + '/../templates'```\n        - What folder to find templates\n    - ```folder``` default:```process.argv[2] || './'```\n        - Where to add new templates\n\n```js\n#! /usr/bin/env node\n\nvar Templater = require( '@lassehaslev/templater' );\nvar templater = new Templater([\n    {\n        type: 'input',\n        name: 'author.name',\n        message: 'Whats your name?',\n        default: 'My name',\n    },\n    {\n        type: 'input',\n        name: 'author.email',\n        message: 'Whats your email?',\n        default: 'your@email.com',\n    },\n], {\n    templateFolder: __dirname + '/../templates',\n});\n\ntemplater.start().then( function( response ) {\n    console.log( 'All complete'! );\n} );\n```\n\n#### Templates\nYou can add any files in this folder. All files and folders/subfolders added in this folder will be copied to destination and rendered with new variables.\n\nUse ```\u003c% variable.name %\u003e``` syntax to edit your variables.\n\n###### Example file\n```php\n\u003c?php\n\n/**\n * Class TestFile\n * @author \u003c% author.name %\u003e \u003c\u003c% author.email %\u003e\u003e\n */\nclass TestFile\n{\n}\n```\n\n*This will render*\n```php\n\u003c?php\n\n/**\n * Class TestFile\n * @author My name \u003cyour@email.com\u003e\n */\nclass TestFile\n{\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flassehaslev%2Ftemplater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flassehaslev%2Ftemplater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flassehaslev%2Ftemplater/lists"}