{"id":21964401,"url":"https://github.com/beliven-it/fastify-plugin-loader","last_synced_at":"2026-04-18T06:05:58.523Z","repository":{"id":42715570,"uuid":"271572730","full_name":"beliven-it/fastify-plugin-loader","owner":"beliven-it","description":"A plugin to register an ordered list of plugins (e.g. from a JSON file)","archived":false,"fork":false,"pushed_at":"2023-03-05T11:13:49.000Z","size":696,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-21T15:52:01.584Z","etag":null,"topics":["fastify","js","json","loader","nodejs","plugin"],"latest_commit_sha":null,"homepage":"","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/beliven-it.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-06-11T14:49:20.000Z","updated_at":"2021-10-22T09:36:05.000Z","dependencies_parsed_at":"2024-11-16T16:13:23.896Z","dependency_job_id":"a01391f3-5594-4ac8-a6fd-7b6ba08f7e95","html_url":"https://github.com/beliven-it/fastify-plugin-loader","commit_stats":null,"previous_names":["heply/fastify-plugin-loader"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beliven-it%2Ffastify-plugin-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beliven-it%2Ffastify-plugin-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beliven-it%2Ffastify-plugin-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beliven-it%2Ffastify-plugin-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beliven-it","download_url":"https://codeload.github.com/beliven-it/fastify-plugin-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245020783,"owners_count":20548243,"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":["fastify","js","json","loader","nodejs","plugin"],"created_at":"2024-11-29T12:07:54.303Z","updated_at":"2026-04-18T06:05:58.495Z","avatar_url":"https://github.com/beliven-it.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastify-plugin-loader\n\nA plugin to register an ordered list of plugins (e.g. from a JSON file)\n\n![Node.js CI](https://github.com/heply/fastify-plugin-loader/workflows/Node.js%20CI/badge.svg)\n\n## Why?\n\nThe official [fastify-autoload](https://github.com/fastify/fastify-autoload) plugin allows devs to load all plugins stored in a specific folder.\n\nThe main issue with this approach is that it's nearly **impossible** to:\n\n- define a **specific loading order**\n- **passing configuration options** to loaded plugins\n\n## Install\n\n```bash\n$ npm i --save fastify-plugin-loader\n```\n\n## Usage\n\n```js\nfastify.register(require('fastify-plugin-loader'), {\n  basepath: __dirname,\n  plugins: [\n    'fastify-cors',\n    'fastify-sensible',\n    ...\n    './plugins/example-plugin',\n    ['./plugins/another-plugin', {\n      option1: 'value',\n      ...\n    }]\n  ]\n)\n```\n\nYou can also load them from an external JSON (or JS) file:\n\n```js\nfastify.register(require('fastify-plugin-loader'), {\n  basepath: __dirname,\n  plugins: require('./plugins.json')\n)\n```\n\n## Options\n\nWhen registering the plugin in your app, you can pass the following options:\n\n| Name                | Description                                                         |\n|---------------------|---------------------------------------------------------------------|\n| `basepath`          | The reference root path to consider when resolving `.` or `..`      |\n| `plugins`           | The ordered list of plugin filenames to load (or `[filename, opts]` tuples).                       |\n\n**NOTE:** additional options are forwarded to **all** loaded plugins (and merged with plugin's local options, if provided).\n\n## Test\n\n```bash\n$ npm test\n```\n\n## Acknowledgements\n\nThis project is kindly sponsored by:\n\n[![Beliven](https://assets.beliven.com/brand/logo_pos_color.svg)](https://www.beliven.com)\n\n## License\n\nLicensed under [MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeliven-it%2Ffastify-plugin-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeliven-it%2Ffastify-plugin-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeliven-it%2Ffastify-plugin-loader/lists"}