The generic repository pattern implementation for NodeJS, aka `BaseCRUD`
npm install di-factoryBaseCRUD
tsx
import { factory } from 'di-factory';
const Basecrud = factory(
class {
constructor(public name: string, public collectionId: string) {}
getName = () => this.name;
getCollectionId = () => this.collectionId;
}
);
class TestCrud extends Basecrud("test-crud", "collection-uuid") {}
const testCrud = new TestCrud();
console.log(testCrud.getName()); // test-crud
``