{"_id":"promisary","_rev":"3-cefa8236dc25f69f08ee17929f7a5993","name":"promisary","dist-tags":{"latest":"1.1.0"},"versions":{"0.0.0":{"name":"promisary","version":"0.0.0","keywords":["promise","promises","async","await","promise utilities","promise helpers","promise hash","promise object","rsvp","rsvp.hash","promise all","async tools","promisary"],"author":{"name":"RobbieTheWagner"},"license":"MIT","_id":"promisary@0.0.0","maintainers":[{"name":"rwwagner90","email":"rwwagner90@gmail.com"}],"homepage":"https://github.com/RobbieTheWagner/promisary#readme","bugs":{"url":"https://github.com/RobbieTheWagner/promisary/issues"},"dist":{"shasum":"10b88d72eecd562d8eff688feabad164d23becde","tarball":"https://registry.npmjs.org/promisary/-/promisary-0.0.0.tgz","fileCount":8,"integrity":"sha512-NYUrYCAPanIlkRK1N2sLBrMRoFZZMbcXlStmz2M+VBvD2vI5/K74ailxJfdOZswIwtUFaOlzsdWnbx6NrZGYxg==","signatures":[{"sig":"MEUCIAQo+W5FL5Q0xPsg+T5txVynoVXynav2ewP8vrhmlZAJAiEA6DSqHOB1dGZgJZlCGmIMRi3wjte2HGByangjA7S7fNc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6629},"main":"dist/hash.js","_from":"file:promisary-0.0.0.tgz","types":"dist/hash.d.ts","exports":{".":{"types":"./dist/hash.d.ts","import":"./dist/hash.js"}},"scripts":{"dev":"vitest watch","test":"vitest run","build":"tsc"},"_npmUser":{"name":"rwwagner90","email":"rwwagner90@gmail.com"},"_resolved":"/private/var/folders/cq/qn9nh03x0hq5kpgvfq9h168h0000gn/T/8877f2cd58e052f10bfb89c32c373e2b/promisary-0.0.0.tgz","_integrity":"sha512-NYUrYCAPanIlkRK1N2sLBrMRoFZZMbcXlStmz2M+VBvD2vI5/K74ailxJfdOZswIwtUFaOlzsdWnbx6NrZGYxg==","release-it":{"git":{"tagName":"v${version}"},"github":{"release":true,"tokenRef":"GITHUB_AUTH"},"plugins":{"@release-it-plugins/lerna-changelog":{"infile":"CHANGELOG.md","launchEditor":true}}},"repository":{"url":"git+https://github.com/RobbieTheWagner/promisary.git","type":"git"},"_npmVersion":"10.9.2","description":"A growing collection of utilities to make working with Promises easier and cleaner.","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^1.6.1","release-it":"^17.11.0","typescript":"^5.8.2","@types/node":"^20.17.30","@release-it-plugins/lerna-changelog":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/promisary_0.0.0_1743788730928_0.7589108687214301","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"promisary","version":"1.0.0","keywords":["promise","promises","async","await","promise utilities","promise helpers","promise hash","promise object","rsvp","rsvp.hash","promise all","async tools","promisary"],"author":{"name":"RobbieTheWagner"},"license":"MIT","_id":"promisary@1.0.0","maintainers":[{"name":"rwwagner90","email":"rwwagner90@gmail.com"}],"homepage":"https://github.com/RobbieTheWagner/promisary#readme","bugs":{"url":"https://github.com/RobbieTheWagner/promisary/issues"},"dist":{"shasum":"e03749b5296c7170d7fb36b702e876014ab11779","tarball":"https://registry.npmjs.org/promisary/-/promisary-1.0.0.tgz","fileCount":8,"integrity":"sha512-/FkhCNWopRQtoQcUTkhPLpwOrwh2Kshgn1Wn4UMzlsILdG1AbUbtC3mOrp+FDYMNt/19Rpdcyf0v/ECdH0BRXg==","signatures":[{"sig":"MEYCIQCJdMRl3G104DlVKQh6SmtEWI+pk/CkrN8p7pt9G76PDgIhAN2ZCOqEhMjxvRbuk25u81tMEp+bL4IVNgSS1hl1U+ou","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6630},"main":"dist/hash.js","types":"dist/hash.d.ts","exports":{".":{"types":"./dist/hash.d.ts","import":"./dist/hash.js"}},"gitHead":"9c99b678817d234a39a2268774c71411ea5f443e","scripts":{"dev":"vitest watch","test":"vitest run","build":"tsc"},"_npmUser":{"name":"rwwagner90","email":"rwwagner90@gmail.com"},"release-it":{"git":{"tagName":"v${version}"},"github":{"release":true,"tokenRef":"GITHUB_AUTH"},"plugins":{"@release-it-plugins/lerna-changelog":{"infile":"CHANGELOG.md","launchEditor":true}}},"repository":{"url":"git+https://github.com/RobbieTheWagner/promisary.git","type":"git"},"_npmVersion":"10.9.2","description":"A growing collection of utilities to make working with Promises easier and cleaner.","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^1.6.1","release-it":"^17.11.0","typescript":"^5.8.2","@types/node":"^20.17.30","@release-it-plugins/lerna-changelog":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/promisary_1.0.0_1743788778458_0.48594497115976476","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"promisary","version":"1.1.0","description":"A growing collection of utilities to make working with Promises easier and cleaner.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"vitest run","dev":"vitest watch"},"repository":{"type":"git","url":"git+https://github.com/RobbieTheWagner/promisary.git"},"keywords":["promise","promises","async","await","promise utilities","promise helpers","promise hash","promise object","rsvp","rsvp.hash","promise all","async tools","promisary"],"author":{"name":"RobbieTheWagner"},"license":"MIT","bugs":{"url":"https://github.com/RobbieTheWagner/promisary/issues"},"homepage":"https://github.com/RobbieTheWagner/promisary#readme","devDependencies":{"@release-it-plugins/lerna-changelog":"^7.0.0","@types/node":"^20.17.30","release-it":"^17.11.0","typescript":"^5.8.2","vitest":"^1.6.1"},"publishConfig":{"registry":"https://registry.npmjs.org"},"release-it":{"plugins":{"@release-it-plugins/lerna-changelog":{"infile":"CHANGELOG.md","launchEditor":true}},"git":{"tagName":"v${version}"},"github":{"release":true,"tokenRef":"GITHUB_AUTH"}},"_id":"promisary@1.1.0","gitHead":"a183a6c59cef99b639a5ab441b125d3530d9956b","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-1k0eATEnw/M607LDPY1C/M42PA4LmHjaj6S/gOPEjVO8akEWrWFB6nWbQpHLVNydI+l81GEa5ynSnKuVgPJMOA==","shasum":"b31baddbe698b497b3eac6ef75a104e6d62111fc","tarball":"https://registry.npmjs.org/promisary/-/promisary-1.1.0.tgz","fileCount":24,"unpackedSize":13398,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDk3toPijaVB/t724FJ/5RoejlafNO4kLbaRZSs8FpBPQIgWmgD2wPHNmS9XVyNg7ingB3PWtxtkxne4VT+POuZAcU="}]},"_npmUser":{"name":"rwwagner90","email":"rwwagner90@gmail.com"},"directories":{},"maintainers":[{"name":"rwwagner90","email":"rwwagner90@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/promisary_1.1.0_1743795729757_0.6023938813735847"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-04T17:45:30.846Z","modified":"2025-04-04T19:42:10.156Z","0.0.0":"2025-04-04T17:45:31.115Z","1.0.0":"2025-04-04T17:46:18.706Z","1.1.0":"2025-04-04T19:42:09.977Z"},"bugs":{"url":"https://github.com/RobbieTheWagner/promisary/issues"},"author":{"name":"RobbieTheWagner"},"license":"MIT","homepage":"https://github.com/RobbieTheWagner/promisary#readme","keywords":["promise","promises","async","await","promise utilities","promise helpers","promise hash","promise object","rsvp","rsvp.hash","promise all","async tools","promisary"],"repository":{"type":"git","url":"git+https://github.com/RobbieTheWagner/promisary.git"},"description":"A growing collection of utilities to make working with Promises easier and cleaner.","maintainers":[{"name":"rwwagner90","email":"rwwagner90@gmail.com"}],"readme":"# `promisary`\n\n[![npm version](https://img.shields.io/npm/v/promisary.svg?style=flat)](https://www.npmjs.com/package/promisary)\n[![license](https://img.shields.io/npm/l/promisary.svg?style=flat)](LICENSE)\n[![tests](https://img.shields.io/github/actions/workflow/status/RobbieTheWagner/promisary/test.yml?branch=main)](https://github.com/RobbieTheWagner/promisary/actions)\n\n> A growing collection of utilities to make working with Promises easier and cleaner.\n\n---\n\n## ✨ What is it?\n\n`promisary` is a growing collection of promise utilities to make async JavaScript easier and cleaner.\n\nThe first utilities available are `hash` and `hashSettled`, which help you work with objects of promises.\n\n- `hash`: Like `Promise.all`, but for objects. Rejects if any promise rejects.\n- `hashSettled`: Like `Promise.allSettled`, but for objects. Always resolves with a fulfilled or rejected state.\n\n**More utilities are planned for future releases!**\n\n---\n\n## 📦 Installation\n\n```bash\npnpm add promisary\n# or\nnpm install promisary\n# or\nyarn add promisary\n```\n\n---\n\n## 🔥 Usage\n\n### `hash`\n\n```typescript\nimport { hash } from 'promisary';\n\nasync function loadData() {\n  const result = await hash({\n    user: fetchUser(),\n    posts: fetchPosts(),\n  });\n\n  console.log(result.user); // Resolved user\n  console.log(result.posts); // Resolved posts\n}\n```\n\nYou can mix promises and plain values too:\n\n```typescript\nconst result = await hash({\n  a: 1,\n  b: Promise.resolve(2),\n  c: asyncOperation(),\n});\nconsole.log(result); // { a: 1, b: 2, c: <resolved value of asyncOperation> }\n```\n\nIf any promise rejects, the whole `hash` will reject immediately:\n\n```typescript\nawait hash({\n  a: Promise.reject(new Error('fail')),\n  b: Promise.resolve(2),\n});\n// -> throws Error: fail\n```\n\n---\n\n### `hashSettled`\n\n```typescript\nimport { hashSettled } from 'promisary';\n\nasync function loadDataSettled() {\n  const result = await hashSettled({\n    user: fetchUser(),\n    posts: fetchPosts(),\n  });\n\n  console.log(result.user); // { state: 'fulfilled', value: ... }\n  console.log(result.posts); // { state: 'fulfilled', value: ... } or { state: 'rejected', reason: ... }\n}\n```\n\nYou can safely inspect each result without worrying about rejected promises throwing errors.\n\n---\n\n## 🛠 Why use this?\n\n- **Drop-in replacement for `RSVP.hash` and `RSVP.hashSettled`**.\n- **No extra dependencies** besides native Promises.\n- **Tiny and tree-shakable** (~300 bytes minified).\n- **TypeScript ready** and fully tested.\n\nPerfect for cleaning up older Ember.js apps or anywhere you want better Promise ergonomics.\n\n---\n\n## ✅ Features\n\n- Supports plain values and promises.\n- Rejects early (with `hash`) or always resolves (with `hashSettled`).\n- Fully typed with TypeScript.\n- Lightweight and fast.\n- More Promise utilities coming soon!\n\n---\n\n## 📅 Roadmap\n\nHere are some utilities planned for future releases:\n\n- **`timeout`** — Add a timeout to any promise, rejecting if it takes too long.\n- **`raceObject`** — Like `Promise.race`, but for an object of promises.\n- **`delay`** — Create a promise that resolves after a specified delay.\n- **More to come!**\n\nHave ideas? [Open an issue](https://github.com/RobbieTheWagner/promisary/issues) or send a PR!\n\n---\n\n## 📜 License\n\nMIT\n","readmeFilename":"README.md"}