{"id":21877351,"url":"https://github.com/nodebb-community/nodebb-plugin-frontend-async","last_synced_at":"2026-05-09T17:49:50.540Z","repository":{"id":76942300,"uuid":"62370073","full_name":"NodeBB-Community/nodebb-plugin-frontend-async","owner":"NodeBB-Community","description":"This plugin provides a yet another but good way to include async in your plugin","archived":false,"fork":false,"pushed_at":"2016-07-22T09:12:36.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-10-11T01:11:50.834Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NodeBB-Community.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":"2016-07-01T06:36:16.000Z","updated_at":"2019-08-29T08:25:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"520e677d-71b4-4392-a9f1-64785010f705","html_url":"https://github.com/NodeBB-Community/nodebb-plugin-frontend-async","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":0.07692307692307687,"last_synced_commit":"76d3bbe610bcc0a02accd64c1041b8556cde8306"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeBB-Community%2Fnodebb-plugin-frontend-async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeBB-Community%2Fnodebb-plugin-frontend-async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeBB-Community%2Fnodebb-plugin-frontend-async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeBB-Community%2Fnodebb-plugin-frontend-async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NodeBB-Community","download_url":"https://codeload.github.com/NodeBB-Community/nodebb-plugin-frontend-async/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244885515,"owners_count":20526293,"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":[],"created_at":"2024-11-28T08:08:58.605Z","updated_at":"2026-05-09T17:49:50.470Z","avatar_url":"https://github.com/NodeBB-Community.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Easy async for NodeBB on client side\n\nDo you use `async` library on client side in your plugins?  \nI do a lot. And I find it quite troublesome to put the library almost in each and every plugin I make. Furthermore, it rather more troublesome then to `require` the library in a manner like this:\n\n```js\nrequire(['../../plugins/nodebb-plugin-my-long-plugin-name/public/js/vendor/async/dist/async.min'], function (async) {\n    //\n});\n```\n\nNow imagine if you use the `async` library in your plugin a, plugin b and plugin c. All of them will `require` the library from themself. Since all of the plugins have different base urls, `RequireJS` will make three different HTTP requests.\n\n#### Gimme a break!\n\nAfter installing this plugin you will be able to:\n```js\nrequire(['async'], function (async) {\n    // now you can use the latest stable \"async\": \"^1.5.0\"\n});\n```\n\nThat's it, nothing more, nothing less. I hope it will helps you.\n\n#### Installation\n```sh\ncd /path/to/nodebb\nnpm install nodebb-plugin-frontend-async\n```\nOr via NodeBB Admin panel.\n\nTo get this plugin installed automatically along with your plugin, just specify in your `plugin.json`\n```js\n\"dependencies\": {\n\t\"nodebb-plugin-frontend-async\": \"^0\"\n},\n\"peerDependencies\": {\n\t\"nodebb-plugin-frontend-async\": \"^0\"\n}\n```\nWhy both `dependencies` and `peerDependencies`? That's because of different behavior in npm v2 and npm v3. You can read more about the issue and the workaround in [this blog post](https://codingwithspike.wordpress.com/2016/01/21/dealing-with-the-deprecation-of-peerdependencies-in-npm-3/)\n\n**Don't forget to Enable the plugin in the Admin panel after installing. And to instruct your plugin users to do that little extra step!**\n#### Information\nThe plugin:  \n1. doesn't modify any source of NodeBB  \n2. gets `async.min.js` from NodeBB `node_modules`  \n3. injects `async` directly to `RequireJS` way before DOM is ready  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodebb-community%2Fnodebb-plugin-frontend-async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodebb-community%2Fnodebb-plugin-frontend-async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodebb-community%2Fnodebb-plugin-frontend-async/lists"}