![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
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.
@northernv/supermodel
Advanced tools
Completely inspired by knex-supermodel, just altered with some personal modifications to meet my needs
npm install -S @northernv/supermodel;
yarn add @northernv/supermodel;
In your models, that are Javascript classes, just extend
with the main class
const { default: Base } = require('@northernv/supermodel')
class User extends Base {
}
@northernv/supermodel
is meant to be a very lite but not quite an ORM for knex. This is accomplished by providing a base model that is simply an ES6 class that you extend in your own models. You can override the provided methods or even add to them to make your own. Each method will always return your model back to you!
This package requires ES6 features only available in node 6+.
Each subclass will have automatic access to static methods to create
, fetch
, collection
, forge
, update
and destroy
, count
, getAll
.
const { default: Base } = require('@northernv/supermodel')
const knex = require('knex')
const db = knex({ ...knexOptions })
class User extends Base {
constructor(opts) {
super(opts);
}
}
// Note: It converts properties to snake_case
const user = User.create({ fooBar: 'hello', barBaz: 'baz' }, { db });
console.log(user.fooBar); // hello
console.log(user.foo_bar); // hello
console.log(user.barBaz); // baz
You may either provide a transacting knex to each method or chain it.
let user;
knex.transaction((trx) => {
User.fetch({ id: '123' }, { db: trx })
.then((u) => {
user = u;
return user.update({ foo: 'baz' });
});
});
This software is licensed under the MIT license.
FAQs
A Base model for Knex
The npm package @northernv/supermodel receives a total of 0 weekly downloads. As such, @northernv/supermodel popularity was classified as not popular.
We found that @northernv/supermodel 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.