{"id":23338749,"url":"https://github.com/appfeel/jsobjects","last_synced_at":"2026-04-06T08:01:44.900Z","repository":{"id":57284615,"uuid":"81076970","full_name":"appfeel/jsobjects","owner":"appfeel","description":"A js library to access and manipulate objects","archived":false,"fork":false,"pushed_at":"2017-03-09T01:41:36.000Z","size":72,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-03-08T00:48:08.567Z","etag":null,"topics":["bower","bower-components","browser","browserify-plugin","javascript-library","manipulate-objects","node","node-js","nodejs","npm","npm-module","npm-package","objects"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appfeel.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":"2017-02-06T10:44:18.000Z","updated_at":"2017-02-06T17:49:35.000Z","dependencies_parsed_at":"2022-08-25T07:20:17.891Z","dependency_job_id":null,"html_url":"https://github.com/appfeel/jsobjects","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/appfeel/jsobjects","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfeel%2Fjsobjects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfeel%2Fjsobjects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfeel%2Fjsobjects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfeel%2Fjsobjects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appfeel","download_url":"https://codeload.github.com/appfeel/jsobjects/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfeel%2Fjsobjects/sbom","scorecard":{"id":203496,"data":{"date":"2025-08-11","repo":{"name":"github.com/appfeel/jsobjects","commit":"e524997fee9bb3b41a489a67733018ce9ed17436"},"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":"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":"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":"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":"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":"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":"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":"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":"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":"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: European Union Public License 1.1: 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"}}]},"last_synced_at":"2025-08-16T23:14:06.957Z","repository_id":57284615,"created_at":"2025-08-16T23:14:06.957Z","updated_at":"2025-08-16T23:14:06.957Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31464102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"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":["bower","bower-components","browser","browserify-plugin","javascript-library","manipulate-objects","node","node-js","nodejs","npm","npm-module","npm-package","objects"],"created_at":"2024-12-21T03:16:18.534Z","updated_at":"2026-04-06T08:01:44.864Z","avatar_url":"https://github.com/appfeel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"JSObjects\n=========\n\nThis small library allows you to manipulate objects via string path. It can be used in node.js or browser or any place where javascript can be run.\n\n![License: EUPL v1.1](http://img.shields.io/badge/License-EUPL_v1.1-blue.svg?style=flat)\n[![NPM version](http://img.shields.io/npm/v/jsobjects.svg?style=flat)](https://npmjs.org/package/jsobjects)\n[![Downloads](http://img.shields.io/npm/dm/jsobjects.svg?style=flat)](https://npmjs.org/package/jsobjects)\n[![Build Status](https://travis-ci.org/appfeel/jsobjects.svg?branch=master)](https://travis-ci.org/appfeel/jsobjects)\n[![Coverage Status](https://coveralls.io/repos/github/appfeel/jsobjects/badge.svg)](https://coveralls.io/github/appfeel/jsobjects)\n\n\n## Node.js\n\n```\nnpm i jsobjects --save\n```\n\n```js\nimport { expandPath, getObjectByPath, updateObjectByPath } from 'jsobjects';\n\n// Will use this objects to show ussage in examples\nconst arrstr = ['string 1', 'string 2'];\nconst arrobj = [\n    {\n        arrobjkey1: 'arrobj1key1',\n        'arr obj key 2': 'arr obj 1 key 2',\n    },\n    {\n        arrobjkey1: 'arrobj2key1',\n        'arr obj key 2': 'arr obj 2 key 2',\n    },\n];\nconst object = {\n    key1: 'key1',\n    'key 2': 'key 2',\n    arrstr,\n    arrobj,\n    obj: {\n        objkey1: 'objkey1',\n        'obj key 2': 'obj key 2',\n        objarrstr: arrstr,\n        objarrobj: arrobj,\n    },\n    arr: [\n        {\n            arrkey1: 'arr1key1',\n            'arr key 2': 'arr 1 key 2',\n            arrarrstr: arrstr,\n            arrarrobj: arrobj,\n        },\n        {\n            arrkey1: 'arr2key1',\n            'arr key 2': 'arr 2 key 2',\n            arrarrstr: arrstr,\n            arrarrobj: arrobj,\n        },\n    ],\n};\n```\n\n## browser\n\n```\nbower install jsobjects --save\n```\n\nSee demo in `./demo` folder.\n\n```html\n\u003cscript src=\"bower_components/dist/bundle.js\"\u003e\u003c/script\u003e\n```\n\n```js\n// This module exposes require from browserify\nvar jsobjects = require('jsobjects');\n\n// Will use this objects to show usage in examples\nvar arrstr = ['string 1', 'string 2'];\nvar arrobj = [\n    {\n        arrobjkey1: 'arrobj1key1',\n        'arr obj key 2': 'arr obj 1 key 2',\n    },\n    {\n        arrobjkey1: 'arrobj2key1',\n        'arr obj key 2': 'arr obj 2 key 2',\n    },\n];\nvar object = {\n    key1: 'key1',\n    'key 2': 'key 2',\n    arrstr: arrstr,\n    arrobj: arrobj,\n    obj: {\n        objkey1: 'objkey1',\n        'obj key 2': 'obj key 2',\n        objarrstr: arrstr,\n        objarrobj: arrobj,\n    },\n    arr: [\n        {\n            arrkey1: 'arr1key1',\n            'arr key 2': 'arr 1 key 2',\n            arrarrstr: arrstr,\n            arrarrobj: arrobj,\n        },\n        {\n            arrkey1: 'arr2key1',\n            'arr key 2': 'arr 2 key 2',\n            arrarrstr: arrstr,\n            arrarrobj: arrobj,\n        },\n    ],\n};\n```\n\n# API\n\n## getObjectByPath\n`getObjectByPath(object, path, pathReplacements, offset)`\n\nGiven an object and a path or generic path, returns the value contained in the object at the specified path.\n\n- `object`: The object to search for `path`\n- `path`: The path to be expanded, accepts `.*` notation\n- `pathReplacements`: Every `*` in path will be replaced by corresponding in pathReplacements array: `('arr.*.arrarrobj.*.arrkey1', [0, 1])` will be assimilated to `arr.0.arrarrobj.1.arrkey1`\n- `offset`: Number of paths to skip at the end: `('arr.*.arrarrobj.*.arrkey1', [0, 1], 3)` will be assimilated to `arr.0`\n\n#### Examples\n\n```js\n\n// These statements evals to true\ngetObjectByPath(object, 'arr.0.arrarrobj.0.arrobjkey1')                   === object.arr[0].arrarrobj[0].arrobjkey1;\ngetObjectByPath(object, 'arr.*.arrarrobj.*.[\"arr obj key 2\"]', [0, 1])    === object.arr[0].arrarrobj[1]['arr obj key 2'];\ngetObjectByPath(object, \"arr.*.arrarrobj.*.['arr obj key 2']\", [0, 1])    === object.arr[0].arrarrobj[1]['arr obj key 2'];\ngetObjectByPath(object, 'arr.*.arrarrobj.*.[\"arr obj key 2\"]', [1, 1], 1) === object.arr[1].arrarrobj[1];\n```\n\n\n## expandPath\n`expandPath(object, path, callback)`\n\nGiven an object and a generic path, returns an array with all the paths found in the object.\nComplex keys (not single word) allows to be refferenced with `[\"name of the key\"]` or `['name of the key']`.\n\n- `object`: The object to search for `path`\n- `path`: The path to be expanded, accepts `.*` notation\n- `callback`: (Optional) a callback function that will be called for each entry found\n\n\n#### Examples\n\n```js\nexpandPath(object, 'arrstr'); // will output: ['arrstr.0', 'arrstr.1'];\nexpandPath(object, 'arrobj.*'); // will output: ['arrstr.0', 'arrstr.1'];\n\nexpandPath(object, 'arrstr.*'); // will output: ['arrstr.0', 'arrstr.1']\nexpandPath(object, 'arrobj.*'); // will output: ['arrobj.0', 'arrobj.1']\n\nexpandPath(object, 'obj.objarrstr.*'); // will output: ['obj.objarrstr.0', 'obj.objarrstr.1']\nexpandPath(object, 'obj.objarrobj.*'); // will output: ['obj.objarrobj.0', 'obj.objarrobj.1']\n\nexpandPath(object, 'obj.objarrobj.*.arrobjkey1'); // will output: ['obj.objarrobj.0.arrobjkey1', 'obj.objarrobj.1.arrobjkey1']\nexpandPath(object, 'obj.objarrobj.*.[\"arr obj key 2\"]'); // will output: ['obj.objarrobj.0.[\"arr obj key 2\"]', 'obj.objarrobj.1.[\"arr obj key 2\"]']\n\nexpandPath(object, 'arr.*'); // will output: ['arr.0', 'arr.1']\n\nexpandPath(object, 'arr.*.arrkey1'); // will output: ['arr.0.arrkey1', 'arr.1.arrkey1']\nexpandPath(object, 'arr.*.[\"arr key 2\"]'); // will output: ['arr.0.[\"arr key 2\"]', 'arr.1.[\"arr key 2\"]']\n\nexpandPath(object, 'arr.*.arrarrstr'); // will output: ['arr.0.arrarrstr', 'arr.1.arrarrstr']\nexpandPath(object, 'arr.*.arrarrstr.*'); // will output: ['arr.0.arrarrstr.0', 'arr.0.arrarrstr.1', 'arr.1.arrarrstr.0', 'arr.1.arrarrstr.1']\nexpandPath(object, 'arr.*.arrarrobj.*'); // will output: ['arr.0.arrarrobj.0', 'arr.0.arrarrobj.1', 'arr.1.arrarrobj.0', 'arr.1.arrarrobj.1']\n\nexpandPath(object, 'arr.*.arrarrobj.*.arrkey1'); // will output: ['arr.0.arrarrobj.0.arrkey1', 'arr.0.arrarrobj.1.arrkey1', 'arr.1.arrarrobj.0.arrkey1', 'arr.1.arrarrobj.1.arrkey1']\nexpandPath(object, 'arr.*.arrarrobj.*.[\"arr key 2\"]'); // will output: ['arr.0.arrarrobj.0.[\"arr key 2\"]', 'arr.0.arrarrobj.1.[\"arr key 2\"]', 'arr.1.arrarrobj.0.[\"arr key 2\"]', 'arr.1.arrarrobj[\"arr key 2\"]']));\n\nexpandPath(object); // will output: []\nexpandPath(object, ''); // will output: []\nexpandPath(object, 'unexistingkey'); // will output: []\nexpandPath(object, 'unexistingkey.*'); // will output: []\nexpandPath(object, 'arr.*.unexistingkey'); // will output: ['arr.0.unexistingkey', 'arr.1.unexistingkey']\nexpandPath(object, 'arr.*.unexistingkey.*'); // will output: []\n\n\nexpandPath(object, 'arr.*.arrarrstr', cb); // will output: ['arr.0.arrarrstr', 'arr.1.arrarrstr']\n// cb function will be called twice with the followint arguments:\n// First call: cb('arr.0.arrarrstr', ['string 1', 'string 2'])\n// Second call: cb('arr.1.arrarrstr', ['string 1', 'string 2'])\n```\n\n## updateObjectByPath\n`updateObjectByPath(object, path, newValue, pathReplacements)`\n\nUpdate the object at a given path with a specified value.\n\n- `object`: The object to search for `path`\n- `path`: The path to be expanded, accepts `.*` notation\n- `newValue`: The new value to be assigned\n- `pathReplacements`: Every `*` in path will be replaced by corresponding in pathReplacements array: `('arr.*.arrarrobj.*.arrkey1', [0, 1])` will be assimilated to `arr.0.arrarrobj.1.arrkey1`\n\n#### Examples\n\n```js\nupdateObjectByPath(object, 'arrobj.*.arrobjkey1', 'new value', [1]);\n\n// This statement evals to true\ngetObjectByPath(object, 'arrobj.*.arrobjkey1', [1]) === 'new value';\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappfeel%2Fjsobjects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappfeel%2Fjsobjects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappfeel%2Fjsobjects/lists"}