{"id":29584372,"url":"https://github.com/lite-js/try2get","last_synced_at":"2025-07-20T00:34:16.556Z","repository":{"id":57380424,"uuid":"63566416","full_name":"lite-js/try2get","owner":"lite-js","description":"get any or get all return values","archived":false,"fork":false,"pushed_at":"2017-07-13T03:05:12.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-12T22:16:58.240Z","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/lite-js.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":"2016-07-18T03:10:50.000Z","updated_at":"2018-06-28T18:58:30.000Z","dependencies_parsed_at":"2022-09-05T13:51:29.580Z","dependency_job_id":null,"html_url":"https://github.com/lite-js/try2get","commit_stats":null,"previous_names":["leungwensen/try2get"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lite-js/try2get","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lite-js%2Ftry2get","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lite-js%2Ftry2get/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lite-js%2Ftry2get/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lite-js%2Ftry2get/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lite-js","download_url":"https://codeload.github.com/lite-js/try2get/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lite-js%2Ftry2get/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266048706,"owners_count":23868744,"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":"2025-07-20T00:34:15.801Z","updated_at":"2025-07-20T00:34:16.524Z","avatar_url":"https://github.com/lite-js.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"try2get\n=======\n\n[![npm version](https://badge.fury.io/js/%40lite-js%2Ftry2get.svg)](https://badge.fury.io/js/%40lite-js%2Ftry2get) [![Build Status](https://travis-ci.org/lite-js/try2get.svg?branch=master)](https://travis-ci.org/lite-js/try2get)\n\nget any or get all return values\n\n## install\n\n```shell\nnpm i @lite-js/try2get --save\n```\n\n## use cases\n\ngetting a supported XHR object [xhr.js](./example/xhr.js):\n\n```javascript\nconst try2get = require('try2get');\nconst xhr = try2get.one(\n    () =\u003e new XMLHttpRequest(),\n    () =\u003e new ActiveXObject('MSXML2.XMLHTTP'),\n    () =\u003e new ActiveXObject('Microsoft.XMLHTTP')\n);\n```\n\nlisting all the supported features [built-ins.js](./example/built-ins.js):\n\n```javascript\nconst try2get = require('../index');\nconst lang = require('zero-lang');\n\nconst features = try2get.all([\n    () =\u003e ArrayBuffer,\n    () =\u003e Atomics,\n    () =\u003e DataView,\n    () =\u003e Float32Array,\n    () =\u003e Float64Array,\n    () =\u003e JSON,\n    () =\u003e Map,\n    () =\u003e Math,\n    () =\u003e Promise,\n    () =\u003e Proxy,\n    () =\u003e Reflect,\n    () =\u003e SIMD,\n    () =\u003e Set,\n    () =\u003e Symbol,\n    () =\u003e Uint16Array,\n    () =\u003e Uint32Array,\n    () =\u003e Uint8Array,\n    () =\u003e Uint8ClampedArray,\n    () =\u003e WeakMap,\n    () =\u003e WeakSet,\n]);\n\nconsole.log(lang.map(features, feature =\u003e feature.toString()));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flite-js%2Ftry2get","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flite-js%2Ftry2get","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flite-js%2Ftry2get/lists"}