Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
@anephenix/mcg
Advanced tools
A Node.js library and CLI for generating Objection.js Models and their supporting files. It helps to save time creating Models and their migrations, so that you can focus on implementing the business logic for your Node.js server-side project.
npm i @anephenix/mcg
You can use MCG via the command line:
npx mcg Post
This will do the following:
You can pass the following optional arguments:
--testFolder - specify a custom folder name to put the test model file and seed data file in (e.g. test, spec) --mainDir - specify a custom folder path to generate all of the files in, in case your app's code is not in the current working directory --tableName - specify a custom database table name for the model and migration file (.e.g. blog_posts)
There is also the option of setting these optional arguments in a mcg.config.js file that looks like this:
module.exports = {
testFolder: 'spec',
mainDir: 'app',
};
You can also use MCG programmatically, like this:
const mcg = require('@anephenix/mcg');
(async () => {
await mcg('Post');
})();
The mainDir and testFolder are optional 2nd and 3rd arguments to that command:
const path = require('path');
const mcg = require('@anephenix/mcg');
(async () => {
const mainDir = path.join(process.cwd(), 'app');
const testFolder = 'spec';
await mcg('Post', mainDir, testFolder);
})();
©2020 Anephenix OÜ. MCG is licensed under the MIT license.
FAQs
Model Component Generator for Objection.js
The npm package @anephenix/mcg receives a total of 1 weekly downloads. As such, @anephenix/mcg popularity was classified as not popular.
We found that @anephenix/mcg 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
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.