{"id":23529626,"url":"https://github.com/jaid/jaid-core","last_synced_at":"2026-05-01T06:34:32.143Z","repository":{"id":35041870,"uuid":"199742077","full_name":"Jaid/jaid-core","owner":"Jaid","description":"Combines jaid-logger, essential-config, got, koa and sequelize.","archived":false,"fork":false,"pushed_at":"2023-05-06T10:21:19.000Z","size":9547,"stargazers_count":0,"open_issues_count":13,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-18T15:01:44.386Z","etag":null,"topics":["core","framework","jaid-core","jaid-logger","javascript","javascript-framework","javascript-frameworks","js-framework","koa","lib","library","orm","personal","sequelize","util","utility","winston"],"latest_commit_sha":null,"homepage":"https://github.com/Jaid/jaid-core","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jaid.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-30T23:27:58.000Z","updated_at":"2022-07-01T12:38:51.000Z","dependencies_parsed_at":"2024-10-20T15:51:15.901Z","dependency_job_id":null,"html_url":"https://github.com/Jaid/jaid-core","commit_stats":{"total_commits":360,"total_committers":2,"mean_commits":180.0,"dds":"0.11111111111111116","last_synced_commit":"6e60255d5a7cf8a2a4a2dd31032b431bb78f156a"},"previous_names":[],"tags_count":79,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaid%2Fjaid-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaid%2Fjaid-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaid%2Fjaid-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaid%2Fjaid-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jaid","download_url":"https://codeload.github.com/Jaid/jaid-core/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251414025,"owners_count":21585604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["core","framework","jaid-core","jaid-logger","javascript","javascript-framework","javascript-frameworks","js-framework","koa","lib","library","orm","personal","sequelize","util","utility","winston"],"created_at":"2024-12-25T21:12:35.340Z","updated_at":"2026-05-01T06:34:32.114Z","avatar_url":"https://github.com/Jaid.png","language":"JavaScript","funding_links":["https://github.com/sponsors/jaid"],"categories":[],"sub_categories":[],"readme":"# jaid-core\n\n\n\u003ca href=\"https://raw.githubusercontent.com/jaid/jaid-core/master/license.txt\"\u003e\u003cimg src=\"https://img.shields.io/github/license/jaid/jaid-core?style=flat-square\" alt=\"License\"/\u003e\u003c/a\u003e \u003ca href=\"https://github.com/sponsors/jaid\"\u003e\u003cimg src=\"https://img.shields.io/badge/\u003c3-Sponsor-FF45F1?style=flat-square\" alt=\"Sponsor jaid-core\"/\u003e\u003c/a\u003e  \n\u003ca href=\"https://actions-badge.atrox.dev/jaid/jaid-core/goto\"\u003e\u003cimg src=\"https://img.shields.io/endpoint.svg?style=flat-square\u0026url=https%3A%2F%2Factions-badge.atrox.dev%2Fjaid%2Fjaid-core%2Fbadge\" alt=\"Build status\"/\u003e\u003c/a\u003e \u003ca href=\"https://github.com/jaid/jaid-core/commits\"\u003e\u003cimg src=\"https://img.shields.io/github/commits-since/jaid/jaid-core/v8.2.0?style=flat-square\u0026logo=github\" alt=\"Commits since v8.2.0\"/\u003e\u003c/a\u003e \u003ca href=\"https://github.com/jaid/jaid-core/commits\"\u003e\u003cimg src=\"https://img.shields.io/github/last-commit/jaid/jaid-core?style=flat-square\u0026logo=github\" alt=\"Last commit\"/\u003e\u003c/a\u003e \u003ca href=\"https://github.com/jaid/jaid-core/issues\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/jaid/jaid-core?style=flat-square\u0026logo=github\" alt=\"Issues\"/\u003e\u003c/a\u003e  \n\u003ca href=\"https://npmjs.com/package/jaid-core\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/jaid-core?style=flat-square\u0026logo=npm\u0026label=latest%20version\" alt=\"Latest version on npm\"/\u003e\u003c/a\u003e \u003ca href=\"https://github.com/jaid/jaid-core/network/dependents\"\u003e\u003cimg src=\"https://img.shields.io/librariesio/dependents/npm/jaid-core?style=flat-square\u0026logo=npm\" alt=\"Dependents\"/\u003e\u003c/a\u003e \u003ca href=\"https://npmjs.com/package/jaid-core\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/jaid-core?style=flat-square\u0026logo=npm\" alt=\"Downloads\"/\u003e\u003c/a\u003e\n\n**Combines jaid-logger, essential-config, got, koa and sequelize.**\n\n\n\n\n\n## Installation\n\n\u003ca href=\"https://npmjs.com/package/jaid-core\"\u003e\u003cimg src=\"https://img.shields.io/badge/npm-jaid--core-C23039?style=flat-square\u0026logo=npm\" alt=\"jaid-core on npm\"/\u003e\u003c/a\u003e\n\n```bash\nnpm install --save jaid-core@^8.2.0\n```\n\n\u003ca href=\"https://yarnpkg.com/package/jaid-core\"\u003e\u003cimg src=\"https://img.shields.io/badge/Yarn-jaid--core-2F8CB7?style=flat-square\u0026logo=yarn\u0026logoColor=white\" alt=\"jaid-core on Yarn\"/\u003e\u003c/a\u003e\n\n```bash\nyarn add jaid-core@^8.2.0\n```\n\n\u003ca href=\"https://github.com/jaid/jaid-core/packages\"\u003e\u003cimg src=\"https://img.shields.io/badge/GitHub Packages-@jaid/jaid--core-24282e?style=flat-square\u0026logo=github\" alt=\"@jaid/jaid-core on GitHub Packages\"/\u003e\u003c/a\u003e  \n(if [configured properly](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-npm-for-use-with-github-packages))\n\n```bash\nnpm install --save @jaid/jaid-core@^8.2.0\n```\n\n\n\n\n\n\n## Usage\n\n### Plugins\n\nThese optional plugin properties may be called by `jaid-core`:\n\nName|Parameters|Return value\n---|---|---\n`constructor`|`JaidCore core`\n`setCoreReference`|`JaidCore core`\n`getConfigSetup`||`Object additionalConfigSetup`\n`preInit`||`boolean shouldRemovePlugin`\n`handleConfig`|`Object config`|`boolean shouldRemovePlugin`\n`handleKoa`|`Koa koa`\n`handleGot`|`Got got`\n`collectModels`||`Object\u003cstring, {default: Model, schema: Object}\u003e`\n`init`||`boolean shouldRemovePlugin`\n`postInit`||`boolean shouldRemovePlugin`\n`ready`|\n`handleLog`|`string level`, `string[] fragments`|\n\n### JaidCorePlugin\n\nPlugins can inherit from any superclass. When they inherit from JaidCorePlugin, some fields for the instance are automatically set:\n\n- `.core`\n- `.logger` (has `.info`, `.warn`, `.error`, `.debug`)\n- `.config` (Object of the loaded config)\n\nPlugin example:\n\n```js\nimport {JaidCorePlugin} from \"jaid-core\"\n\nexport default class Plugin extends JaidCorePlugin {\n\n  constructor(options = {}) {\n    super()\n    this.options = {\n      ...options\n    }\n  }\n\n  ready() {\n    this.log(\"Hello!\")\n  }\n\n}\n```\n\nSequelize model example:\n\n```js\nimport Sequelize from \"sequelize\"\n\nclass PluginModel extends Sequelize.Model {\n\n  /**\n   * @return {string}\n   */\n  getTitle() {\n    return this.title\n  }\n\n}\n\n/**\n * @type {import(\"sequelize\").ModelAttributes}\n */\nexport const schema = {\n  title: {\n    type: Sequelize.STRING,\n    allowNull: false\n  }\n}\n\nexport default PluginModel\n```\n\nAdvanced Sequelize model (dynamically generated):\n\n```js\nimport Sequelize from \"sequelize\"\n\n/**\n * @param {typeof import(\"sequelize\").Model} Model\n * @param {import(\"jaid-core\").ModelDefinitionContext} context\n * @return {{default, schema}}\n */\nexport default (Model, {models}) =\u003e {\n\n    class AdvancedModel extends Model {\n\n      /**\n       * @param {Object\u003cstring, import(\"sequelize\").Model\u003e} models\n       */\n      static associate() {\n        AdvancedModel.belongsTo(models.AnotherModel, {\n          foreignKey: {\n            allowNull: false,\n          },\n        })\n      }\n\n      /**\n       * @return {string}\n       */\n      getTitle() {\n        return this.title\n      }\n\n  }\n\n  /**\n   * @type {import(\"sequelize\").ModelAttributes}\n   */\n  const schema = {\n    title: {\n      type: Sequelize.STRING,\n      allowNull: false\n    }\n  }\n\n  return {\n    default: AdvancedModel,\n    schema,\n  }\n\n}\n```\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Development\n\n\n\nSetting up:\n```bash\ngit clone git@github.com:jaid/jaid-core.git\ncd jaid-core\nnpm install\n```\nTesting:\n```bash\nnpm run test:dev\n```\nTesting in production environment:\n```bash\nnpm run test\n```\n\n\n## License\n[MIT License](https://raw.githubusercontent.com/jaid/jaid-core/master/license.txt)  \nCopyright © 2020, Jaid \\\u003cjaid.jsx@gmail.com\u003e (https://github.com/jaid)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaid%2Fjaid-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaid%2Fjaid-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaid%2Fjaid-core/lists"}