
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
generathor-testing
Advanced tools
Use this to generate whatever you want from whatever
Generathor is a tool to create files based on different sources.
When you create multiple files based on something you can make some mistakes. So, the best way to create those files is to find a way to create them automatically.
There are two things to keep in mind for Generathor to work: Sources and Templates.
We use sources to load data. To create new ways to load data, you need to create a class that extends our base Source class.
const { Source } = require("generathor");
class DBSource extends Source {
constructor() {
super();
}
async load() {
//Code here
}
items() {
return this.$items;
}
}
In order to create one file or one group of files you need to specify one template, and you can set more than one template to process. You need to associate the template with some source, and create the template file using handlebars.
Installation
$ npm i -D generathor
Create generathor.config.js in root path
const path = require('path');
const { ArraySource, TemplateForItem, TemplateForItemGroup } = require('generathor');
module.exports = {
sources: {
db: new ArraySource([
{
table: 'table_1',
columns: ['id', 'name'],
},
{
table: 'table_2',
columns: ['id', 'status'],
}
])
},
templates: {
models: new TemplateForItemGroup({
template: './templates/export-models.handlebars',
source: 'db',
file: './result/index.js',
}),
'export-models': new TemplateForItem({
template: path.resolve('./templates/model.handlebars'),
source: 'db',
directory: path.resolve('./result'),
fileName(item) {
return item.table + '.js';
},
}),
},
};
Run the script
$ generathor
To check more options run:
$ generathor --help
TBD
FAQs
Use this to generate whatever you want from whatever
The npm package generathor-testing receives a total of 0 weekly downloads. As such, generathor-testing popularity was classified as not popular.
We found that generathor-testing 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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.