{"id":15707168,"url":"https://github.com/bulkan/risposta","last_synced_at":"2025-05-12T19:27:43.627Z","repository":{"id":13634792,"uuid":"16328148","full_name":"bulkan/risposta","owner":"bulkan","description":"functions from @caolan/async implemented using promises","archived":false,"fork":false,"pushed_at":"2014-02-27T10:48:24.000Z","size":306,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T01:19:04.859Z","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/bulkan.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-01-28T22:25:46.000Z","updated_at":"2022-08-19T18:30:24.000Z","dependencies_parsed_at":"2022-08-29T08:30:27.804Z","dependency_job_id":null,"html_url":"https://github.com/bulkan/risposta","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/bulkan%2Frisposta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulkan%2Frisposta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulkan%2Frisposta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulkan%2Frisposta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bulkan","download_url":"https://codeload.github.com/bulkan/risposta/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253807615,"owners_count":21967395,"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-03T20:37:38.849Z","updated_at":"2025-05-12T19:27:43.599Z","avatar_url":"https://github.com/bulkan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"risposta\n========\n\nFunctions from [caolan/async](github.com/caolan/async) implemented using promises. \n\nInternally  _risposta_ uses the popular Promise implementation [Q](github.com/kriskowal/q)\nand the new [faster](http://spion.github.io/posts/why-i-am-switching-to-promises.html) \nPromise library [bluebird](https://github.com/petkaantonov/bluebird).\n\nThe inital code for _risposta_ is based off this [gist](https://gist.github.com/wavded/6116786)\nby @wavdad. _risposta_ is feature complete with async.js. For example the \nimplemenation of `async.series` \u0026 `async.parallel` by @wavdad does not support\nthe ability to pass in a object containing task functions as properties. This meas that\nyou can easily replace async with _risposta_.\n\nThe tests for _risposta_ is actually the [nodeunit](https://github.com/caolan/async/blob/master/test/test-async.js)\ntests from async converted to Mocha and promisified.\n\n## Usage\n\nInstall it via;\n\n    npm install risposta\n\n\n```javascript\n/** This will initilize the bluebird implementation of async\n* you can also call .q() to initilize the implementation of\n* async using Q\n*/\n\nvar async = require('risposta').bluebird();\n```\n\n### async.series\n\n```javascript\nasync.series([\n  function(callback){\n    setTimeout(function(){\n      callback(null, 2);\n    }, 100);\n  },\n\n  function(callback){\n    setTimeout(function(){\n      callback(null, 'a', 'b');\n    }, 50)\n  },\n\n  function(callback){\n    setTimeout(function(){\n      callback(null, 3);\n    }, 110)\n  }\n]).then(function(results){\n  console.log(results); \n  // result is [ 2, [ 'a', 'b' ], 3 ] ] ]\n});\n\n```\n\nMost of the examples in the README.md of [async](https://github.com/caolan/async/blob/master/README.md)\nis supported by _risposta_. Just keep in mind that there is no optional callback you always get a promise.\n\nFor example, the example for [async.times](https://github.com/caolan/async/blob/master/README.md#times) is done like so;\n\n```javascript\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n  callback(null, {\n    id: 'user' + id\n  })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n  createUser(n, function(err, user) {\n    next(err, user)\n  })\n}).then(function(users) {\n  // we should now have 5 users\n});\n```\n\n**risposta** : Italian - _[Noun]_ answer, reply, response \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbulkan%2Frisposta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbulkan%2Frisposta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbulkan%2Frisposta/lists"}