{"_id":"erotic","_rev":"300084","name":"erotic","description":"Capture error stacks in asynchronous functions at the point of call.","dist-tags":{"latest":"2.1.1"},"maintainers":[{"name":"zvr","email":""}],"time":{"modified":"2024-01-31T16:06:29.000Z","created":"2017-10-17T11:27:21.090Z","2.1.1":"2019-04-10T23:55:14.369Z","2.1.0":"2019-04-09T22:02:08.733Z","2.0.3":"2019-04-02T12:35:41.675Z","2.0.2":"2019-01-14T15:03:25.917Z","2.0.1":"2018-09-13T03:55:45.780Z","2.0.0":"2018-09-04T02:10:01.032Z","1.2.1":"2018-06-07T03:07:39.255Z","1.2.0":"2018-06-07T02:52:54.339Z","1.1.0":"2018-05-14T20:13:02.094Z","1.0.1":"2018-05-11T23:32:22.500Z","1.0.0":"2018-05-11T23:22:06.418Z","0.2.0":"2017-11-19T23:11:41.951Z","0.1.0":"2017-10-17T11:27:21.090Z"},"users":{},"author":{"name":"Anton","email":"anton@adc.sh"},"repository":{"type":"git","url":"git://github.com/artdecocode/erotic.git"},"versions":{"2.1.1":{"name":"erotic","version":"2.1.1","description":"Capture error stacks in asynchronous functions at the point of call.","main":"build","module":"src/index.js","scripts":{"t":"zoroaster -a","test":"yarn t test/spec","test-build":"ALAMODE_ENV=test-build yarn test","doc":"NODE_DEBUG=doc doc documentary -o README.md","b":"alamode src -o build -i hide.js -s","build":"yarn-s doc b","e":"alanode","example/message.js":"yarn e example/message","example/error.js":"yarn e example/error","example/transparent.js":"yarn e example/transparent","example/read-file.js":"yarn e example/read-file","example/erotic.js":"yarn e example/erotic"},"repository":{"type":"git","url":"git://github.com/artdecocode/erotic.git"},"keywords":["error","stack","throw","preserve","line","column","internal","node","reject","transparent","proxy","hide"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/erotic/issues"},"homepage":"https://github.com/artdecocode/erotic#readme","devDependencies":{"alamode":"^1.9.2","documentary":"^1.23.4","eslint-config-artdeco":"1.0.1","noddy":"1.1.1","yarn-s":"1.1.0","zoroaster":"^3.11.4"},"dependencies":{"@artdeco/clean-stack":"^1.1.1"},"licenseText":"MIT License\n\nCopyright (c) 2019 Art Deco Code Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"erotic@2.1.1","dist":{"shasum":"97f20c2d6e7fd2ec6f7996823009d3ac8ae7157f","size":7150,"noattachment":false,"key":"/erotic/-/erotic-2.1.1.tgz","tarball":"http://name.csiicloud.com:7001/erotic/download/erotic-2.1.1.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmUser":{"name":"zvr","email":"anton@adc.sh"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erotic_2.1.1_1554940514226_0.34031749074183715"},"_hasShrinkwrap":false,"publish_time":1554940514369,"_cnpm_publish_time":1554940514369,"_cnpmcore_publish_time":"2021-12-17T12:01:44.149Z"},"2.1.0":{"name":"erotic","version":"2.1.0","description":"Capture error stacks in asynchronous functions at the point of call.","main":"build","module":"src/index.js","scripts":{"t":"zoroaster -a","test":"yarn t test/spec","test-build":"ALAMODE_ENV=test-build yarn test","doc":"NODE_DEBUG=doc doc documentary -o README.md","b":"alamode src -o build -i hide.js -s","build":"yarn-s doc b","e":"alanode","example/message.js":"yarn e example/message","example/error.js":"yarn e example/error","example/transparent.js":"yarn e example/transparent","example/read-file.js":"yarn e example/read-file","example/erotic.js":"yarn e example/erotic"},"repository":{"type":"git","url":"git://github.com/artdecocode/erotic.git"},"keywords":["error","stack","throw","preserve","line","column","internal","node","reject","transparent","proxy","hide"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/erotic/issues"},"homepage":"https://github.com/artdecocode/erotic#readme","devDependencies":{"alamode":"^1.9.2","documentary":"^1.23.4","eslint-config-artdeco":"1.0.1","noddy":"1.1.1","yarn-s":"1.1.0","zoroaster":"^3.11.4"},"dependencies":{"@artdeco/clean-stack":"^1.1.0"},"licenseText":"MIT License\n\nCopyright (c) 2019 Art Deco Code Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"erotic@2.1.0","dist":{"shasum":"31fc93b42c92a0f2c49f5dd28f8fe8972c25ce59","size":7135,"noattachment":false,"key":"/erotic/-/erotic-2.1.0.tgz","tarball":"http://name.csiicloud.com:7001/erotic/download/erotic-2.1.0.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmUser":{"name":"zvr","email":"anton@adc.sh"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erotic_2.1.0_1554847328594_0.2039182850796213"},"_hasShrinkwrap":false,"publish_time":1554847328733,"_cnpm_publish_time":1554847328733,"_cnpmcore_publish_time":"2021-12-17T12:01:44.354Z"},"2.0.3":{"name":"erotic","version":"2.0.3","description":"Capture error stacks in asynchronous functions at the point of call.","main":"build","module":"src/index.js","scripts":{"t":"zoroaster -a","test":"yarn t test/spec","test-build":"ALAMODE_ENV=test-build yarn test","doc":"NODE_DEBUG=doc doc documentary -o README.md","b":"alamode src -o build -i hide.js -s","build":"yarn-s doc b","e":"alanode","example/message.js":"yarn e example/message","example/error.js":"yarn e example/error","example/transparent.js":"yarn e example/transparent","example/read-file.js":"yarn e example/read-file","example/erotic.js":"yarn e example/erotic"},"repository":{"type":"git","url":"git://github.com/artdecocode/erotic.git"},"keywords":["error","stack","throw","preserve","line","column","internal","node","reject","transparent","proxy","hide"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/erotic/issues"},"homepage":"https://github.com/artdecocode/erotic#readme","devDependencies":{"alamode":"1.9.0","documentary":"1.23.2","eslint-config-artdeco":"1.0.1","noddy":"1.1.1","yarn-s":"1.1.0","zoroaster":"3.11.2"},"dependencies":{"@artdeco/clean-stack":"1.0.1"},"licenseText":"MIT License\n\nCopyright (c) 2019 Art Deco Code Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"erotic@2.0.3","dist":{"shasum":"a4cd02e3448ca416851fbb65f4a5b1da3e135abe","size":7063,"noattachment":false,"key":"/erotic/-/erotic-2.0.3.tgz","tarball":"http://name.csiicloud.com:7001/erotic/download/erotic-2.0.3.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmUser":{"name":"zvr","email":"anton@adc.sh"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erotic_2.0.3_1554208541561_0.16094441818188443"},"_hasShrinkwrap":false,"publish_time":1554208541675,"_cnpm_publish_time":1554208541675,"_cnpmcore_publish_time":"2021-12-17T12:01:44.592Z"},"2.0.2":{"name":"erotic","version":"2.0.2","description":"Capture error stacks in asynchronous functions at the point of call.","main":"build","module":"src/index.js","scripts":{"t":"zoroaster -a","test":"yarn t test/spec","test-build":"ALAMODE_ENV=test-build yarn test","doc":"NODE_DEBUG=doc doc documentary -o README.md","b":"alamode src -o build -i hide.js -s","build":"yarn-s doc b","e":"node example","example/message.js":"yarn e example/message","example/error.js":"yarn e example/error","example/transparent.js":"yarn e example/transparent","example/read-file.js":"yarn e example/read-file","example/erotic.js":"yarn e example/erotic"},"repository":{"type":"git","url":"git://github.com/artdecocode/erotic.git"},"keywords":["error","stack","throw","preserve","line","column","internal","node","reject","transparent","proxy","hide"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/erotic/issues"},"homepage":"https://github.com/artdecocode/erotic#readme","devDependencies":{"alamode":"1.6.1","documentary":"1.20.1","eslint-config-artdeco":"1.0.1","noddy":"1.1.1","yarn-s":"1.1.0","zoroaster":"3.6.6"},"dependencies":{"@artdeco/clean-stack":"1.0.1"},"licenseText":"MIT License\n\nCopyright (c) 2018 Art Deco Code Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"erotic@2.0.2","dist":{"shasum":"22d611ea49bcacdc577abb9fbff3af67cbc5c1e3","size":6957,"noattachment":false,"key":"/erotic/-/erotic-2.0.2.tgz","tarball":"http://name.csiicloud.com:7001/erotic/download/erotic-2.0.2.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmUser":{"name":"zvr","email":"anton@adc.sh"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erotic_2.0.2_1547478205762_0.4647501249731665"},"_hasShrinkwrap":false,"publish_time":1547478205917,"_cnpm_publish_time":1547478205917,"_cnpmcore_publish_time":"2021-12-17T12:01:44.808Z"},"2.0.1":{"name":"erotic","version":"2.0.1","description":"Capture error stacks in asynchronous functions at the point of call.","main":"build","scripts":{"t":"zoroaster -a","test":"yarn t test/spec","test-build":"ALAMODE_ENV=test-build yarn test","doc":"NODE_DEBUG=doc doc documentary -o README.md","b":"alamode src -o build -i hide.js","build":"yarn-s doc b","e":"node example","example/message.js":"yarn e example/message","example/error.js":"yarn e example/error","example/transparent.js":"yarn e example/transparent","example/read-file.js":"yarn e example/read-file","example/erotic.js":"yarn e example/erotic"},"repository":{"type":"git","url":"git://github.com/artdecocode/erotic.git"},"keywords":["error","stack","throw","preserve","line","column","internal","node","reject","transparent","proxy","hide"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/erotic/issues"},"homepage":"https://github.com/artdecocode/erotic#readme","devDependencies":{"alamode":"1.4.0","documentary":"1.15.1","eslint-config-artdeco":"1.0.1","noddy":"1.1.1","yarn-s":"1.1.0","zoroaster":"3.1.0"},"dependencies":{"@artdeco/clean-stack":"1.0.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 Art Deco Code Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"erotic@2.0.1","dist":{"shasum":"bcb45bf61e5a3a9006bbee2cf998515a56f3961b","size":7601,"noattachment":false,"key":"/erotic/-/erotic-2.0.1.tgz","tarball":"http://name.csiicloud.com:7001/erotic/download/erotic-2.0.1.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmUser":{"name":"zvr","email":"anton@adc.sh"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erotic_2.0.1_1536810945629_0.15437050198307167"},"_hasShrinkwrap":false,"publish_time":1536810945780,"_cnpm_publish_time":1536810945780,"_cnpmcore_publish_time":"2021-12-17T12:01:45.119Z"},"2.0.0":{"name":"erotic","version":"2.0.0","description":"Capture error stacks in asynchronous functions at the point of call.","main":"build","scripts":{"t":"zoroaster -a","test":"yarn t test/spec","test-build":"ALAMODE_ENV=test-build yarn test","doc":"NODE_DEBUG=doc doc documentary -o README.md","b":"alamode src -o build","build":"yarn-s doc b","e":"node example","example/message.js":"yarn e example/message","example/error.js":"yarn e example/error","example/transparent.js":"yarn e example/transparent","example/read-file.js":"yarn e example/read-file","example/erotic.js":"yarn e example/erotic"},"repository":{"type":"git","url":"git://github.com/artdecocode/erotic.git"},"keywords":["error","stack","throw","preserve","line","column","internal","node","reject","transparent","proxy","hide"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/erotic/issues"},"homepage":"https://github.com/artdecocode/erotic#readme","devDependencies":{"alamode":"1.4.0","documentary":"1.11.0","eslint-config-artdeco":"1.0.1","noddy":"1.1.1","yarn-s":"1.1.0","zoroaster":"3.0.0"},"dependencies":{"clean-stack":"artdecocode/clean-stack#82625bf"},"licenseText":"MIT License\n\nCopyright (c) 2018 Art Deco Code Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"erotic@2.0.0","dist":{"shasum":"1484efb37a465369cf0e57662d6fb271c3e850fd","size":7469,"noattachment":false,"key":"/erotic/-/erotic-2.0.0.tgz","tarball":"http://name.csiicloud.com:7001/erotic/download/erotic-2.0.0.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmUser":{"name":"zvr","email":"anton@adc.sh"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erotic_2.0.0_1536027000914_0.10491072595554485"},"_hasShrinkwrap":false,"publish_time":1536027001032,"_cnpm_publish_time":1536027001032,"_cnpmcore_publish_time":"2021-12-17T12:01:45.340Z"},"1.2.1":{"name":"erotic","version":"1.2.1","description":"Capture synchronous part of the error stack in asynchronous functions","main":"build","scripts":{"t":"zoroaster -b","test":"zoroaster test/spec -b","test-build":"BABEL_ENV=test-build yarn t test/spec","build-test":"BABEL_ENV=test-build babel test --out-dir test-build","@test-build":"zoroaster test-build/spec","test-es5":"LIB_MAIN=../../es5 zoroaster test/spec -b","test-watch":"zoroaster test/spec -w","test-all":"yarn-s test test-build test-es5","build":"babel src --out-dir build --source-maps","e":"node example/run","example/message.js":"yarn e example/message","example/error.js":"node example/run example/error","example/transparent.js":"node example/run example/transparent","example/read-file.js":"node example/run example/read-file","example/erotic.js":"node example/run example/erotic"},"files":["build","es5"],"repository":{"type":"git","url":"git://github.com/artdecocode/erotic.git"},"keywords":["error","stack"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/erotic/issues"},"homepage":"https://github.com/artdecocode/erotic#readme","devDependencies":{"@babel/cli":"7.0.0-beta.49","@babel/core":"7.0.0-beta.49","@babel/plugin-syntax-object-rest-spread":"7.0.0-beta.49","@babel/plugin-transform-modules-commonjs":"7.0.0-beta.49","@babel/register":"7.0.0-beta.49","babel-plugin-transform-rename-import":"2.2.0","eslint":"4.19.1","eslint-config-artdeco":"1.0.0","noddy":"1.1.1","yarn-s":"1.1.0","zoroaster":"2.1.0"},"dependencies":{"clean-stack":"1.3.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 Art Deco Code Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"erotic@1.2.1","dist":{"shasum":"f5265147573991578808de69af28316aa788f0ae","size":11110,"noattachment":false,"key":"/erotic/-/erotic-1.2.1.tgz","tarball":"http://name.csiicloud.com:7001/erotic/download/erotic-1.2.1.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmUser":{"name":"zvr","email":"anton@adc.sh"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erotic_1.2.1_1528340859132_0.6548944932706882"},"_hasShrinkwrap":false,"publish_time":1528340859255,"_cnpm_publish_time":1528340859255,"_cnpmcore_publish_time":"2021-12-17T12:01:45.640Z"},"1.2.0":{"name":"erotic","version":"1.2.0","description":"Capture synchronous part of the error stack in asynchronous functions","main":"build","scripts":{"t":"zoroaster -b","test":"zoroaster test/spec -b","test-build":"BABEL_ENV=test-build yarn t test/spec","build-test":"BABEL_ENV=test-build babel test --out-dir test-build","@test-build":"zoroaster test-build/spec","test-es5":"LIB_MAIN=../../es5 zoroaster test/spec -b","test-watch":"zoroaster test/spec -w","test-all":"yarn-s test test-build test-es5","build":"babel src --out-dir build --source-maps","e":"node example/run","example/message.js":"yarn e example/message","example/error.js":"node example/run example/error","example/transparent.js":"node example/run example/transparent","example/read-file.js":"node example/run example/read-file","example/erotic.js":"node example/run example/erotic"},"files":["build","es5"],"repository":{"type":"git","url":"git://github.com/artdecocode/erotic.git"},"keywords":["error","stack"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/erotic/issues"},"homepage":"https://github.com/artdecocode/erotic#readme","devDependencies":{"@babel/cli":"7.0.0-beta.49","@babel/core":"7.0.0-beta.49","@babel/plugin-syntax-object-rest-spread":"7.0.0-beta.49","@babel/plugin-transform-modules-commonjs":"7.0.0-beta.49","@babel/register":"7.0.0-beta.49","babel-plugin-transform-rename-import":"2.2.0","eslint":"4.19.1","eslint-config-artdeco":"1.0.0","noddy":"1.1.1","yarn-s":"1.1.0","zoroaster":"2.1.0"},"dependencies":{"clean-stack":"1.3.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 Art Deco Code Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"erotic@1.2.0","dist":{"shasum":"517f7258d1210e9ca768674df9fa7a91906aa144","size":11224,"noattachment":false,"key":"/erotic/-/erotic-1.2.0.tgz","tarball":"http://name.csiicloud.com:7001/erotic/download/erotic-1.2.0.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmUser":{"name":"zvr","email":"anton@adc.sh"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erotic_1.2.0_1528339973608_0.6771293958561746"},"_hasShrinkwrap":false,"publish_time":1528339974339,"_cnpm_publish_time":1528339974339,"_cnpmcore_publish_time":"2021-12-17T12:01:45.878Z"},"1.1.0":{"name":"erotic","version":"1.1.0","description":"Capture synchronous part of the error stack in asynchronous functions","main":"build","scripts":{"t":"zoroaster --babel --watch","test":"zoroaster test/spec --babel","test-build":"LIB_MAIN=../.. zoroaster test/spec --babel","test-es5":"LIB_MAIN=../../es5 zoroaster test/spec --babel","test-watch":"zoroaster test/spec --watch","test-all":"yarn-s test test-build test-es5","build":"babel src --out-dir build","e":"node example/run","example/message.js":"yarn e example/message","example/error.js":"node example/run example/error","example/transparent.js":"node example/run example/transparent","example/read-file.js":"node example/run example/read-file","example/erotic.js":"node example/run example/erotic"},"files":["build","es5"],"repository":{"type":"git","url":"git://github.com/artdecocode/erotic.git"},"keywords":["error","stack"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/erotic/issues"},"homepage":"https://github.com/artdecocode/erotic#readme","devDependencies":{"@babel/cli":"7.0.0-beta.46","@babel/core":"7.0.0-beta.46","@babel/plugin-syntax-object-rest-spread":"7.0.0-beta.46","@babel/plugin-transform-modules-commonjs":"7.0.0-beta.46","@babel/register":"7.0.0-beta.46","noddy":"1.1.1","yarn-s":"1.1.0","zoroaster":"1.1.0"},"dependencies":{"clean-stack":"1.3.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 Art Deco Code Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"erotic@1.1.0","dist":{"shasum":"ccfa6c05e836bae8610ac407dbe191efa9cdbeda","size":9135,"noattachment":false,"key":"/erotic/-/erotic-1.1.0.tgz","tarball":"http://name.csiicloud.com:7001/erotic/download/erotic-1.1.0.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmUser":{"name":"zvr","email":"anton@adc.sh"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erotic_1.1.0_1526328781995_0.9420937977944173"},"_hasShrinkwrap":false,"publish_time":1526328782094,"_cnpm_publish_time":1526328782094,"_cnpmcore_publish_time":"2021-12-17T12:01:46.169Z"},"1.0.1":{"name":"erotic","version":"1.0.1","description":"Capture synchronous part of the error stack in asynchronous functions","main":"build","scripts":{"test":"zoroaster test/spec --babel","test-build":"LIB_MAIN=../../build zoroaster test/spec --babel","test-es5":"zoroaster es5/test/spec","test-watch":"zoroaster test/spec --watch","debug":"ZOROASTER_TIMEOUT=99999 node --inspect=5858 node_modules/.bin/zoroaster test/spec/ --watch","debug-es5":"ZOROASTER_TIMEOUT=99999 node --debug=5858 node_modules/.bin/zoroaster es5/test/spec/ --watch","build-src":"babel src --out-dir es5/src","build-test":"babel test --out-dir es5/test","build":"babel src --out-dir build"},"files":["build","es5/src","es5/index.js"],"repository":{"type":"git","url":"git://github.com/artdecocode/erotic.git"},"keywords":["error","stack"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/erotic/issues"},"homepage":"https://github.com/artdecocode/erotic#readme","devDependencies":{"@babel/cli":"7.0.0-beta.46","@babel/core":"7.0.0-beta.46","@babel/plugin-syntax-object-rest-spread":"7.0.0-beta.46","@babel/plugin-transform-modules-commonjs":"7.0.0-beta.46","@babel/register":"7.0.0-beta.46","noddy":"1.1.1","zoroaster":"1.1.0"},"dependencies":{"clean-stack":"1.3.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 Art Deco Code Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"erotic@1.0.1","dist":{"shasum":"222fedd8215937b9e5d0ec37abb27889af63776f","size":5373,"noattachment":false,"key":"/erotic/-/erotic-1.0.1.tgz","tarball":"http://name.csiicloud.com:7001/erotic/download/erotic-1.0.1.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmUser":{"name":"zvr","email":"anton@sobesednik.media"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erotic_1.0.1_1526081542387_0.30080424259913174"},"_hasShrinkwrap":false,"publish_time":1526081542500,"_cnpm_publish_time":1526081542500,"_cnpmcore_publish_time":"2021-12-17T12:01:46.415Z"},"1.0.0":{"name":"erotic","version":"1.0.0","description":"Capture synchronous part of the error stack in asynchronous functions","main":"build","scripts":{"test":"zoroaster test/spec --babel","test-build":"LIB_MAIN=../../build zoroaster test/spec --babel","test-es5":"zoroaster es5/test/spec","test-watch":"zoroaster test/spec --watch","debug":"ZOROASTER_TIMEOUT=99999 node --inspect=5858 node_modules/.bin/zoroaster test/spec/ --watch","debug-es5":"ZOROASTER_TIMEOUT=99999 node --debug=5858 node_modules/.bin/zoroaster es5/test/spec/ --watch","build-src":"babel src --out-dir es5/src","build-test":"babel test --out-dir es5/test","build":"babel src --out-dir build"},"files":["build","es5/src","es5/index.js"],"repository":{"type":"git","url":"git://github.com/artdecocode/erotic.git"},"keywords":["error","stack"],"author":{"name":"Anton","email":"anton@adc.sh"},"license":"MIT","bugs":{"url":"https://github.com/artdecocode/erotic/issues"},"homepage":"https://github.com/artdecocode/erotic#readme","devDependencies":{"@babel/cli":"7.0.0-beta.46","@babel/core":"7.0.0-beta.46","@babel/plugin-syntax-object-rest-spread":"7.0.0-beta.46","@babel/plugin-transform-modules-commonjs":"7.0.0-beta.46","@babel/register":"7.0.0-beta.46","noddy":"1.1.1","zoroaster":"1.1.0"},"dependencies":{"clean-stack":"1.3.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 Art Deco Code Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"erotic@1.0.0","dist":{"shasum":"ad3878193cc9b573cec455826e35748141ee2b92","size":5325,"noattachment":false,"key":"/erotic/-/erotic-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/erotic/download/erotic-1.0.0.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmUser":{"name":"zvr","email":"anton@sobesednik.media"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erotic_1.0.0_1526080926326_0.17895799230821785"},"_hasShrinkwrap":false,"publish_time":1526080926418,"_cnpm_publish_time":1526080926418,"_cnpmcore_publish_time":"2021-12-17T12:01:46.591Z"},"0.2.0":{"name":"erotic","version":"0.2.0","description":"Capture synchronous part of the error stack in asynchronous functions","main":"src/index.js","scripts":{"test":"zoroaster test/spec","test-es5":"zoroaster es5/test/spec","test-watch":"zoroaster test/spec --watch","debug":"ZOROASTER_TIMEOUT=99999 node --inspect=5858 node_modules/.bin/zoroaster test/spec/ --watch","debug-es5":"ZOROASTER_TIMEOUT=99999 node --debug=5858 node_modules/.bin/zoroaster es5/test/spec/ --watch","build-src":"babel src --out-dir es5/src","build-test":"babel test --out-dir es5/test","build":"run-s build-src build-test"},"files":["src","es5/src"],"repository":{"type":"git","url":"git://github.com/Sobesednik/erotic.git"},"keywords":["error","stack"],"author":{"name":"Anton","email":"anton@sobesednik.media"},"license":"MIT","bugs":{"url":"https://github.com/Sobesednik/erotic/issues"},"homepage":"https://github.com/Sobesednik/erotic#readme","devDependencies":{"babel-cli":"6.26.0","babel-preset-env":"1.6.1","fast-async":"6.3.0","npm-run-all":"4.1.2","zoroaster":"0.4.6"},"dependencies":{"clean-stack":"1.3.0"},"gitHead":"910b994a3ba3d1d9489d40a539cdf99e40877be9","_id":"erotic@0.2.0","_npmVersion":"5.5.1","_nodeVersion":"8.8.1","_npmUser":{"name":"zvr","email":"anton@sobesednik.media"},"dist":{"shasum":"4162384016281b1dd313bf1ecc87576f92d8e509","size":4651,"noattachment":false,"key":"/erotic/-/erotic-0.2.0.tgz","tarball":"http://name.csiicloud.com:7001/erotic/download/erotic-0.2.0.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erotic-0.2.0.tgz_1511133101075_0.9858192759566009"},"directories":{},"publish_time":1511133101951,"_hasShrinkwrap":false,"_cnpm_publish_time":1511133101951,"_cnpmcore_publish_time":"2021-12-17T12:01:46.863Z"},"0.1.0":{"name":"erotic","version":"0.1.0","description":"A new package created with mnp","main":"src/index.js","scripts":{"test":"zoroaster test/spec","test-watch":"zoroaster test/spec --watch"},"repository":{"type":"git","url":"git://github.com/Sobesednik/erotic.git"},"keywords":["mnp"],"author":{"name":"Anton","email":"anton@sobesednik.media"},"license":"MIT","bugs":{"url":"https://github.com/Sobesednik/erotic/issues"},"homepage":"https://github.com/Sobesednik/erotic#readme","devDependencies":{"zoroaster":"0.4.6"},"dependencies":{"clean-stack":"1.3.0"},"gitHead":"cc2853034630b0798ce714c7a29bb3cffc797156","_id":"erotic@0.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"zvr","email":"anton@sobesednik.media"},"dist":{"shasum":"af0a41ffdedbbf4aec7712e23790d14b7606a7e9","size":3136,"noattachment":false,"key":"/erotic/-/erotic-0.1.0.tgz","tarball":"http://name.csiicloud.com:7001/erotic/download/erotic-0.1.0.tgz"},"maintainers":[{"name":"zvr","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/erotic-0.1.0.tgz_1508239640186_0.9453258912544698"},"directories":{},"publish_time":1508239641090,"_hasShrinkwrap":false,"_cnpm_publish_time":1508239641090,"_cnpmcore_publish_time":"2021-12-17T12:01:47.079Z"}},"readme":"<a href=\"https://artdeco.bz/erotic\"><img align=\"right\" src=\"./logo.jpg\" width=\"225\" alt=\"Erotic\" />\n\n# erotic</a>\n\n[![npm version](https://badge.fury.io/js/erotic.svg)](https://npmjs.org/package/erotic)\n\n`erotic` is a Node.js package to capture asynchronous errors as if they occurred synchronously. It aims at keeping the error stack readable and developer-friendly. Furthermore, it can make errors appear as if they happened outside of the function at the point of call.\n\n```\nyarn add -E erotic\n```\n\n## Table of Contents\n\n- [Table of Contents](#table-of-contents)\n- [Quick Examples](#quick-examples)\n  * [Node.js: Reading A File](#nodejs-reading-a-file)\n  * [`erotic`: Standard Mode](#erotic-standard-mode)\n  * [`erotic`: Transparent Mode](#erotic-transparent-mode)\n- [API](#api)\n  * [`erotic(transparent?: boolean): Callback`](#erotictransparent-boolean-callback)\n  * [`Callback(messageOrError: string|Error): Error`](#callbackmessageorerror-stringerror-error)\n    * [Strict Mode](#strict-mode)\n  * [Transparent Mode](#transparent-mode)\n    * [Use Case: Assertion Library](#use-case-assertion-library)\n- [Copyright](#copyright)\n\n## Quick Examples\n\nThe following examples show the benefits of using `erotic`.\n\n### Node.js: Reading A File\n\nWhen reading a file with Node's `readFile` method from the `fs` package, the function will be rejected without any error stack, which can make tracing errors harder in the application.\n\n```js\nimport { readFile } from 'fs'\n\nconst read = async (path) => {\n  await new Promise((resolve, reject) => {\n    readFile(path, (err, data) => {\n      if (err) return reject(err)\n      return resolve(data)\n    })\n  })\n}\n\n(async () => {\n  const path = 'non-existent-file.txt'\n  try {\n    await read(path)\n  } catch ({ stack }) {\n    console.log(stack)\n  }\n})()\n```\n\n```\nError: ENOENT: no such file or directory, open 'non-existent-file.txt'\n```\n\n### `erotic`: Standard Mode\n\n`erotic` solves the problem described in the _Node.js_ example above by remembering the error stack at the point of where the function was called.\n\n```js\nimport { readFile } from 'fs'\nimport erotic from 'erotic'\n\nconst read = async (path) => {\n  const er = erotic() // stack has the anchor point\n\n  await new Promise((resolve, reject) => {\n    readFile(path, (err, data) => {\n      if (err) {\n        const e = er(err) // stack also includes this line\n        return reject(e)\n      }\n      return resolve(data)\n    })\n  })\n}\n\n(async function example() {\n  const path = 'non-existent-file.txt'\n  try {\n    await read(path)\n  } catch ({ stack }) {\n    console.log(stack)\n  }\n})()\n```\n\n```\nError: ENOENT: no such file or directory, open 'non-existent-file.txt'\n    at ReadFileContext.readFile [as callback] (/Users/zavr/adc/erotic/example/read-file.js:10:19)\n    at read (/Users/zavr/adc/erotic/example/read-file.js:5:14)\n    at example (/Users/zavr/adc/erotic/example/read-file.js:21:11)\n    at Object.<anonymous> (/Users/zavr/adc/erotic/example/read-file.js:25:3)\n```\n\n### `erotic`: Transparent Mode\n\nA transparent mode can be used when it's needed to completely proxy the call to a function, and hide all underlying error stack, making the error appear to happen at the point where the throwing function was called.\n\n```js\nimport { readFile } from 'fs'\nimport erotic from 'erotic'\n\nconst read = async (path) => {\n  const er = erotic(true)\n\n  await new Promise((resolve, reject) => {\n    readFile(path, (err, data) => {\n      if (err) {\n        const e = er(err)\n        return reject(e)\n      }\n      return resolve(data)\n    })\n  })\n}\n\n(async function example() {\n  const path = 'non-existent-file.txt'\n  try {\n    await read(path) // error appears to be thrown here\n  } catch ({ stack }) {\n    console.log(stack)\n  }\n})()\n```\n\n```\nError: ENOENT: no such file or directory, open 'non-existent-file.txt'\n    at example (/Users/zavr/adc/erotic/example/transparent.js:21:11)\n    at Object.<anonymous> (/Users/zavr/adc/erotic/example/transparent.js:25:3)\n```\n\n## API\n\nThe package exports the default `erotic` function.\n\n```js\nimport erotic from 'erotic'\n```\n\n<p align=\"center\"><a href=\"#table-of-contents\"><img src=\".documentary/section-breaks/0.svg?sanitize=true\" width=\"25\"></a></p>\n\n### `erotic(`<br/>&nbsp;&nbsp;`transparent?: boolean,`<br/>`): Callback`\n\nCreates a callback which should be used before throwing any errors to make their stack appear at the point of creation of the callback. The `transparent` option can be used to hide this line also and make the function's errors' stacks start at the caller's line.\n\nWhen creating a library which runs some asynchronous code, the callback should be created when entering the function's body, and called at some point in future to update an error's stack before throwing.\n\n### `Callback(`<br/>&nbsp;&nbsp;`messageOrError: string|Error,`<br/>`): Error`\n\nReturns an error with the remembered stack to be thrown. In the example below, a function is created which can throw at some point in future, but its stack trace will begin inside the call to it and not at Node's `setTimeout` internals.\n\nWhen the callback is called with an error, the error's stack is overridden with a new stack, but all other properties are preserved, and the error is strictly equal to the one passed.\n\n```js\nimport erotic from 'erotic'\n\nasync function wait() {\n  const cb = erotic()\n  await new Promise((_, reject) => {\n    setTimeout(() => {\n      const err = new Error('Promise timeout error.')\n      err.code = 'ETIMEOUT'\n      const error = cb(err)\n      reject(error)\n    }, 10)\n  })\n}\n\n(async function example() {\n  try {\n    await wait()\n  } catch ({ stack, code }) {\n    console.log(stack)\n    console.log(code)\n  }\n})()\n```\n\n```\nError: Promise timeout error.\n    at Timeout.setTimeout [as _onTimeout] (/Users/zavr/adc/erotic/example/set-timeout.js:9:21)\n    at wait (/Users/zavr/adc/erotic/example/set-timeout.js:4:14)\n    at example (/Users/zavr/adc/erotic/example/set-timeout.js:17:11)\n    at Object.<anonymous> (/Users/zavr/adc/erotic/example/set-timeout.js:22:3)\nETIMEOUT\n```\n\nWhen a string is passed, an error object is created with the message internally.\n\n```js\nimport erotic from 'erotic'\n\nasync function wait() {\n  const cb = erotic()\n  await new Promise((_, reject) => {\n    setTimeout(() => {\n      const error = cb('Promise timeout error.')\n      reject(error)\n    }, 10)\n  })\n}\n\n(async function example() {\n  try {\n    await wait()\n  } catch ({ stack }) {\n    console.log(stack)\n  }\n})()\n```\n\n```\nError: Promise timeout error.\n    at Timeout.setTimeout [as _onTimeout] (/Users/zavr/adc/erotic/example/set-timeout-string.js:7:21)\n    at wait (/Users/zavr/adc/erotic/example/set-timeout-string.js:4:14)\n    at example (/Users/zavr/adc/erotic/example/set-timeout-string.js:15:11)\n    at Object.<anonymous> (/Users/zavr/adc/erotic/example/set-timeout-string.js:19:3)\n```\n\n#### Strict Mode\n\nThe `erotic` also works fine even in the `strict` mode.\n\n```js\n'use strict'\n\nimport erotic from 'erotic'\n\nconst wait = async () => {\n  const cb = erotic()\n  await new Promise((_, reject) => {\n    setTimeout(() => {\n      const err = new Error('Promise timeout error.')\n      const error = cb(err)\n      reject(error)\n    }, 10)\n  })\n}\n\n(async function example() {\n  try {\n    await wait()\n  } catch ({ stack }) {\n    console.log(stack)\n  }\n})()\n```\n\n```\nError: Promise timeout error.\n    at Timeout.setTimeout [as _onTimeout] (/Users/zavr/adc/erotic/example/set-timeout-strict.js:10:21)\n    at wait (/Users/zavr/adc/erotic/example/set-timeout-strict.js:6:14)\n    at example (/Users/zavr/adc/erotic/example/set-timeout-strict.js:18:11)\n    at Object.<anonymous> (/Users/zavr/adc/erotic/example/set-timeout-strict.js:22:3)\n```\n\n### Transparent Mode\n\nIn the transparent mode, the stack will start where the function was called and not show any of its internals.\n\n```js\nimport erotic from 'erotic'\n\nasync function wait() {\n  const cb = erotic(true)\n  await new Promise((_, reject) => {\n    setTimeout(() => {\n      const error = cb('Promise timeout error.')\n      reject(error)\n    }, 10)\n  })\n}\n\n(async function example() {\n  try {\n    await wait()\n  } catch ({ stack }) {\n    console.log(stack)\n  }\n})()\n```\n\n```\nError: Promise timeout error.\n    at example (/Users/zavr/adc/erotic/example/set-timeout-transparent.js:15:11)\n    at Object.<anonymous> (/Users/zavr/adc/erotic/example/set-timeout-transparent.js:19:3)\n```\n\n#### Use Case: Assertion Library\n\nFor example, when implementing an assertion library, uses will not want to see the details about how the error was created internally. They will only want to know that an error happened at a particular line in their test.\nThere will also be an internal _Node.js_ error stack, such as lines with `Module._compile` which are not useful.\n\nWithout `erotic`, the full error stack will be exposed:\n\n```js\nconst assertEqual = (actual, expected) => {\n  if (actual != expected) {\n    throw new Error(`${actual} != ${expected}`)\n  }\n}\n\n(function test() {\n  try {\n    assertEqual('hello', 'world')\n  } catch ({ stack }) {\n    console.log(stack)\n  }\n})()\n```\n\n```\nError: hello != world\n    at assertEqual (/Users/zavr/adc/erotic/example/assert-node.js:3:11)\n    at test (/Users/zavr/adc/erotic/example/assert-node.js:9:5)\n    at Object.<anonymous> (/Users/zavr/adc/erotic/example/assert-node.js:13:3)\n    at Module._compile (module.js:653:30)\n    at Module._compile (/Users/zavr/adc/erotic/node_modules/pirates/lib/index.js:99:24)\n    at Module._extensions..js (module.js:664:10)\n    at Object.newLoader [as .js] (/Users/zavr/adc/erotic/node_modules/pirates/lib/index.js:104:7)\n    at Module.load (module.js:566:32)\n    at tryModuleLoad (module.js:506:12)\n    at Function.Module._load (module.js:498:3)\n```\n\nWhereas when using `erotic` to create a transparent error stack, the will be no indication of what happens inside the function, which can make things clearer.\n\n```js\nimport erotic from 'erotic'\n\nconst assertEqual = (actual, expected) => {\n  const e = erotic(true)\n  if (actual != expected) {\n    const er = e(`${actual} != ${expected}`)\n    throw er\n  }\n}\n\n(function test() {\n  try {\n    assertEqual('hello', 'world')\n  } catch ({ stack }) {\n    console.log(stack)\n  }\n})()\n```\n\n```\nError: hello != world\n    at test (/Users/zavr/adc/erotic/example/assert.js:13:5)\n    at Object.<anonymous> (/Users/zavr/adc/erotic/example/assert.js:17:3)\n```\n\n\n\n## Copyright\n\nLogo: [Thornton’s Temple of Flora][2]\n\n(c) [Art Deco][1] 2019\n\n[1]: https://artd.eco\n[2]: https://publicdomainreview.org/2015/03/11/sex-and-science-in-robert-thorntons-temple-of-flora/\n","_attachments":{},"homepage":"https://github.com/artdecocode/erotic#readme","bugs":{"url":"https://github.com/artdecocode/erotic/issues"},"license":"MIT"}