{"id":17464549,"url":"https://github.com/hqarroum/proxify-url","last_synced_at":"2025-09-11T18:44:22.341Z","repository":{"id":58242382,"uuid":"42720600","full_name":"HQarroum/proxify-url","owner":"HQarroum","description":":steam_locomotive: A YQL wrapper used to generate a proxy URL to a given resource.","archived":false,"fork":false,"pushed_at":"2020-02-28T03:42:19.000Z","size":32,"stargazers_count":6,"open_issues_count":6,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T12:35:32.881Z","etag":null,"topics":["cors","proxy-url","yql-wrapper"],"latest_commit_sha":null,"homepage":"","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/HQarroum.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":"2015-09-18T12:26:50.000Z","updated_at":"2023-09-03T16:01:05.000Z","dependencies_parsed_at":"2022-08-31T01:00:08.848Z","dependency_job_id":null,"html_url":"https://github.com/HQarroum/proxify-url","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HQarroum%2Fproxify-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HQarroum%2Fproxify-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HQarroum%2Fproxify-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HQarroum%2Fproxify-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HQarroum","download_url":"https://codeload.github.com/HQarroum/proxify-url/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249787125,"owners_count":21325569,"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":["cors","proxy-url","yql-wrapper"],"created_at":"2024-10-18T10:46:16.694Z","updated_at":"2025-04-19T19:57:16.046Z","avatar_url":"https://github.com/HQarroum.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](https://s.yimg.com/lq/i/us/pps/yql128.gif)\n\n# proxify-url\n[![Build Status](https://travis-ci.org/HQarroum/proxify-url.svg?branch=master)](https://travis-ci.org/HQarroum/proxify-url)\n[![Code Climate](https://codeclimate.com/github/HQarroum/proxify-url/badges/gpa.svg)](https://codeclimate.com/github/HQarroum/proxify-url)\n\nAn YQL wrapper used to generate a proxy URL to a given resource.\n\nCurrent version: **1.0.1**\n\nLead Maintainer: [Halim Qarroum](mailto:hqm.post@gmail.com)\n\n## Install\n\n##### Using NPM\n\n```bash\nnpm install --save proxify-url\n```\n\n##### Using Bower\n\n```bash\nbower install --save proxify-url\n```\n\n## Description\n\nThis small component aims to make it possible to issue AJAX requests to third-party resources when it is not possible in normal cases, typically because of [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) or because the remote service does not support [JSONP](https://en.wikipedia.org/wiki/JSONP) for instance.\n\nThe library will generate an URL pointing to the initial resource, but instead of having the browser directly request the remote server for the resource, it will request the Yahoo Query Language API to act as a middle man since it supports `CORS` and `JSONP`.\n\n## Usage\n\n### Proxify an url\n\nSimply require the `proxify-url` module according to the environment you are in (Node.js, AMD and the browser are supported), and call the returned function with the given URL. An example in the browser would be as follow :\n\n```javascript\nvar url = proxify('https://api.github.com/users/octocat');\n```\n\n\u003e Note that the returned proxy URL will be secured and that by default the output will be a JSON document.\n\n### Options\n\nTo customize the proxy URL parameters and how the document is returned by the YQL API, you can pass the following options to the `proxify` function :\n\nOption key    | Description\n------------- | -------------\n`outputformat`| The format in which the document must be returned. The default value is `json`.\n`inputFormat` | Indicates in what format the YQL API should be parsing the document. The default value is `json`.\n`jsonCompat`  | YQL transforms all JSON data sources into XML before returning results. During the tranformation from XML to JSON, the original JSON may be altered or become \"lossy\". In other words, the original JSON may not be the same as the returned JSON. By default, this library disables lossy JSON, but you can pass the boolean `false` to get a lossy JSON.\n`callback`    | Indicates to the YQL API that it should return the result of the query as a parameter of a function, in a JSONP manner. The value of the `callback` parameter specifies the name of the function.\n\n#### Example\n\nThe below example will ask the YQL API to parse the document as JSON and to output it as an XML document, and to pass it to a function called `foo`.\n\n```javascript\nvar url = proxify('http://jsonplaceholder.typicode.com/posts', {\n  inputFormat: 'json',\n  outputFormat: 'xml',\n  callback: 'foo'\n});\n```\n\n### No conflict\n\nSince this module is distributed in the form of an UMD (Univeral Module Definition), it might be easy to use it using module loaders such as `RequireJS` or `require` in Node while still keeping the module completely encapsulated.\n\nHowever, in the context of a browser, the `proxify` object name is exported in the global namespace. To prevent it from conflicting with another component exporting an object with the same name, you can use the `.noConflict` function as follow.\n\n```javascript\nvar proxy = proxify.noConflict();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhqarroum%2Fproxify-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhqarroum%2Fproxify-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhqarroum%2Fproxify-url/lists"}