{"id":15369106,"url":"https://github.com/developit/puredom-rest","last_synced_at":"2026-07-03T14:04:40.431Z","repository":{"id":15822774,"uuid":"18562550","full_name":"developit/puredom-rest","owner":"developit","description":"A high-level network abstraction that makes working with REST APIs simple.","archived":false,"fork":false,"pushed_at":"2017-05-09T15:18:32.000Z","size":167,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-12T02:26:57.100Z","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developit.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}},"created_at":"2014-04-08T14:57:58.000Z","updated_at":"2023-09-25T07:43:47.000Z","dependencies_parsed_at":"2022-08-31T00:01:11.712Z","dependency_job_id":null,"html_url":"https://github.com/developit/puredom-rest","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/developit/puredom-rest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fpuredom-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fpuredom-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fpuredom-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fpuredom-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developit","download_url":"https://codeload.github.com/developit/puredom-rest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fpuredom-rest/sbom","scorecard":{"id":337252,"data":{"date":"2025-08-11","repo":{"name":"github.com/developit/puredom-rest","commit":"9d4a68e3ec59ca69eb80acefe8f18478e69fad72"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T04:59:42.721Z","repository_id":15822774,"created_at":"2025-08-18T04:59:42.722Z","updated_at":"2025-08-18T04:59:42.722Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35088496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-03T02:00:05.635Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-10-01T13:34:12.445Z","updated_at":"2026-07-03T14:04:40.407Z","avatar_url":"https://github.com/developit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"puredom-rest [![Version](https://img.shields.io/npm/v/puredom-rest.svg?style=flat)](https://www.npmjs.org/package/puredom-rest) ⎔ [![Build Status](https://img.shields.io/travis/developit/puredom-rest.svg?style=flat\u0026branch=master)](https://travis-ci.org/developit/puredom-rest)\n============\n\nA high-level network abstraction that makes working with REST APIs simple.\n\nIf you prefer a server-synchronized resource model (`sync()` / `fetch()` paradigm), check out [puredom-model](http://github.com/developit/puredom-model).\n\n\n---\n\n\nInstantiation\n-------------\n\n**Using AMD:**  \n\n```JavaScript\nrequire('puredom-rest', function(rest) {\n\tvar users = rest('/api/users');\n\n\t// users is a rest.Resource instance:\n\talert(users instanceof rest.Resource);\n});\n```\n\n**Without AMD:**  \n\n```HTML\n\u003cscript src=\"puredom-rest.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n\tvar users = rest('/api/users');\n\n\t// users is a rest.Resource instance:\n\talert(users instanceof rest.Resource);\n\u003c/script\u003e\n```\n\n\n---\n\nAPI\n---\n\n\n# rest(url) / new rest.Resource(url)\nCreate a new `rest.Resource` instance for the resource at a given URL.  \n\n```JavaScript\nvar users = rest('/api/users');\n// equivalent to:\nvar users = new rest.Resource('/api/users');\n```\n\n\n# .index(callback)\nGet a list of resources\n\n```JavaScript\nusers.index(function(list) {\n\t// list is an Array of users\n\tconsole.log('Users: ', list);\n});\n```\n\n\n# .get(id, callback)\nGet a single resource\n\n```JavaScript\nusers.get('myid', function(user) {\n\tconsole.log('User \"myid\": ', user);\n});\n```\n\n\n# .post(data, callback)\nCreate a new resource.\n\n```JavaScript\nusers.post({\n\tusername : 'joe',\n\tpassword : 'super secret password'\n}, function(user) {\n\tconsole.log('New user: ', user);\n});\n```\n\n\n# .put(id, data, callback)\nUpdate an existing resource, indicated by its ID.\n\n```JavaScript\nusers.put('myid', {\n\tstatus : 'awesome'\n}, function(user) {\n\tconsole.log('Updated user: ', user);\n});\n```\n\n\n# .del(id, callback)\nUpdate an existing resource, indicated by its ID.  \n*If you don't care about IE, you can also use this as:* `delete()`  \n\n```JavaScript\nusers.del('myid', function(res) {\n\tconsole.log('Delete response: ', res);\n});\n```\n\n\n# .param(key [, value])\nGet or set a querystring parameter to send on each request.  \n\n- If `value` is set: adds a global querystring parameter `key` with a value of `value`  \n- If `value` is empty: returns the current value of the global parameter `key`  \n- If `key` is an Object: adds `key`'s key-value property pairs as global parameters  \n\n```JavaScript\n// Send a token on all subsequent requests:\nusers.param('token', 'abcdefg');\n\n// Get the current token value:\nvar token = users.param('token');\nconsole.log(token);\n```\n\n\n---\n\nEvents\n------\n\n\n# req\n`function handler(req) {}`  \nHook the `req` event to be notified prior to all requests.  \nEvent handlers get passed the `puredom.HttpRequest` instance `req`.  \n\n```JavaScript\nusers.on('req', function(req) {\n\tconsole.log('Request: ', req.method, req.url, req.body);\n});\n```\n\n\n# req:/url\n`function handler(req) {}`  \nAdd an event handler for \"req:\" followed by relative URL (ex: `req:/users`) to be notified when a request is made to the given URL.  \nThis is just a more specific version of the `req` event.  \n\n```JavaScript\nusers.on('req:/users', function(req) {\n\tconsole.log('User list request: ', req.method);\n});\n```\n\n\n# status\n`function handler(req, res) {}`  \nHook the `status` event to be notified of the status of every response.  \nEvent handlers get passed the `puredom.HttpRequest` instance (`req`), and the response object (`res`).  \n\n```JavaScript\nusers.on('status', function(req, res) {\n\tconsole.log('Status: ', res.status);\n});\n```\n\n\n# status:N\n`function handler(req, res) {}`  \nAdd an event handler for \"status:\" followed by a specific response status code (ex: `status:401`) to be notified when a response is issued with that status.  \nThis is just a more specific version of the `status` event.  \n\n```JavaScript\nusers.on('status', function(req, res) {\n\tconsole.log('Status: ', res.status);\n});\n```\n\n\n# res\n`function handler(req, res) {}`  \nHook the `res` event to be notified of all responses.  \nEvent handlers get passed the `puredom.HttpRequest` instance (`req`), and the response object (`res`).  \n\n```JavaScript\nusers.on('res', function(req, res) {\n\tconsole.log('Response: ', req.url, res.headers, res.json);\n});\n```\n\n\n# res:/url\n`function handler(req, res) {}`  \nAdd an event handler for \"res:\" followed by relative URL (ex: `res:/users`) to be notified when a response is received from the given URL.  \nThis is just a more specific version of the `res` event.  \n\n```JavaScript\nusers.on('res:/users', function(req, res) {\n\tconsole.log('User list response: ', res.headers, res.json);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopit%2Fpuredom-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopit%2Fpuredom-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopit%2Fpuredom-rest/lists"}