{"id":20399130,"url":"https://github.com/nolim1t/assign-obj-params","last_synced_at":"2026-04-20T06:32:19.748Z","repository":{"id":57185221,"uuid":"91408941","full_name":"nolim1t/assign-obj-params","owner":"nolim1t","description":"Copy the information from one user defined object to another","archived":false,"fork":false,"pushed_at":"2017-06-16T09:20:04.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-13T22:04:51.943Z","etag":null,"topics":["library","utils","variables"],"latest_commit_sha":null,"homepage":null,"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/nolim1t.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":"2017-05-16T03:15:27.000Z","updated_at":"2017-05-16T03:26:11.000Z","dependencies_parsed_at":"2022-09-17T07:51:14.765Z","dependency_job_id":null,"html_url":"https://github.com/nolim1t/assign-obj-params","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nolim1t%2Fassign-obj-params","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nolim1t%2Fassign-obj-params/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nolim1t%2Fassign-obj-params/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nolim1t%2Fassign-obj-params/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nolim1t","download_url":"https://codeload.github.com/nolim1t/assign-obj-params/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241946510,"owners_count":20047020,"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":["library","utils","variables"],"created_at":"2024-11-15T04:27:10.173Z","updated_at":"2026-04-20T06:32:14.728Z","avatar_url":"https://github.com/nolim1t.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# assign-obj-params\n\n[![npm version](https://badge.fury.io/js/assign-obj-params.svg)](https://badge.fury.io/js/assign-obj-params)\n\n## About\n\nThis is a function I've been using for a while in other bits of code (my library code, as well as some other code I've been doing for clients).\n\nI did it to make things a bit more efficient.\n\n## Installing\n\n```bash\nnpm i assign-obj-params\n```\n\nor in a npm package\n\n```bash\nnpm i assign-obj-params --save\n```\n\n## Where its used (Open Source)\n\n* [nl-bxth](https://github.com/nolim1t/nl-bxth)\n* [nl-bitmex](https://github.com/nolim1t/nl-bitmex)\n\n## Examples\n\n### Case - Designing an API interface to an API\n\nI know all the API interface parameters, however I'd like to hide it away a bit more neatly in the library itself\n\n```javascript\nvar requestinfo = {}; // This comes from the function or method\n\nconst assignFormParamsIfExist = require('assign-obj-params');\nvar formParams = {\n    apikey: \"apikey\"\n};\n\nassignFormParamsIfExist(formParams, requestinfo, 'order_id');\nassignFormParamsIfExist(formParams, requestinfo, 'pairing');\n\n// After this formParams is built which can be used in the request.js library to send as an API request\n\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnolim1t%2Fassign-obj-params","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnolim1t%2Fassign-obj-params","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnolim1t%2Fassign-obj-params/lists"}