{"id":17419853,"url":"https://github.com/bendrucker/inject-then","last_synced_at":"2025-04-15T00:03:56.576Z","repository":{"id":14775417,"uuid":"17497076","full_name":"bendrucker/inject-then","owner":"bendrucker","description":"Promise wrapper for Hapi's server.inject","archived":false,"fork":false,"pushed_at":"2018-11-13T19:21:44.000Z","size":32,"stargazers_count":31,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T00:03:13.269Z","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/bendrucker.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":"2014-03-06T23:59:57.000Z","updated_at":"2020-09-09T00:32:23.000Z","dependencies_parsed_at":"2022-09-06T21:40:32.951Z","dependency_job_id":null,"html_url":"https://github.com/bendrucker/inject-then","commit_stats":null,"previous_names":["bendrucker/injectthen"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Finject-then","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Finject-then/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Finject-then/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Finject-then/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bendrucker","download_url":"https://codeload.github.com/bendrucker/inject-then/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981262,"owners_count":21193146,"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-10-17T02:34:33.505Z","updated_at":"2025-04-15T00:03:56.545Z","avatar_url":"https://github.com/bendrucker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"inject-then [![Build Status](https://travis-ci.org/bendrucker/inject-then.svg?branch=master)](https://travis-ci.org/bendrucker/inject-then) [![NPM version](https://badge.fury.io/js/inject-then.svg)](http://badge.fury.io/js/inject-then)\n==========\n\n\u003e Promise wrapper for [Hapi](https://github.com/spumko/hapi)'s `server.inject`.\n\n*`hapi@12`* and above return a promise when no callback is passed to `server.inject`. Use `inject-then` for hapi versions less than `12`.\n\n## Setup\n\n```bash\n$ npm install inject-then\n```\n\n```js\nserver.register(require('inject-then'), function (err) {\n  if (err) throw err\n})\n```\n\n## API\n\n#### `server.injectThen(options)` -\u003e `promise(response)`\n\n```js\nserver.injectThen('/posts')\n  .then(function (response) {\n    assert.equal(response.statusCode, 200)\n    console.log('Success!')\n  })\n```\n\n## Options\n\nThe following `options` can be provided at registration:\n\n* `Promise`: An optional Promise constructor (ES6 Promise or anything that can be called with `new Promise`). [Bluebird](https://github.com/petkaantonov/bluebird) is used if an override is not provided.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Finject-then","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbendrucker%2Finject-then","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Finject-then/lists"}