{"id":13826747,"url":"https://github.com/gcdurastanti/js-extract","last_synced_at":"2025-07-09T01:31:16.731Z","repository":{"id":34292690,"uuid":"174640478","full_name":"gcdurastanti/js-extract","owner":"gcdurastanti","description":"Fancy extractor for js objects","archived":false,"fork":false,"pushed_at":"2023-03-04T03:18:58.000Z","size":222,"stargazers_count":9,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-07T23:54:22.298Z","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/gcdurastanti.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-03-09T02:50:06.000Z","updated_at":"2021-10-31T02:25:18.000Z","dependencies_parsed_at":"2024-01-18T04:08:52.982Z","dependency_job_id":"1b6525af-ca16-4e33-8844-96a05345753d","html_url":"https://github.com/gcdurastanti/js-extract","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/gcdurastanti%2Fjs-extract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcdurastanti%2Fjs-extract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcdurastanti%2Fjs-extract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcdurastanti%2Fjs-extract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gcdurastanti","download_url":"https://codeload.github.com/gcdurastanti/js-extract/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225476383,"owners_count":17480215,"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-08-04T09:01:43.516Z","updated_at":"2024-11-20T05:31:03.332Z","avatar_url":"https://github.com/gcdurastanti.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# js-extract\n\nFancy extractor for js objects that is like destructuring but safer.\n\n## Install\n\n`npm install --save @gdurastanti/js-extract`\n\n## Use\n\n`import extract from @gdurastanti/'js-extract'`\n\nOR\n\n`var extract = require('@gdurastanti/js-extract').default`\n\n### Example\n\n```javascript\nconst data = {\n  one: {\n    num: 1,\n    str: 'one',\n    foo: {\n      bar: 'baz',\n    },\n  },\n  two: {\n    num: 2,\n    str: 'two',\n    foo: {\n      bar: 'baz',\n    },\n  }\n};\n\nconst selector = `\n  one: {\n    str\n  },\n  two: {\n    num,\n    foo\n  }\n`\n\nextract(selector).from(data);\n```\n\n**Result:**\n\n```javascript\n{\n  one: {\n    str: 'one'\n  },\n  two: {\n    num: 2,\n    foo: {\n      bar: 'baz'\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcdurastanti%2Fjs-extract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgcdurastanti%2Fjs-extract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcdurastanti%2Fjs-extract/lists"}