{"_id":"@antoniovdlc/defer","_rev":"6-d5b7082db1058128fd8243c2331f6321","name":"@antoniovdlc/defer","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.1":{"name":"@antoniovdlc/defer","version":"0.0.1","description":"Go-like defer functions in JavaScript.","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","scripts":{"prepare":"husky install","type:check":"tsc --noEmit","format":"prettier --write --ignore-unknown {src,test}/*","format:check":"prettier --check {src,test}/*","test":"jest","pre-commit":"lint-staged","prebuild":"rimraf dist && mkdir dist","build":"npm run build:types && npm run build:lib","build:types":"tsc --declaration --emitDeclarationOnly --outDir dist","build:lib":"rollup -c","postversion":"git push && git push --tags"},"keywords":["defer","function"],"author":{"name":"Antonio Villagra De La Cruz"},"repository":{"type":"git","url":"git+https://github.com/AntonioVdlC/defer.git"},"bugs":{"url":"https://github.com/AntonioVdlC/defer/issues"},"homepage":"https://github.com/AntonioVdlC/defer#readme","license":"MIT","devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.5","@babel/preset-typescript":"^7.14.5","@rollup/plugin-typescript":"^8.2.1","@types/jest":"^26.0.23","babel-jest":"^27.0.2","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jest":"^24.3.6","husky":"^6.0.0","jest":"^27.0.4","jest-extended":"^0.11.5","lint-staged":"^11.0.0","prettier":"^2.3.1","rimraf":"^3.0.2","rollup":"^2.52.1","rollup-plugin-terser":"^7.0.2","tslib":"^2.3.0","typescript":"^4.3.4"},"gitHead":"1c4a4e20e9df412fe07832f4036e7b547304ff4b","_id":"@antoniovdlc/defer@0.0.1","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-5yDuskeRKHIDml6Ng0kwcdDR7IYAY5L7++Jg1WVbOCK3qu6ZCq044mp2Z7dagQRk/VnTlw8VU0kl2UHCOrgRxQ==","shasum":"e83df21e40bec3653a752f0d37945bc6ed3716ba","tarball":"https://registry.npmjs.org/@antoniovdlc/defer/-/defer-0.0.1.tgz","fileCount":6,"unpackedSize":7022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgz97QCRA9TVsSAnZWagAAY/MQAIHoDCyZN33cnjQHZWd0\nrHu96SkSPSmMq0ByMWY2JWE4FrfvVGFjhCYfC95DJx9Q8iaWk1gK9EwN3cNW\nOz1gjhWMxWrxDoVFRLAkQ+tKhruVnQATYR3rXjGqTalgbb5MEleCcMtV0JdQ\nBwZOVkj4axxttkhfiG8fb8c9f24mQyX9fTAVReJmhdeJoD6V141RzvbF++mg\nBa4WRepb488+jMdLQnFShhP/I7+S7hqJom/SnHuKGFPSnnmUYwXeQtBJ1V0O\n//QGBKsHnuHVvRo29DymMFgzPiMHPgAf5Eh4Nc2I/U9WgkIsCgP51gzuqxMW\nqoPtlUXvheOJ1qpR8roLnErV3rKgkGCL05GRkznN8yP7+EoxZ700rpeYkQeF\nM8b6PlWBCL1/suM/v6n5AqUYDfcRbIsvSTfeKJ1b5u60kjNXcIHT1Q74ZobZ\nfaLvWyrKlai+h8cCE82ls9HZnaBQv7Th5nxEfXaCzGR9ZU9AUkDFWFUoyzdN\nItNO/zE2YWxiKxWmqR+Tjd3pLf5pOk9LsHcVLhzLwUjcPahUNR5N3FSdubeY\nTcC3G2vams/1FwvCaTG4Rfofu/tAxqTUv8IP5rSBAA7RVZA4lGM5/amR6O9s\n7rcrGaDY12EKbbkrUEZDdwj32q5xgB2OSkGBThIrPppzISl6Jl/LFyfqTFsL\nGt/4\r\n=l3xr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFE9DtWSpUTjyFBGqsY/go6pufBM2oIgVPtJxj1mSdOLAiBkUiuzqaE8Arqhg2u1DP3BQqVI1jBIt42uRpT8HIqjvQ=="}]},"_npmUser":{"name":"antoniovdlc","email":"antonio.villagra.de.la.cruz@gmail.com"},"directories":{},"maintainers":[{"name":"antoniovdlc","email":"antonio.villagra.de.la.cruz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/defer_0.0.1_1624235728176_0.33187022702244806"},"_hasShrinkwrap":false},"0.1.0":{"name":"@antoniovdlc/defer","version":"0.1.0","description":"Go-like defer functions in JavaScript.","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","scripts":{"prepare":"husky install","type:check":"tsc --noEmit","format":"prettier --write --ignore-unknown {src,test}/*","format:check":"prettier --check {src,test}/*","test":"jest","pre-commit":"lint-staged","prebuild":"rimraf dist && mkdir dist","build":"npm run build:types && npm run build:lib","build:types":"tsc --declaration --emitDeclarationOnly --outDir dist","build:lib":"rollup -c","postversion":"git push && git push --tags"},"keywords":["defer","function"],"author":{"name":"Antonio Villagra De La Cruz"},"repository":{"type":"git","url":"git+https://github.com/AntonioVdlC/defer.git"},"bugs":{"url":"https://github.com/AntonioVdlC/defer/issues"},"homepage":"https://github.com/AntonioVdlC/defer#readme","license":"MIT","devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.5","@babel/preset-typescript":"^7.14.5","@rollup/plugin-typescript":"^8.2.1","@types/jest":"^26.0.23","babel-jest":"^27.0.2","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jest":"^24.3.6","husky":"^6.0.0","jest":"^27.0.4","jest-extended":"^0.11.5","lint-staged":"^11.0.0","prettier":"^2.3.1","rimraf":"^3.0.2","rollup":"^2.52.1","rollup-plugin-terser":"^7.0.2","tslib":"^2.3.0","typescript":"^4.3.4"},"gitHead":"2b38b15d41c0a7508981bd528cc2e0dfa6ad6a29","_id":"@antoniovdlc/defer@0.1.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-ejqZwkEB1MbXToGUX7EbjD7kjNxXit/gdGYEbW/n4ffwu5tiVuBYZ4zi4Dx7AihYe4P1bDVJUpcvLRtVGGwdQw==","shasum":"fa82846c81cd7154d31f2f2b87025ebd41731cb4","tarball":"https://registry.npmjs.org/@antoniovdlc/defer/-/defer-0.1.0.tgz","fileCount":6,"unpackedSize":11650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0NXrCRA9TVsSAnZWagAA4bcP/2P6S/L7hghvsLHZaV7a\nyVdRxtzPYxnPPriEbe12UtuTHApqKkJv220vx4gz6j5hx44pwDgxmDQ88W8u\nQFwS1z+9c3CnF4kDgUgLepoGuKY6a5nD5UhIGXsORilU5xdaB/FbOExkqMXc\nIAyYKO9WKO3iC/kRXBYiz1X5bcggehsfeQpm9ofYGr8xMyngiMeop8EEaZZW\nsd7S9HJVQGvu75uHC9VETom61CBsK6PqR7DttRmK3h1E4bvuQ1ySlYxFyvHm\npoFJkchheCS/KvAG5MJAGwzesiGDL6AGLfpLLiaUErjv9fCd4rz+nojrESr/\nSELOkpp1qArWZ7rLAsOfxsM2HcZJOUZ7EieAV+txUORy5QhTQmELyKMoTJhy\nuu+4JBigHpx6tf3FKMoDpXHNqIAcuvh66+z3aWZpKhYC4XcMpSx3+1KRQdBf\n9Qgd0mgu7ACbCXvIaVKehzir+rGAlB6sltDXwN6/XsBs3UCOrqyNGU9anSVz\ndq7xjmR8aKp8+uKN3uJzZ7gf0hW6ARR/AIAAhgqx/bul9xEnhTsefyhyxhMl\n8cm89AADoX0bS36m0+4gQ3PWx/iKw0vpzaqVL4gohEpiJms9Ow/peC6FK7Pa\nWe6NG3b+x0P+GK6/6RQjMScfnEAopj3pbuf8KbCq091x7fBfC66lzVepxKWY\nunyT\r\n=MHrY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNeyG01KfAfAz22ZL6Tcyu+J6vfK/o8DJzhzGKiitfdwIgG/s3AV0YW00VrPQzcIg0ICg8ni0eLKNUNtTYaxXr1wg="}]},"_npmUser":{"name":"antoniovdlc","email":"antonio.villagra.de.la.cruz@gmail.com"},"directories":{},"maintainers":[{"name":"antoniovdlc","email":"antonio.villagra.de.la.cruz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/defer_0.1.0_1624298986895_0.4825643395709722"},"_hasShrinkwrap":false},"0.1.1":{"name":"@antoniovdlc/defer","version":"0.1.1","description":"Go-like defer functions in JavaScript.","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","scripts":{"prepare":"husky install","type:check":"tsc --noEmit","format":"prettier --write --ignore-unknown {src,test}/*","format:check":"prettier --check {src,test}/*","test":"jest","pre-commit":"lint-staged","prebuild":"rimraf dist && mkdir dist","build":"npm run build:types && npm run build:lib","build:types":"tsc --declaration --emitDeclarationOnly --outDir dist","build:lib":"rollup -c","postversion":"git push && git push --tags"},"keywords":["defer","function"],"author":{"name":"Antonio Villagra De La Cruz"},"repository":{"type":"git","url":"git+https://github.com/AntonioVdlC/defer.git"},"bugs":{"url":"https://github.com/AntonioVdlC/defer/issues"},"homepage":"https://github.com/AntonioVdlC/defer#readme","license":"MIT","devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.5","@babel/preset-typescript":"^7.14.5","@rollup/plugin-typescript":"^8.2.1","@types/jest":"^26.0.23","babel-jest":"^27.0.2","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jest":"^24.3.6","husky":"^6.0.0","jest":"^27.0.4","jest-extended":"^0.11.5","lint-staged":"^11.0.0","prettier":"^2.3.1","rimraf":"^3.0.2","rollup":"^2.52.1","rollup-plugin-terser":"^7.0.2","tslib":"^2.3.0","typescript":"^4.3.4"},"gitHead":"a7b54a5209c354baca314ef0258c60bbf7f19d50","_id":"@antoniovdlc/defer@0.1.1","_nodeVersion":"14.17.1","_npmVersion":"6.14.13","dist":{"integrity":"sha512-IAosRcbu5hB6QeJn/saloQT8WyPF1I+DzSYjqRUKy4fAY4JrGbKxIXBgB3EDDDl9uKeSsNQ+w/6FOarxm3PtaA==","shasum":"7a0610f593d996b099d8d89e46e5bbdc74c1bc64","tarball":"https://registry.npmjs.org/@antoniovdlc/defer/-/defer-0.1.1.tgz","fileCount":6,"unpackedSize":11662,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4MuVCRA9TVsSAnZWagAAiykP/3erp10pyw+znIP8VaMa\nGB2czsAQPu4jtrzCzpeB5+MODSrFet6GM/T51IMWDYsUp3hmnm/7W7ZDJCOy\njBRPB+bHI+Ew+t5UBNU4wvJsnqVMU0wC6Y6CWZXEClG4MLGMBvR6AxADxYVG\nq0ZbfHiwBfFtiBTr2A8j5OJZzs79pknNhIx6lxoCslO6sUPqxcH1cxYzZZSn\n31HoUUCw5lzqlU7MDI82AyKteDu5vhQDvH2QvU2UBap9iOXOK/92zQtwPsYs\nuEn5RDlfUZAz07QGgbiKJLnFZYKNeBkjkFKwHQJnTxA+gzZogmYWdrb9/D6T\nM4QkzN8cYnq3ZXxXrb7Dpw3DGU1lefqb0TzsFvrjQed6V3sJyb1hbA1sAVo5\nlfwfEH2YF5EnlJwkE+OmXUx8mbz5vpgbJN1pXKX0uEEnMkOmAUw6z8tUmJtm\n/RkpKncVyI3GDSyuooc/vtkRuFcUJaNDk7WG1UmkeJEaoyP704QgjmpYQYK7\n0MjSPO9IxU7ooTchhEmcno11g5rHV9kNwbL1G7PjbhaN+NLUvjvscnNYg+YW\nAOLd2PzESUB6Ywm5zCeAdFbayMZ3OiiSn1oOcQWnXDYb7pkVg3znASIGJXAn\nWx2MWGNaRSRR7J/yLPoMdsAYRp4yLWnzfgg+Sjfmr65KBGCHP3hmjazkycvS\nV3JA\r\n=RAxv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaYPzSx+SwwafHqIRp5vjFwlfO4tz9i34GEJZc9ZUEbwIhAMHrq9E4D+woQSn+aNXQS8SLzFv/L+U/jbD+NjdwKIPc"}]},"_npmUser":{"name":"antoniovdlc","email":"antonio.villagra.de.la.cruz@gmail.com"},"directories":{},"maintainers":[{"name":"antoniovdlc","email":"antonio.villagra.de.la.cruz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/defer_0.1.1_1625344916449_0.22932758922955876"},"_hasShrinkwrap":false},"0.1.2":{"name":"@antoniovdlc/defer","version":"0.1.2","description":"Go-like defer functions in JavaScript.","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","scripts":{"prepare":"husky install","type:check":"tsc --noEmit","format":"prettier --write --ignore-unknown {src,test}/*","format:check":"prettier --check {src,test}/*","test":"jest","pre-commit":"lint-staged","prebuild":"rimraf dist && mkdir dist","build":"npm run build:types && npm run build:lib","build:types":"tsc --declaration --emitDeclarationOnly --outDir dist","build:lib":"rollup -c","postversion":"git push && git push --tags"},"keywords":["defer","function"],"author":{"name":"Antonio Villagra De La Cruz"},"repository":{"type":"git","url":"git+https://github.com/AntonioVdlC/defer.git"},"bugs":{"url":"https://github.com/AntonioVdlC/defer/issues"},"homepage":"https://github.com/AntonioVdlC/defer#readme","license":"MIT","devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.5","@babel/preset-typescript":"^7.14.5","@rollup/plugin-typescript":"^8.2.1","@types/jest":"^26.0.23","babel-jest":"^27.0.2","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jest":"^24.3.6","husky":"^6.0.0","jest":"^27.0.4","jest-extended":"^0.11.5","lint-staged":"^11.0.0","prettier":"^2.3.1","rimraf":"^3.0.2","rollup":"^2.52.1","rollup-plugin-terser":"^7.0.2","tslib":"^2.3.0","typescript":"^4.3.4"},"gitHead":"d2ee696a6c24e317d0b2a7bb31d396a20e4388b3","_id":"@antoniovdlc/defer@0.1.2","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-hxC97iII0FJOwMniv37Sy9pzVBgoe0uvCw+jTTDqYDyHdrVIkfHR695Rz8MYZkrAThZpBCA4qSORPGt5RCs9Tw==","shasum":"0009bdb145da51ffde7cae672c8a17067e995dfb","tarball":"https://registry.npmjs.org/@antoniovdlc/defer/-/defer-0.1.2.tgz","fileCount":6,"unpackedSize":11890,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg82wLCRA9TVsSAnZWagAAEoUP/A4nW2Sn7Wz5kZ7xn6UA\nprOvc22Yp9TTRrV4nnjUV2GFUitr8yZbcIK0HtY+0yb1a86hINeG1AZbXvIF\nnwpbEj4kkCrECtBx3Su4JhmC9FqEqd2+LS+H+CmwnN2sjipiJbRO4/aZSYof\nJf5ic9ioRz6Gngv/A65ac1PBpYDYZvXhSKqlNcghd3V9KMkDMszSvJfvZ3wG\nZ6s4P3GYOaThlGF5VIk1DerPCt3bpJOZqHdnrqrfeh0fjKJuDA7T8fKwvHOH\nrTr+prCrpLCg676wLqhiOUs7BPUbChBQJbsyZ7m9iOEhdJVZRiN/kJHQ0ZeL\nMthicNxSQX7haHQje8CfMeZyPfcykN8euf8xcZN3DrDRxOw6qk7NCKQZu89G\nGDF1nd0vZQc6rTGZ28R5V4VX1WRMsen7gPIdEM6IgkD8dWL/XlGUdVmUS5dc\nWWivWlD0zeUnaB3TzzZEac8b7dlQsf4QPvQH0JWZaCOIfD7wsVp5FvpyJKI5\ngjchlzH1q0jQr/OourTtE77Y1n3sW4+uhSv4hAH/GnObOJVC9+bmWdgdtWpv\nPSj/nUyrblhfa5Kn1y7Ivc69JchGjTAQz4QBc+5yeTIdJPAMmtOFrhmyNCzK\nDP1BhiFCGMx63lzxe4Kd4iy8g2Am3B4amm/3jLDmmr2s/TX6z75kJ47hcF70\nuurS\r\n=aYmN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICjsLqu4LLx9DTwZr1QU6/dErs82swa12+NIYQvyQoTbAiAwOHOU7u6uYMISJ7vlKLmNx8qw9L0jPrvZ0XvVnuS/vw=="}]},"_npmUser":{"name":"antoniovdlc","email":"antonio.villagra.de.la.cruz@gmail.com"},"directories":{},"maintainers":[{"name":"antoniovdlc","email":"antonio.villagra.de.la.cruz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/defer_0.1.2_1626565643681_0.1534976365107763"},"_hasShrinkwrap":false},"1.0.0":{"name":"@antoniovdlc/defer","version":"1.0.0","description":"Go-like defer functions in JavaScript.","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","scripts":{"prepare":"husky install","type:check":"tsc --noEmit","format":"prettier --write --ignore-unknown {src,test}/*","format:check":"prettier --check {src,test}/*","test":"jest","pre-commit":"lint-staged","prebuild":"rimraf dist && mkdir dist","build":"npm run build:types && npm run build:lib","build:types":"tsc --declaration --emitDeclarationOnly --outDir dist","build:lib":"rollup -c","postversion":"git push && git push --tags"},"keywords":["defer","function"],"author":{"name":"Antonio Villagra De La Cruz"},"repository":{"type":"git","url":"git+https://github.com/AntonioVdlC/defer.git"},"bugs":{"url":"https://github.com/AntonioVdlC/defer/issues"},"homepage":"https://github.com/AntonioVdlC/defer#readme","license":"MIT","devDependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.5","@babel/preset-typescript":"^7.14.5","@rollup/plugin-typescript":"^8.2.1","@types/jest":"^27.0.1","babel-jest":"^27.0.2","eslint":"^8.0.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jest":"^26.1.1","husky":"^7.0.2","jest":"^27.0.4","jest-extended":"^0.11.5","lint-staged":"^12.0.2","prettier":"^2.3.1","rimraf":"^3.0.2","rollup":"^2.52.1","rollup-plugin-terser":"^7.0.2","tslib":"^2.3.0","typescript":"^4.3.4"},"gitHead":"7ba6080f0512e7b7d13d7d5882a2f5ea39ad3dd0","_id":"@antoniovdlc/defer@1.0.0","_nodeVersion":"14.19.0","_npmVersion":"6.14.16","dist":{"integrity":"sha512-qRpdGZutwpVOgOAwpfo48X/HDHlTp94r5z2aDz1F0BipFjYxyRHDT/SJ87rWJWuRFB7xThyVkXi1gFwldrwihA==","shasum":"d3f8314d78a8b30cdd76a172ced3446fa052984d","tarball":"https://registry.npmjs.org/@antoniovdlc/defer/-/defer-1.0.0.tgz","fileCount":6,"unpackedSize":11885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRCEqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYUw//ZTQQ73OOaEjrxvvKgAud1l+e5iC5gCyp7jans1TZKUJ0O83+\r\neG7Z8gEnI65P9OP/2U0yXycFUP+yNeAIAT6RdBiw53CYMMaS81sKtbC6bfJZ\r\n4lAWunTuDEkU24EBWoPXXTTpiavAfAaOPd3kVYJV2OL79AWgHGQso0Hbw+HU\r\nrNnv/cCEu4vvTcLLavI1Krg9m81kBWII6Ns9ENs1yzvnPos+iBI/o+bJiMIe\r\nnwK1TPq/kgFScW3CD/CFWvbTiXZikDkt4ijd86tiZo4zzjfcpGMqSC/3JDXE\r\nCdpYHEShCk4BRQxocgyRPG56H5vae2CKwipVf2vUnHwaF6dAcPU9SGos8J2m\r\n4qTbXGlWTW66YlaxiFnuj77NrIKtGSmvUDxaij3COz05cm8BzXvuoEuBBw0g\r\nDxrwolBdoGHTU0fIC/WQJ9qNxTmHar2fEmxGnL3f4XKCxNVtoNXoN/kNJx4I\r\nfv6tf6atAk8an3sOKGE0kcvIZi3UvGJpM5wcfrIjmjyE1/KtShmaSwdluaCQ\r\n9zr44cneImOVS3vEuWBidgA0Q0OcqJzgzYzJPdFZet41gh8ovidHvSgh1tR9\r\nyfcUVwLkMHdGyISbHu14AAOHJRX5Wmv6PFn4lzNmGzEllfIsi5j81DKmuZZP\r\nLfKu98gn6pz+wE1gFe1Ed92vGhkfdCjqeZE=\r\n=cekw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/+JpqutyBjp8GvSDRxA3fSYmp+WNwBlc0OvTN5zSbqwIhAL68+PV3PLCi4wVubjK8ZVI1sKZDBoobFNt6DH4b2eHE"}]},"_npmUser":{"name":"antoniovdlc","email":"antonio.villagra.de.la.cruz@gmail.com"},"directories":{},"maintainers":[{"name":"antoniovdlc","email":"antonio.villagra.de.la.cruz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/defer_1.0.0_1648632106439_0.32955740973552294"},"_hasShrinkwrap":false},"1.0.1":{"name":"@antoniovdlc/defer","version":"1.0.1","description":"Go-like defer functions in JavaScript.","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","scripts":{"prepare":"husky install","type:check":"tsc src/*.ts --noEmit","format":"prettier --write --ignore-unknown {src,test}/*","format:check":"prettier --check {src,test}/*","test":"vitest run --coverage","pre-commit":"lint-staged","prebuild":"rimraf dist && mkdir dist","build":"npm run build:types && npm run build:lib","build:types":"tsc src/*.ts --declaration --emitDeclarationOnly --outDir dist","build:lib":"rollup -c","postversion":"git push && git push --tags"},"keywords":["defer","function"],"author":{"name":"Antonio Villagra De La Cruz"},"repository":{"type":"git","url":"git+https://github.com/AntonioVdlC/defer.git"},"bugs":{"url":"https://github.com/AntonioVdlC/defer/issues"},"homepage":"https://github.com/AntonioVdlC/defer#readme","license":"MIT","devDependencies":{"@rollup/plugin-typescript":"^8.2.1","c8":"^7.11.0","eslint":"^8.0.0","eslint-config-prettier":"^8.3.0","husky":"^7.0.2","lint-staged":"^12.0.2","prettier":"^2.3.1","rimraf":"^3.0.2","rollup":"^2.52.1","rollup-plugin-terser":"^7.0.2","tslib":"^2.3.0","typescript":"^4.3.4","vite":"^2.9.1","vitest":"^0.9.3"},"gitHead":"0fe34edd9a02e9684c6fc974ef7e781ed380390a","_id":"@antoniovdlc/defer@1.0.1","_nodeVersion":"14.19.1","_npmVersion":"6.14.16","dist":{"integrity":"sha512-TELLPzUvNjRZMSCC/kTNSm+/Oz2Hn4KeRJBydMiNBH7b/wzjLGNvu7I8+GfBK+CxIO7HpvKTKqTSBtLeas5HJw==","shasum":"df4fd413ba9939d32f41d1aa1ba8bd8a614a26c4","tarball":"https://registry.npmjs.org/@antoniovdlc/defer/-/defer-1.0.1.tgz","fileCount":6,"unpackedSize":11727,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6/nZRQqTn4aMDUKXuwCN5gmQRpgBkgxwWyFnAqF+9ggIhAOuJC04JnCt7StstWN9j8oZAh61sqQXGuALkF00i7q0F"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVUFmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqEag/+JtY+3TkMfuRUrcnumOeov517e54H3PSXH1kyJFnAQRh4lGM0\r\nCCYdok4uJQ0VwYwO4Ru/oGQ7q4p+2y1OqtBIeKvuARB2Zya9be6CK5xhDcrz\r\nBtWf79kMMVrf0ROKXOffbSxGeBFGbms55sqLXdXbIZD1IWhZw+76ClW6sN5J\r\n/PazXvZCWbPuRnOBk6PtA6Vf0ldLaNiN4Ke0sgZawAKGQV0RdK8m3vi+y30n\r\nutupdAmtv+kz9xJTQmrsgr9efZCldSlxAiOUxaLDcV1sxqMy0a+Sr4J0PIFB\r\nXsCW8VSomz+4dvMfHr5ARogSVpk7FSUoVERtuHRpvriCkQ4qpFQsJH8RyfEf\r\nBl++mDDQBTnkUybcndlNzd/M0I6rH18KVqpyqk3A3l+4Rp419U9Mn20yIjLH\r\nXNK/SfBpNctGGlv2I8ipuzUawD1V8yvY5pgmXns9sUJnekxdOw38CPe/gIpo\r\nXVT0rWl7LCv4VGA1xMFxFFA+eqax5Qzaej0dhSqeyRNdpy140FeALU8vhuck\r\n7P2CGtMizDI05pKmzYB168RLiue3EgLvRzCGe/TOp4C8oP7IwJ8Zr/BZGWsi\r\n0K/5PdyBOel0wHKiLMlpJmU27G5qqDTbIPrDncR+W9WCU6eCDYS7lFag0Pj7\r\n6Wfz+LxB6Tfd+7+Fi45ifbDQHuTtV7K0jOc=\r\n=WBD5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"antoniovdlc","email":"antonio.villagra.de.la.cruz@gmail.com"},"directories":{},"maintainers":[{"name":"antoniovdlc","email":"antonio.villagra.de.la.cruz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/defer_1.0.1_1649754470633_0.8155723908008967"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-21T00:35:28.114Z","0.0.1":"2021-06-21T00:35:28.317Z","modified":"2022-04-12T09:07:50.847Z","0.1.0":"2021-06-21T18:09:47.034Z","0.1.1":"2021-07-03T20:41:56.828Z","0.1.2":"2021-07-17T23:47:23.844Z","1.0.0":"2022-03-30T09:21:46.608Z","1.0.1":"2022-04-12T09:07:50.766Z"},"maintainers":[{"name":"antoniovdlc","email":"antonio.villagra.de.la.cruz@gmail.com"}],"description":"Go-like defer functions in JavaScript.","homepage":"https://github.com/AntonioVdlC/defer#readme","keywords":["defer","function"],"repository":{"type":"git","url":"git+https://github.com/AntonioVdlC/defer.git"},"author":{"name":"Antonio Villagra De La Cruz"},"bugs":{"url":"https://github.com/AntonioVdlC/defer/issues"},"license":"MIT","readme":"# defer\n\n[![version](https://img.shields.io/npm/v/@antoniovdlc/defer.svg)](http://npm.im/@antoniovdlc/defer)\n[![issues](https://img.shields.io/github/issues-raw/antoniovdlc/defer.svg)](https://github.com/AntonioVdlC/defer/issues)\n[![downloads](https://img.shields.io/npm/dt/@antoniovdlc/defer.svg)](http://npm.im/@antoniovdlc/defer)\n[![license](https://img.shields.io/npm/l/@antoniovdlc/defer.svg)](http://opensource.org/licenses/MIT)\n\nGo-like defer functions in JavaScript.\n\n## Installation\n\nThis package is distributed via npm:\n\n```\nnpm install @antoniovdlc/defer\n```\n\n## Motivation\n\nGo provides the very interesting concept of `defer`ing functions until the end of a function's execution.\n\n```go\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n  defer fmt.Println(\"world\")\n\n  fmt.Println(\"hello\")\n}\n\n// hello \n// world\n```\n\nSuch built-in construct might be very useful in JavaScript for example, where we sometimes need to do some clean-up, and thus could potentially co-locate it with the instanciation.\n\n## Usage\n\nYou can use this library either as an ES module or a CommonJS package:\n```js\nimport { defer, deferrable } from \"@antoniovdlc/defer\";\n```\n*- or -*\n```js\nconst { defer, deferrable } = require(\"@antoniovdlc/defer\");\n```\n\n### defer(fn: Function, caller: Function) : void\n\n`defer` takes a function as argument, which will be called at the end of the execution of the caller function, and a caller function.\n\nFor sync functions, `defer` simply puts the `fn` on the call stack using `setTimeout(fn, 0)`.\nFor async functions, it is a bit more tricky, and we keep track of deferred functions within the `caller` itself, via the property `__$_deferArr`.\n> Using `defer` in async functions requires them to be wrapper with `deferrable` to work properly.\n\n### deferrable(fn: Function) : Function\n\n`defer` works out of the box within sync functions. Unfortunately, for async functions, we need to use a wrapper: `deferrable`.\nThis wrapper returns a function that will compute similarly to its argument, but helps keep track of all the deferred functions within it.\n\n`defer`red functions are run sequentially, and as such, if one function throws an error, the following `defer`red functions won't run.\n\n`defer`red functions in a `deferrable` will not run if the wrapped function throws an error. \n\n\n## Examples\n\nLet's start with a simple translation of the Go code we shared previously:\n```js\nfunction main() {\n  defer(() => console.log(\"world\"), main);\n  console.log(\"hello\");\n}\n\nmain(); // hello world\n```\n\nThere can be as many `defer` calls in a function as you'd like:\n```js\nfunction f() {\n  defer(() => console.log(\"1\"), f);\n  console.log(\"2\");\n  defer(() => console.log(\"3\"), f);\n  console.log(\"4\");\n}\n\nf(); // 2 4 1 3\n```\n\nFor async functions, we need to use `deferrable`:\n```js\nconst f = deferrable(async function fn() {\n  defer(async() => await new Promise(     \n    resolve => resolve(console.log(\"1\"))\n  ), fn);\n    \n  await new Promise(resolve => setTimeout(() => resolve(console.log(\"2\"))));\n    \n  defer(() => console.log(\"3\"), fn);\n  console.log(\"4\");\n});\n\nawait f(); // 2 4 1 3\n```\n\n> `defer`red functions can also be async functions!\n\n## Previous Art\n\nBesides getting inspiration from Go's error handling, this package also draws inspiration from the following packages:\n- [golike-defer](https://www.npmjs.com/package/golike-defer)\n- [with-defer](https://www.npmjs.com/package/with-defer)\n- [@borderless-defer](https://www.npmjs.com/package/@borderless/defer)\n- ... and many more!\n  \n## FAQ\n  \n### Why not use any of the existing packages?\n\nGood you ask! \n\nThere is probably a bit of selfishness in the belief that maybe I can implement this in a better way, but the main reason is to see if I can implement such a library and maybe add some goodies on top.\n\nThis code, even though thoroughly tested with 100% code coverage, has not ran in production yet. As such, either you feel adventurous, or I would invite you to look for more mature libraries providing essentially the same functionalities (I've linked to a few I found myself right above, but there are many more).\n\nAnyway, thanks for stopping by! :)\n\n### Why do I need to pass in a `caller` function to `defer`?\n\nJavaScript engines used to support a `Function.caller` property that would have made it trivial to access the function in which `defer` was being called. Unfortunately, that property (amongst a couple of others) was dropped, hence the only feasible way (at least that I can think of) of getting access to the caller was by adding an extra parameter to `defer` directly.\n\nThis means that `defer` only work in non-anonymous functions.\n \n### Why aren't the `defer`red functions called in last-in-first-out order like in Go?\n\nGood question! \n\nI'd say it comes down to personal preference, as I think it is easier to reason about the order of the `defer`red functions when they execute in the same order they appear in the code.\n\n## License\nMIT","readmeFilename":"README.md"}