{"id":20448642,"url":"https://github.com/datacamp/base-plugin","last_synced_at":"2026-04-16T16:02:39.513Z","repository":{"id":147371356,"uuid":"87167681","full_name":"datacamp/base-plugin","owner":"datacamp","description":"JS boilerplate to create plugins","archived":false,"fork":false,"pushed_at":"2018-11-23T15:59:37.000Z","size":17,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-05T09:16:27.152Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/datacamp.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":"2017-04-04T09:15:06.000Z","updated_at":"2020-08-06T17:30:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"97e4b8aa-08df-4f34-9a3c-aa5bc6c05cd6","html_url":"https://github.com/datacamp/base-plugin","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/datacamp/base-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datacamp%2Fbase-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datacamp%2Fbase-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datacamp%2Fbase-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datacamp%2Fbase-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datacamp","download_url":"https://codeload.github.com/datacamp/base-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datacamp%2Fbase-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31893265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T11:36:10.202Z","status":"ssl_error","status_checked_at":"2026-04-16T11:36:09.652Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-15T10:36:03.849Z","updated_at":"2026-04-16T16:02:39.477Z","avatar_url":"https://github.com/datacamp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# base-plugin\nJS boilerplate to create plugins.\n\nAs Convention, a Datacamp JS plugin should:\n- `export default` the plugin class.\n- `export PLUGIN_NAME` to export the name of the use .\n- `export` all the useful constants or/and function helpers.\n- have as instance variable (at least):\n    + `state`: the current state.\n- have as instance methods (at least):\n    + `subscribe(nextState:(state) =\u003e {}, error:(e) =\u003e {}, complete:() =\u003e {}): function` : only `nextState` argument is mandatory. For every new state, the plugin will trigger the `nextState` function. `subscribe` will return a function that let the possible to unsubscribe to the flow.\n    + `getState()`: this function will return the current state.\n- implement tests.\n- contains tags for every release (+ CHANGELOG eventually)\n\nAs helper, a `Pluging` class is created and exported in this repo. Feel free to extend your plugin using this one. It uses Rxjs as peer dependency for the subscribe mehtod. \n\n### NPM command\n```\n    npm run test // run unit test\n    npm run lint // run linter\n    npm run start // build the app in watch mode\n    npm run build // build the app in prod mode (+ do lint and test)\n    npm run prepublish // run build\n```\n\n### How to quickly create a DC plugin\nFirst fork this repo to have quick setup. Remove all the files in the `src` and `test` folders. You are ready to create your plugin.\nIf you plan to subclass the `Plugin` (which is the fastest way to fit the above conventions), you should run this command: `npm install --save datacamp/plugins-boilerplate.git` to be sure that you always have the latest updated `Plugin` class. Don't forget that this package has Rx as peer dependencies.\n\n\n### Libraries used (or useful)\n- `jest` is used as test runner.\n- `webpack` is used to build the library.\n- `rxjs` is an easy way to implement the mandatory `subscribe` function.\n- `babel` to write es6 code.\n\nCheck the `src` and `test` folder to see how to create a DC plugin. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatacamp%2Fbase-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatacamp%2Fbase-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatacamp%2Fbase-plugin/lists"}