{"name":"promise-make-naked","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/promise-make-naked.git"},"description":"A simple function that makes a promise that can be resolved or rejected from the outside.","version":"2.1.0","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["promise","naked"],"devDependencies":{"fava":"^0.2.0","tsex":"^3.0.1","typescript":"^5.1.6"},"gitHead":"f133bf0494fb1d23f8b200fb10e59ab6e3a5ec4c","bugs":{"url":"https://github.com/fabiospampinato/promise-make-naked/issues"},"homepage":"https://github.com/fabiospampinato/promise-make-naked#readme","_id":"promise-make-naked@2.1.0","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-WXrAp4kEbqMIGrRJl5rEbxLyFQcU0RmlZ4x299xCusyuhAM+r5or+R9gyp/wovOGXXLZlmwhCeO6tBUrKfbsFw==","shasum":"3cdf8c4c283518631a2386ce04f388b0403b454b","tarball":"http://registry-npm.ywwl.com/promise-make-naked/download/promise-make-naked-2.1.0.tgz","fileCount":15,"unpackedSize":8585,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC0iMYY5inDPTo6a8vEeAC+05sFk0mH1NTaFDth2c33fAiAPHBKHqfhUCkDkQVChAArxukhVMeTbyDMHzMJA8knfCw=="}],"size":2978,"noattachment":false,"key":"/promise-make-naked/-/promise-make-naked-2.1.0.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-make-naked_2.1.0_1691753874863_0.6081215562323683"},"_hasShrinkwrap":false,"readme":"# Promise Make Naked\n\nA simple function that makes a promise that can be resolved or rejected from the outside.\n\n## Install\n\n```sh\nnpm install --save promise-make-naked\n```\n\n## Usage\n\n```ts\nimport makeNakedPromise from 'promise-make-naked';\n\n// Let's create a naked Promise\n\nconst {promise, resolve, reject, isPending, isResolved, isRejected} = makeNakedPromise ();\n\nresolve ( 123 ); // Resolve the promise with the provided value\nreject ( new Error () ); // Reject the promise with the provided reason\n\nisPending (); // Check if promise is still pending\nisResolved (); // Check if the promise got resolved\nisRejected (); // Check if the promise got rejected\n\n// Let's create a naked Promise similarly to how a normal Promise is created\n\nconst result = makeNakedPromise.wrap ( ({ promise, resolve, reject, isPending, isResolved, isRejected }) => {\n\n  resolve ( 123 );\n\n});\n```\n\n## License\n\nMIT © Fabio Spampinato\n","publish_time":1691753875046,"_cnpm_publish_time":1691753875046,"dist-tags":{"latest":"3.0.2"}}