
Product
Introducing Webhook Events for Pull Request Scans
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
templates-artist
Advanced tools
Create applications using templates
npm install template-artist # using npm
yarn add template-artist # using yarn
import { TemplateArtist } from 'templates-artist';
TemplateArtist.createApp({
answers: {
name: 'John',
lastname: 'Doe',
folder: 'thisIsMyFolder',
fileName: 'loremIpsumFileName',
},
destinationApp: '/application/destination/directory',
templatePath: '/template/path/directory',
});
.template-directory
βββ _index.html.hbs
βββ _{{folder}}
β βββ {{fileName}}.js
β βββ otherFile.txt
βββ _assets
β βββ file1.ts
β βββ file2.cpp
file template
Hello world! My name is {{name}}, and my lastname is {{lastname}}
App Created
.application-destination-directory
βββ _index.html
βββ _thisIsMyFolder
β βββ loremIpsumFileName.js
β βββ otherFile.txt
βββ _assets
β βββ file1.ts
β βββ file2.cpp
file generated
Hello world! My name is {{name}}, and my lastname is {{lastname}}
Note: more info in https://handlebarsjs.com/guide/
Create a simple nodejs app, install "template-artist" and finally create "template" folder with html file inside
mkdir test-template && cd ./test-template
npm init -y
npm install template-artist
touch index.js
mkdir ./template
echo "{{name}}" > ./template/index.html.hbs
/*
This script will generate a json file inside the root directory of the app with your questions called template-questions.json.
*/
import { TemplateArtistQuestions } from 'templates-artist';
(() => {
TemplateArtistQuestions.generateQuestions({
questions: [
{
type: 'input',
message: 'Type your name',
name: 'name',
default: 'Jhon',
validation: {
opts: ['required'],
messageError: 'your name is required',
},
},
],
jsonFileName: 'template-questions'
});
})();
Test your template and questions and answers
/*
This script will test your template, test your answers and questions match
*/
import { TemplateArtistQuestions, TemplateArtist } from 'templates-artist';
(() => {
const questions = TemplateArtistQuestions.readQuestions(
// path to questions file
);
const errors = TemplateArtist.test({
answers,
questions,
templatePath: 'templateFolderPath'
});
if (errors.length == 0) {
console.log('good!', errors);
} else {
console.error('something wnet wrong!', errors);
}
})();
See also the list of contributors who participated in this project.
FAQs
Create applications using templates
We found that templates-artist demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checksβbuilt on trusted open source tools, ready to run out of the box.