{"id":15497424,"url":"https://github.com/heapwolf/admin-template","last_synced_at":"2025-07-01T03:07:07.990Z","repository":{"id":8965923,"uuid":"10706943","full_name":"heapwolf/admin-template","owner":"heapwolf","description":"DEPRECATED","archived":false,"fork":false,"pushed_at":"2013-06-20T18:30:57.000Z","size":270,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-18T14:49:14.433Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heapwolf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-15T13:56:05.000Z","updated_at":"2019-07-11T15:49:30.000Z","dependencies_parsed_at":"2022-09-09T02:11:04.040Z","dependency_job_id":null,"html_url":"https://github.com/heapwolf/admin-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/heapwolf/admin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fadmin-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fadmin-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fadmin-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fadmin-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heapwolf","download_url":"https://codeload.github.com/heapwolf/admin-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fadmin-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262887194,"owners_count":23379768,"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-10-02T08:33:38.784Z","updated_at":"2025-07-01T03:07:07.964Z","avatar_url":"https://github.com/heapwolf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SYNOPSIS\nAn example of how to write a plugin/add-on for levelweb.\n\n# DESCRIPTION\nLevelweb plugins are node modules, just `npm install` or\n`git clone` your module into the `node_modules` folder\nand run levelweb, your module will be added.\n\n# USAGE\n\n### A data method\nA module can contain any arbitrary code that is run when \nthe app is loaded. Exported methods are added either as \nRPC methods or http routes (depending on their type).\n\n```js\nexports.foo = { \n\n  //\n  // 'readable', 'writable', 'sync', 'async', 'http`\n  //\n  type: 'async', \n\n  //\n  // any arbitrary group names to compare when the method is called\n  //\n  groups: ['admin', 'user'],\n\n  //\n  // if your method's `type` is async, it should have a callback\n  //\n  method: function(somevalue, callback) {\n\n    // `this` has a reference to the database instance\n    // as well as the session object `{ sessionId='', groups=[], user='' }`\n\n    var db = this.db\n    var session = this.session\n\n    // now maybe use an actual database method\n    db.put(somevalue, callback)\n  }\n}\n```\n\n### A simple http route\nIn cases where you need to use http from a module, simply export\na route and provide the type `http`. If the groups specified match\nany of the user's groups, the method will be executed. `this` has\nthe context of the database and session.\n\n```js\nexports['/imageupload/:filename'] = {\n  type: 'http',\n  groups: ['user'],\n  method: function(req, res, urlParams) {\n  \n    var db = this.db\n    var session = this.session\n  \n  // handle a file upload\n  }\n}\n```\n\n\n# EXAMPLE\n![screenshot](/example.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Fadmin-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheapwolf%2Fadmin-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Fadmin-template/lists"}