{"id":15683613,"url":"https://github.com/doowb/fly-api","last_synced_at":"2025-08-04T09:32:37.114Z","repository":{"id":57239199,"uuid":"101003854","full_name":"doowb/fly-api","owner":"doowb","description":"Fly.io API wrapper for simplifying REST calls.","archived":false,"fork":false,"pushed_at":"2017-08-23T21:04:07.000Z","size":11,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-23T03:47:37.576Z","etag":null,"topics":["api","fly","flyio","rest-api","restful"],"latest_commit_sha":null,"homepage":"https://github.com/doowb","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/doowb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-22T00:34:20.000Z","updated_at":"2022-11-26T00:38:34.000Z","dependencies_parsed_at":"2022-08-30T00:11:07.739Z","dependency_job_id":null,"html_url":"https://github.com/doowb/fly-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/doowb/fly-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Ffly-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Ffly-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Ffly-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Ffly-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doowb","download_url":"https://codeload.github.com/doowb/fly-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Ffly-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268675515,"owners_count":24288285,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"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":["api","fly","flyio","rest-api","restful"],"created_at":"2024-10-03T17:07:41.895Z","updated_at":"2025-08-04T09:32:37.088Z","avatar_url":"https://github.com/doowb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fly-api [![NPM version](https://img.shields.io/npm/v/fly-api.svg?style=flat)](https://www.npmjs.com/package/fly-api) [![NPM monthly downloads](https://img.shields.io/npm/dm/fly-api.svg?style=flat)](https://npmjs.org/package/fly-api)  [![NPM total downloads](https://img.shields.io/npm/dt/fly-api.svg?style=flat)](https://npmjs.org/package/fly-api) [![Fly.io Community Slack](https://fly.io/slack/badge.svg)](https://fly.io/slack/)\n\n\u003e Fly.io API wrapper for simplifying REST calls.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save fly-api\n```\n\nInstall with [yarn](https://yarnpkg.com):\n\n```sh\n$ yarn add fly-api\n```\n\n## Usage\n\n```js\nvar Fly = require('fly-api');\n```\n\n## API\n\n### [Fly](index.js#L18)\n\nCreate a new Fly instance using the given options.\n\n**Params**\n\n* `options` **{Object}**: Options for setting authentication token and api url.\n* `options.token` **{String}**: Authentication token for fly.io api.\n* `options.url` **{String}**: fly.io api url. Defaults to (https://fly.io/api/v1/)\n\n**Example**\n\n```js\nvar fly = new Fly({token: 'xxxx'});\n```\n\n### [.get](index.js#L51)\n\nSend a GET request to the specified `path` at the fly.io api url.\n\n**Params**\n\n* `path` **{String}**: Path to use after the api url\n* `options` **{Object}**: Options\n* `cb` **{Function}**: Callback function that takes an `err` and `result` parameters.\n\n**Example**\n\n```js\nfly.get('sites/doowb/hostnames', {}, function(err, result) {\n  if (err) {\n    console.error(err);\n    return;\n  }\n  console.log(result);\n  //=\u003e {\n  //=\u003e   \"data\": {\n  //=\u003e     \"attributes\": {\n  //=\u003e        \"hostname\": \"foo.doowb.com\"\n  //=\u003e     }\n  //=\u003e   }\n  //=\u003e }\n});\n```\n\n### [.post](index.js#L90)\n\nSend a POST request to the specified `path` at the fly.io api url.\n\n**Params**\n\n* `path` **{String}**: Path to use after the api url\n* `data` **{Object}**: The payload to send in the post.\n* `cb` **{Function}**: Callback function that takes an `err` and `result` parameters.\n\n**Example**\n\n```js\nvar options = {\n  data: {\n    attributes: { hostname: 'bar.doowb.com' }\n  }\n};\n\nfly.post('sites/doowb/hostnames', options, function(err, result) {\n  if (err) {\n    console.error(err);\n    return;\n  }\n  console.log(result);\n  //=\u003e {\n  //=\u003e   \"data\": {\n  //=\u003e     \"attributes\": {\n  //=\u003e        \"hostname\": \"bar.doowb.com\"\n  //=\u003e     }\n  //=\u003e   }\n  //=\u003e }\n});\n```\n\n## About\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\nPlease read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Brian Woodward**\n\n* [github/doowb](https://github.com/doowb)\n* [twitter/doowb](https://twitter.com/doowb)\n\n### License\n\nCopyright © 2017, [Brian Woodward](https://doowb.com).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on August 21, 2017._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Ffly-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoowb%2Ffly-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Ffly-api/lists"}