{"id":20962993,"url":"https://github.com/doesdev/get-scrud","last_synced_at":"2025-12-29T05:11:09.449Z","repository":{"id":43831223,"uuid":"98362732","full_name":"doesdev/get-scrud","owner":"doesdev","description":"Client for SCRUD style rest APIs","archived":false,"fork":false,"pushed_at":"2025-12-04T23:28:14.000Z","size":2437,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-08T07:36:28.023Z","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/doesdev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-07-26T00:51:47.000Z","updated_at":"2025-12-04T23:28:18.000Z","dependencies_parsed_at":"2024-11-19T06:54:46.467Z","dependency_job_id":null,"html_url":"https://github.com/doesdev/get-scrud","commit_stats":{"total_commits":57,"total_committers":2,"mean_commits":28.5,"dds":0.01754385964912286,"last_synced_commit":"64afb9522d725d75d5df3496c8945eae0029d872"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/doesdev/get-scrud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fget-scrud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fget-scrud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fget-scrud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fget-scrud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doesdev","download_url":"https://codeload.github.com/doesdev/get-scrud/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fget-scrud/sbom","scorecard":{"id":349598,"data":{"date":"2025-08-11","repo":{"name":"github.com/doesdev/get-scrud","commit":"bc64299caa8da7c01c8fc356973e62760a458417"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: 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":"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"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T08:00:34.842Z","repository_id":43831223,"created_at":"2025-08-18T08:00:34.842Z","updated_at":"2025-08-18T08:00:34.842Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28110831,"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","status":"online","status_checked_at":"2025-12-29T02:00:07.021Z","response_time":58,"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-11-19T02:39:47.235Z","updated_at":"2025-12-29T05:11:09.444Z","avatar_url":"https://github.com/doesdev.png","language":"JavaScript","readme":"# get-scrud [![NPM version](https://badge.fury.io/js/get-scrud.svg)](https://npmjs.org/package/get-scrud)   [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)   [![Dependency Status](https://dependencyci.com/github/doesdev/get-scrud/badge)](https://dependencyci.com/github/doesdev/get-scrud)\n\n\u003e Client for [SCRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) style rest APIs\n\n## Install\n\n```sh\n$ npm install --save get-scrud\n```\n\n## 5.0.0\n\nThis version removes the axios dependency and uses native fetch API instead.\nThis change requires Node.js v18+ or a fetch-compatible environment.\nIf you're running on older Node.js versions, you'll need to provide a fetch polyfill.\n\n## 2.0.0\n\nThis is a very breaking change, switching to ES Modules and eliminating babel.\nIf you are targeting older browsers you will need to include this module in any\nbabel-ification you're doing.\n\n## API\n\n#### Module ships single function which accepts options and returns main function\n\n#### `const apiCall = require('get-scrud')(*opts)`\n\n- **opts** *[object - required]*\n  - **host** *[string - required]* (ex. `'jsonplaceholder.typicode.com'`)\n  - **port** *[integer - optional - default: 443]* (ex. `80`)\n  - **protocol** *[string - optional - default is based on port]* (ex. `http`)\n  - **basePath** *[string - optional - default: null]* (ex. `'api'` or `'/api'`)\n  - **timeout** *[string | integer - optional - default: '1m' | 60000]* (ex. `'3m'`)\n  - **jwt** *[string - optional - default: null]* (ex. `'abc123'`)\n  - **cache** *[boolean - optional - default: false]* use cached instance instead of a fresh one on each invocation of top-level exported function\n  - **throttle** *[boolean | object - optional - default: false]* throttle API\n  calls, in object form uses the below options, if `true` the defaults are applied\n    - **interval** *[string | integer - default: '45s' | 45000]* reset call\n    counter every X ms\n    - **threshold** *[integer - default: 45]* max calls per interval\n    - **exclude** *[array - default: null]* calls that are ignored by throttle\n      - Array can contain objects, arrays, or strings\n      - The following are all equivalent\n        - `[{ api: 'user', action: 'read' }]`\n        - `[['user', 'read']]`\n        - `['user:read']`\n\n#### Main function returns `Promise` that resolves with JSON parsed response data\n\n#### `apiCall(*resource, *action, [*id, *body, *jwt])`\n\n- **resource** *[string - required]* (ex. `'posts'`)\n- **action** *[string - required]* (ex. `'search'`)\n- **id** *[integer - optional - default: null]* (ex. `1`)\n- **body** *[object - optional - default: null]* (ex. `{userId: 5}`)\n- **jwt** *[string - optional - default: null]* (ex. `'abc123'`)\n\n#### Alternatively address each action with `apiCall[action](...)`\n\n#### `apiCall.[search, create, read, update, delete](*resource, [*id, *body, *jwt])`\n\n- **resource** *[string - required]* (ex. `'posts'`)\n- **id** *[integer - optional - default: null]* (ex. `1`)\n- **body** *[object - optional - default: null]* (ex. `{userId: 5}`)\n- **jwt** *[string - optional - default: null]* (ex. `'abc123'`)\n\n#### Change options on an instance\n\nIf you need to change any options on an existing instance, you can call the main\nfunction with a single argument, which is the new options you want to\nmerge (Object.assign) with the original. That call will be synchronous.\n\n#### `apiCall(*opts)`\n\n- **opts** *[object - required]* (same as above)\n\n## Usage\n\n```js\nconst opts = {\n  host: 'jsonplaceholder.typicode.com',\n  port: 443,\n  timeout: '3m', // or '180s' or 180000\n  jwt: `abc123`\n}\nconst apiCall = require('get-scrud')(opts)\nconst body = {userId: 1, title: `get scrud yo`, body: `you're scrud`}\nconst jwt = `def456`\n\nasync function callApis () {\n\n  /* no jwt passed, uses jwt set in init if one was set */\n\n  // SEARCH\n  let search = await apiCall('posts', 'search', {userId: 1})\n  // CREATE\n  let create = await apiCall('posts', 'create', body)\n  // READ\n  let read = await apiCall('posts', 'read', 1)\n  // UPDATE\n  let update = await apiCall('posts', 'update', 1, {userId: 5})\n  // DELETE\n  let deleted = !!(await apiCall('posts', 'delete', 2))\n\n  /* passing in jwt to call, overrides jwt set in init if one was set */\n\n  // SEARCH\n  let search = await apiCall('posts', 'search', {userId: 1}, jwt)\n  // CREATE\n  let create = await apiCall('posts', 'create', body, jwt)\n  // READ\n  let read = await apiCall('posts', 'read', 1, jwt)\n  // UPDATE\n  let update = await apiCall('posts', 'update', 1, {userId: 5}, jwt)\n  // DELETE\n  let deleted = !!(await apiCall('posts', 'delete', 2, jwt))\n\n}\n```\n\n## Related\n\n[scrud](https://github.com/doesdev/scrud) - Super opinionated, minimalistic, PG centric API fabric\n\n\n## License\n\nMIT © [Andrew Carpenter](https://github.com/doesdev)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoesdev%2Fget-scrud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoesdev%2Fget-scrud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoesdev%2Fget-scrud/lists"}