{"_id":"serialize-error","_rev":"4252301","name":"serialize-error","description":"Serialize/deserialize an error into a plain object","dist-tags":{"latest":"13.0.1"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2026-03-31T23:56:35.000Z","created":"2015-10-27T15:37:48.260Z","13.0.1":"2026-01-18T13:13:39.476Z","13.0.0":"2026-01-16T14:47:08.883Z","12.0.0":"2025-01-05T00:36:44.511Z","11.0.3":"2023-11-10T07:16:35.490Z","11.0.2":"2023-08-25T14:47:53.318Z","11.0.1":"2023-08-02T11:35:48.887Z","11.0.0":"2022-05-13T08:17:54.396Z","10.0.0":"2022-04-18T12:03:35.066Z","9.1.1":"2022-03-21T18:18:52.671Z","9.1.0":"2022-02-14T11:11:21.681Z","9.0.0":"2021-11-17T06:37:03.056Z","8.1.0":"2021-04-19T09:45:35.529Z","8.0.1":"2021-01-24T10:14:36.795Z","8.0.0":"2021-01-08T17:23:10.532Z","7.0.1":"2020-05-12T10:35:54.378Z","7.0.0":"2020-05-10T07:04:28.802Z","6.0.0":"2020-03-11T15:37:03.595Z","5.0.0":"2019-09-23T07:35:25.474Z","4.1.0":"2019-04-02T02:32:34.529Z","4.0.0":"2019-03-18T17:08:08.378Z","3.0.0":"2018-10-09T08:28:19.816Z","2.1.0":"2016-11-22T03:55:04.837Z","2.0.0":"2016-03-26T07:38:56.638Z","1.1.0":"2015-11-24T08:43:45.273Z","1.0.0":"2015-10-27T15:37:48.260Z"},"users":{"tracker1":true,"abuelwafa":true,"grantcarthew":true,"nicknaso":true,"hbarcelos":true,"luckyluke":true,"johnloy":true,"zhenguo.zhao":true,"fouad.nashat":true,"j3kz":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"versions":{"13.0.1":{"name":"serialize-error","version":"13.0.1","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","cause","deserialize"],"dependencies":{"non-error":"^0.1.0","type-fest":"^5.4.1"},"devDependencies":{"ava":"^6.4.1","expect-type":"^1.3.0","tsd":"^0.33.0","xo":"^1.2.3"},"gitHead":"99459b28a64c50d885a037cf0dee8fab8a79afa6","types":"./index.d.ts","_id":"serialize-error@13.0.1","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_nodeVersion":"24.12.0","_npmVersion":"11.6.1","dist":{"shasum":"dd1e1bf6d3e3d01037d126bd95e919f48b0c8ec0","size":5814,"noattachment":false,"key":"/serialize-error/-/serialize-error-13.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-13.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/serialize-error_13.0.1_1768742019342_0.7746438049405093"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-18T13:13:39.476Z","publish_time":1768742019476,"_source_registry_name":"default","_cnpm_publish_time":1768742019476},"13.0.0":{"name":"serialize-error","version":"13.0.0","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","cause","deserialize"],"dependencies":{"non-error":"^0.1.0","type-fest":"^5.4.1"},"devDependencies":{"ava":"^6.4.1","expect-type":"^1.3.0","tsd":"^0.33.0","xo":"^1.2.3"},"gitHead":"a0bf4cd0b821f74b7ffc4fd540c716245b753516","types":"./index.d.ts","_id":"serialize-error@13.0.0","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_nodeVersion":"24.12.0","_npmVersion":"11.6.1","dist":{"shasum":"02872b5853b8e7620b3362f5129e1c82413a0498","size":5744,"noattachment":false,"key":"/serialize-error/-/serialize-error-13.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-13.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/serialize-error_13.0.0_1768574828725_0.2978664011826464"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-16T14:47:08.883Z","publish_time":1768574828883,"_source_registry_name":"default","_cnpm_publish_time":1768574828883},"12.0.0":{"name":"serialize-error","version":"12.0.0","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","cause","deserialize"],"dependencies":{"type-fest":"^4.31.0"},"devDependencies":{"ava":"^6.2.0","expect-type":"^1.1.0","tsd":"^0.31.2","xo":"^0.60.0"},"_id":"serialize-error@12.0.0","gitHead":"4d0f3b27d618739c3a3868fd5b4d619b4ea03ad8","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_nodeVersion":"23.3.0","_npmVersion":"10.9.0","dist":{"shasum":"aed3d5abff192c855707513929bf8bf48d712194","size":5409,"noattachment":false,"key":"/serialize-error/-/serialize-error-12.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-12.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/serialize-error_12.0.0_1736037404339_0.5250995479800422"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-01-05T00:36:44.511Z","publish_time":1736037404511,"_source_registry_name":"default","_cnpm_publish_time":1736037404511},"11.0.3":{"name":"serialize-error","version":"11.0.3","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","sideEffects":false,"engines":{"node":">=14.16"},"scripts":{"//test":"xo && ava && tsd","test":"ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","cause","deserialize"],"dependencies":{"type-fest":"^2.12.2"},"devDependencies":{"ava":"^4.2.0","tsd":"^0.20.0","xo":"^0.48.0"},"types":"./index.d.ts","gitHead":"29b0fcb5d1a00b173a6702235bca148434baf726","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@11.0.3","_nodeVersion":"18.18.2","_npmVersion":"9.2.0","dist":{"shasum":"b54f439e15da5b4961340fbbd376b6b04aa52e92","size":5201,"noattachment":false,"key":"/serialize-error/-/serialize-error-11.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-11.0.3.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_11.0.3_1699600595331_0.6362785298100004"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-10T07:16:35.490Z","publish_time":1699600595490,"_source_registry_name":"default","_cnpm_publish_time":1699600595490},"11.0.2":{"name":"serialize-error","version":"11.0.2","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=14.16"},"scripts":{"//test":"xo && ava && tsd","test":"ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","cause","deserialize"],"dependencies":{"type-fest":"^2.12.2"},"devDependencies":{"ava":"^4.2.0","tsd":"^0.20.0","xo":"^0.48.0"},"types":"./index.d.ts","gitHead":"d9074a63ac6b57595b287fd52198d4afb88a696b","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@11.0.2","_nodeVersion":"16.20.0","_npmVersion":"9.2.0","dist":{"shasum":"8c1a44f0ab872ee2c3ca6736ca5c750003bc1d04","size":5195,"noattachment":false,"key":"/serialize-error/-/serialize-error-11.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-11.0.2.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_11.0.2_1692974873113_0.4771004613771299"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-08-25T14:47:53.318Z","publish_time":1692974873318,"_source_registry_name":"default","_cnpm_publish_time":1692974873318},"11.0.1":{"name":"serialize-error","version":"11.0.1","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=14.16"},"scripts":{"//test":"xo && ava && tsd","test":"ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","cause","deserialize"],"dependencies":{"type-fest":"^2.12.2"},"devDependencies":{"ava":"^4.2.0","tsd":"^0.20.0","xo":"^0.48.0"},"types":"./index.d.ts","gitHead":"786f5ebadc14db60bcebf59856d68af33521039c","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@11.0.1","_nodeVersion":"16.20.0","_npmVersion":"9.2.0","dist":{"shasum":"7cfa2b54f7aca3e4cbfc0137259d94d93793f813","size":5113,"noattachment":false,"key":"/serialize-error/-/serialize-error-11.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-11.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_11.0.1_1690976148727_0.26176944014687575"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-08-02T11:35:48.887Z","publish_time":1690976148887,"_source_registry_name":"default","_cnpm_publish_time":1690976148887},"11.0.0":{"name":"serialize-error","version":"11.0.0","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","cause","deserialize"],"dependencies":{"type-fest":"^2.12.2"},"devDependencies":{"ava":"^4.2.0","tsd":"^0.20.0","xo":"^0.48.0"},"types":"./index.d.ts","gitHead":"2a77169cae632802b75c9962b8ae9a482c978ae2","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@11.0.0","_nodeVersion":"14.19.2","_npmVersion":"8.3.2","dist":{"shasum":"0129f2b07b19b09bc7a5f2d850ffe9cd2d561582","size":5122,"noattachment":false,"key":"/serialize-error/-/serialize-error-11.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-11.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_11.0.0_1652429874210_0.8864894173113884"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-05-13T10:14:54.430Z","publish_time":1652429874396,"_cnpm_publish_time":1652429874396},"10.0.0":{"name":"serialize-error","version":"10.0.0","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","cause","deserialize"],"dependencies":{"type-fest":"^2.12.2"},"devDependencies":{"ava":"^4.2.0","tsd":"^0.20.0","xo":"^0.48.0"},"types":"./index.d.ts","gitHead":"6f6102fc0690922a7aa14537b52908e983c27b81","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@10.0.0","_nodeVersion":"14.19.0","_npmVersion":"8.3.2","dist":{"shasum":"3d1407e98b73b14dd0e249f887c28abcda69d10f","size":5016,"noattachment":false,"key":"/serialize-error/-/serialize-error-10.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-10.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_10.0.0_1650283414911_0.5071582871785032"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-18T12:03:39.674Z","publish_time":1650283415066,"_cnpm_publish_time":1650283415066},"9.1.1":{"name":"serialize-error","version":"9.1.1","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","deserialize"],"dependencies":{"type-fest":"^2.5.3"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.18.0","xo":"^0.46.4"},"types":"./index.d.ts","gitHead":"855fe3dc67e0376070007d72ac5cf88bafdb7d36","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@9.1.1","_nodeVersion":"16.14.0","_npmVersion":"8.3.2","dist":{"shasum":"b66744b6287b538996a153103e67af7179d0831a","size":3492,"noattachment":false,"key":"/serialize-error/-/serialize-error-9.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-9.1.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_9.1.1_1647886732489_0.8493539125497251"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-03-21T18:19:13.472Z","publish_time":1647886732671,"_cnpm_publish_time":1647886732671},"9.1.0":{"name":"serialize-error","version":"9.1.0","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","deserialize"],"dependencies":{"type-fest":"^2.5.3"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.18.0","xo":"^0.46.4"},"types":"./index.d.ts","gitHead":"60ed5cb4b1684c3b21432aec669a9b43035fccd6","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@9.1.0","_nodeVersion":"14.19.0","_npmVersion":"8.3.2","dist":{"shasum":"cb3ebd0af124b3055c38be758da036914f967662","size":3526,"noattachment":false,"key":"/serialize-error/-/serialize-error-9.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-9.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_9.1.0_1644837081521_0.11878367714949145"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-02-14T11:14:26.165Z","publish_time":1644837081681,"_cnpm_publish_time":1644837081681},"9.0.0":{"name":"serialize-error","version":"9.0.0","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","deserialize"],"dependencies":{"type-fest":"^2.5.3"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.18.0","xo":"^0.46.4"},"types":"./index.d.ts","gitHead":"627c510fbde85d03cc0ac7d5d0ff6cb879ddb28f","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@9.0.0","_nodeVersion":"12.22.1","_npmVersion":"8.1.0","dist":{"shasum":"9b8a83dcbb2a61fa50d016b155f1b2884587825e","size":3460,"noattachment":false,"key":"/serialize-error/-/serialize-error-9.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-9.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_9.0.0_1637131022909_0.9317558295019588"},"_hasShrinkwrap":false,"publish_time":1637131023056,"_cnpm_publish_time":1637131023056},"8.1.0":{"name":"serialize-error","version":"8.1.0","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","deserialize"],"dependencies":{"type-fest":"^0.20.2"},"devDependencies":{"ava":"^2.4.0","tsd":"^0.14.0","xo":"^0.37.1"},"gitHead":"5a318e5e2335be394e5b3372e1ba6fd2832f390e","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@8.1.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"3a069970c712f78634942ddd50fbbc0eaebe2f67","size":3479,"noattachment":false,"key":"/serialize-error/-/serialize-error-8.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-8.1.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_8.1.0_1618825535408_0.9610267683995828"},"_hasShrinkwrap":false,"publish_time":1618825535529,"_cnpm_publish_time":1618825535529},"8.0.1":{"name":"serialize-error","version":"8.0.1","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","deserialize"],"dependencies":{"type-fest":"^0.20.2"},"devDependencies":{"ava":"^2.4.0","tsd":"^0.14.0","xo":"^0.37.1"},"gitHead":"71bb11795d352dd3f0abe8048b7e9cb42b50b7ca","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@8.0.1","_nodeVersion":"14.15.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"7a67f8ecbbf28973b5a954a2852ff9f4eef52d99","size":3178,"noattachment":false,"key":"/serialize-error/-/serialize-error-8.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-8.0.1.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_8.0.1_1611483276603_0.02530465761076739"},"_hasShrinkwrap":false,"publish_time":1611483276795,"_cnpm_publish_time":1611483276795},"8.0.0":{"name":"serialize-error","version":"8.0.0","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","deserialize"],"dependencies":{"type-fest":"^0.20.2"},"devDependencies":{"ava":"^2.4.0","tsd":"^0.14.0","xo":"^0.37.1"},"gitHead":"ae264b0a21ef29b7428697581ed451a9d84403a2","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@8.0.0","_nodeVersion":"15.5.0","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"2b3ea8a25bbd4375d54a9080ccc3d6d6262e34c0","size":3178,"noattachment":false,"key":"/serialize-error/-/serialize-error-8.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-8.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_8.0.0_1610126590366_0.03735921852273694"},"_hasShrinkwrap":false,"publish_time":1610126590532,"_cnpm_publish_time":1610126590532},"7.0.1":{"name":"serialize-error","version":"7.0.1","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","deserialize"],"dependencies":{"type-fest":"^0.13.1"},"devDependencies":{"ava":"^2.4.0","tsd":"^0.11.0","xo":"^0.30.0"},"gitHead":"9592a668a011cde29a2f60e39f54c6a4eed6f1db","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@7.0.1","_nodeVersion":"10.20.1","_npmVersion":"6.14.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"f1360b0447f61ffb483ec4157c737fab7d778e18","size":2756,"noattachment":false,"key":"/serialize-error/-/serialize-error-7.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-7.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_7.0.1_1589279754268_0.5675282433967743"},"_hasShrinkwrap":false,"publish_time":1589279754378,"_cnpm_publish_time":1589279754378},"7.0.0":{"name":"serialize-error","version":"7.0.0","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","deserialize"],"dependencies":{"type-fest":"^0.13.1"},"devDependencies":{"ava":"^2.4.0","tsd":"^0.11.0","xo":"^0.30.0"},"gitHead":"7072820d53464f13b17c0d2f35426ec2481237ac","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@7.0.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"10a00c5ad7806d7b84619a5599ea443bdf1bb0d8","size":2716,"noattachment":false,"key":"/serialize-error/-/serialize-error-7.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-7.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_7.0.0_1589094268694_0.4737311091370897"},"_hasShrinkwrap":false,"publish_time":1589094268802,"_cnpm_publish_time":1589094268802},"6.0.0":{"name":"serialize-error","version":"6.0.0","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","deserialize"],"dependencies":{"type-fest":"^0.12.0"},"devDependencies":{"ava":"^2.4.0","tsd":"^0.11.0","xo":"^0.24.0"},"gitHead":"cf7b57c176cab158788cd201aed8a818f2838cb4","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@6.0.0","_nodeVersion":"10.18.1","_npmVersion":"6.14.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"ccfb887a1dd1c48d6d52d7863b92544331fd752b","size":2572,"noattachment":false,"key":"/serialize-error/-/serialize-error-6.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-6.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_6.0.0_1583941023448_0.8522028763466707"},"_hasShrinkwrap":false,"publish_time":1583941023595,"_cnpm_publish_time":1583941023595},"5.0.0":{"name":"serialize-error","version":"5.0.0","description":"Serialize/deserialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send","deserialize"],"dependencies":{"type-fest":"^0.8.0"},"devDependencies":{"ava":"^2.4.0","tsd":"^0.8.0","xo":"^0.24.0"},"gitHead":"480ed369823b089ac8c75092d59c1d1f7390350e","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@5.0.0","_nodeVersion":"10.16.3","_npmVersion":"6.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"a7ebbcdb03a5d71a6ed8461ffe0fc1a1afed62ac","size":2503,"noattachment":false,"key":"/serialize-error/-/serialize-error-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-5.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_5.0.0_1569224125286_0.47857831794983063"},"_hasShrinkwrap":false,"publish_time":1569224125474,"_cnpm_publish_time":1569224125474},"4.1.0":{"name":"serialize-error","version":"4.1.0","description":"Serialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["error","serialize","stringify","object","convert","process","send"],"dependencies":{"type-fest":"^0.3.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.1","xo":"^0.24.0"},"gitHead":"443928e94924db31f5f812215baaba0e40843e23","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@4.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"63e1e33ede20bcd89d9f0528ea4c15fbf0f2b78a","size":2206,"noattachment":false,"key":"/serialize-error/-/serialize-error-4.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-4.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_4.1.0_1554172354374_0.6667091129608826"},"_hasShrinkwrap":false,"publish_time":1554172354529,"_cnpm_publish_time":1554172354529},"4.0.0":{"name":"serialize-error","version":"4.0.0","description":"Serialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["error","serialize","stringify","object","convert","process","send"],"dependencies":{"type-fest":"^0.3.0"},"devDependencies":{"ava":"^1.3.1","tsd-check":"^0.5.0","xo":"^0.24.0"},"gitHead":"30dfdfc0c7b6a164dd22ea187729075e220485eb","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@4.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"973e85f32645a40c5b7e3dcf3a8175deaac3c463","size":2080,"noattachment":false,"key":"/serialize-error/-/serialize-error-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-4.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_4.0.0_1552928888291_0.9212316429642302"},"_hasShrinkwrap":false,"publish_time":1552928888378,"_cnpm_publish_time":1552928888378},"3.0.0":{"name":"serialize-error","version":"3.0.0","description":"Serialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"keywords":["error","err","serialize","stringify","object","convert","process","send"],"devDependencies":{"ava":"^0.25.0","xo":"^0.23.0"},"gitHead":"a6f29dd99d27326cf8b4fec10b15cda392743480","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@3.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"80100282b09be33c611536f50033481cb9cc87cf","size":1888,"noattachment":false,"key":"/serialize-error/-/serialize-error-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serialize-error_3.0.0_1539073699691_0.43358932272225825"},"_hasShrinkwrap":false,"publish_time":1539073699816,"_cnpm_publish_time":1539073699816},"2.1.0":{"name":"serialize-error","version":"2.1.0","description":"Serialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["error","err","serialize","stringify","object","obj","convert","process","send"],"devDependencies":{"ava":"*","xo":"^0.16.0"},"gitHead":"842f3dadec486bf6e69d7106bae1a550a15cbdae","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@2.1.0","_shasum":"50b679d5635cdf84667bdc8e59af4e5b81d5f60a","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"50b679d5635cdf84667bdc8e59af4e5b81d5f60a","size":1936,"noattachment":false,"key":"/serialize-error/-/serialize-error-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/serialize-error-2.1.0.tgz_1479786904612_0.7532467234414071"},"directories":{},"publish_time":1479786904837,"_cnpm_publish_time":1479786904837,"_hasShrinkwrap":false},"2.0.0":{"name":"serialize-error","version":"2.0.0","description":"Serialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/serialize-error.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["error","err","serialize","stringify","object","obj","convert","process","send"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"94f4232c5162bbd305a084cd37d22382bccd6f25","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error#readme","_id":"serialize-error@2.0.0","_shasum":"6c1153f7ee3fe7f73ff1b1b7d2b494b67b675eba","_from":".","_npmVersion":"3.8.3","_nodeVersion":"4.3.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"6c1153f7ee3fe7f73ff1b1b7d2b494b67b675eba","size":1949,"noattachment":false,"key":"/serialize-error/-/serialize-error-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/serialize-error-2.0.0.tgz_1458977936216_0.9782707907725126"},"directories":{},"publish_time":1458977936638,"_cnpm_publish_time":1458977936638,"_hasShrinkwrap":false},"1.1.0":{"name":"serialize-error","version":"1.1.0","description":"Serialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/serialize-error"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["error","err","serialize","stringify","object","obj","convert"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"f93d2a714c86b035f74e0639e92fc8e49a97abaf","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error","_id":"serialize-error@1.1.0","_shasum":"3616fdc38d5bd89d9bc5e8d2f05d389c9b3689a3","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"3616fdc38d5bd89d9bc5e8d2f05d389c9b3689a3","size":1945,"noattachment":false,"key":"/serialize-error/-/serialize-error-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1448354625273,"_cnpm_publish_time":1448354625273,"_hasShrinkwrap":false},"1.0.0":{"name":"serialize-error","version":"1.0.0","description":"Serialize an error into a plain object","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/serialize-error"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["error","err","serialize","stringify","object","obj","convert"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"086a2b40f4e40e8ad6f2a9555c299955241bc031","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"homepage":"https://github.com/sindresorhus/serialize-error","_id":"serialize-error@1.0.0","_shasum":"267a59ed80ce19f49629d182576235860c0cb7e2","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"267a59ed80ce19f49629d182576235860c0cb7e2","size":1649,"noattachment":false,"key":"/serialize-error/-/serialize-error-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/serialize-error/download/serialize-error-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1445960268260,"_cnpm_publish_time":1445960268260,"_hasShrinkwrap":false}},"readme":"# serialize-error\n\n> Serialize/deserialize an error into a plain object\n\nUseful if you for example need to `JSON.stringify()` or `process.send()` the error.\n\n## Install\n\n```sh\nnpm install serialize-error\n```\n\n## Usage\n\n```js\nimport {serializeError, deserializeError} from 'serialize-error';\n\nconst error = new Error('????');\n\nconsole.log(error);\n//=> [Error: ????]\n\nconst serialized = serializeError(error);\n\nconsole.log(serialized);\n//=> {name: 'Error', message: '????', stack: 'Error: ????\\n    at Object.<anonymous> …'}\n\nconst deserialized = deserializeError(serialized);\n\nconsole.log(deserialized);\n//=> [Error: ????]\n```\n\n### Error constructors\n\nWhen a serialized error with a known `name` is encountered, it will be deserialized using the corresponding error constructor, while unknown error names will be deserialized as regular errors:\n\n```js\nimport {deserializeError} from 'serialize-error';\n\nconst known = deserializeError({\n\tname: 'TypeError',\n\tmessage: '????'\n});\n\nconsole.log(known);\n//=> [TypeError: ????] <-- Still a TypeError\n\nconst unknown = deserializeError({\n\tname: 'TooManyCooksError',\n\tmessage: '????'\n});\n\nconsole.log(unknown);\n//=> [Error: ????] <-- Just a regular Error\n```\n\nThe [list of known errors](./error-constructors.js) can be extended globally. This also works if `serialize-error` is a sub-dependency that's not used directly.\n\n```js\nimport {addKnownErrorConstructor} from 'serialize-error';\nimport {MyCustomError} from './errors.js'\n\naddKnownErrorConstructor(MyCustomError);\n```\n\nFor error constructors that require arguments, you can provide a factory function:\n\n```js\nimport {addKnownErrorConstructor} from 'serialize-error';\n\nclass CustomError extends Error {\n\tname = 'CustomError';\n\n\tconstructor(message, options) {\n\t\tsuper(message);\n\t\tthis.code = options.code;\n\t}\n}\n\naddKnownErrorConstructor(CustomError, () => new CustomError('', {code: 'ERR_UNICORN'}));\n```\n\n## API\n\n### serializeError(value, options?)\n\nSerialize an `Error` object into a plain object.\n\n- Custom properties are preserved.\n- Non-enumerable properties are kept non-enumerable (name, message, stack).\n- Enumerable properties are kept enumerable (all properties besides the non-enumerable ones).\n- Primitive values (including `null`, `undefined`, strings, numbers, etc.) and functions are wrapped in a `NonError` error and serialized.\n- Buffer properties are replaced with `[object Buffer]`.\n- Circular references are handled.\n- If the input object has a `.toJSON()` method, then it's called instead of serializing the object's properties.\n- It's up to `.toJSON()` implementation to handle circular references and enumerability of the properties.\n\n### value\n\nType: `Error | unknown`\n\n### toJSON implementation examples\n\n```js\nimport {serializeError} from 'serialize-error';\n\nclass ErrorWithDate extends Error {\n\tconstructor() {\n\t\tsuper();\n\t\tthis.date = new Date();\n\t}\n}\n\nconst error = new ErrorWithDate();\n\nconsole.log(serializeError(error));\n//=> {date: '1970-01-01T00:00:00.000Z', name, message, stack}\n```\n\n```js\nimport {serializeError} from 'serialize-error';\n\nconst error = new Error('Unicorn');\n\nerror.horn = {\n\ttoJSON() {\n\t\treturn 'x';\n\t}\n};\n\nserializeError(error);\n// => {horn: 'x', name, message, stack}\n```\n\n### deserializeError(value, options?)\n\nDeserialize a plain object or any value into an `Error` object.\n\n- `Error` objects are passed through.\n- Objects that have at least a `message` property are interpreted as errors.\n- All other values are wrapped in a `NonError` error.\n- Custom properties are preserved.\n- Non-enumerable properties are kept non-enumerable (name, message, stack, cause).\n- Enumerable properties are kept enumerable (all properties besides the non-enumerable ones).\n- Circular references are handled.\n- [Native error constructors](./error-constructors.js) are preserved (TypeError, DOMException, etc) and [more can be added.](#error-constructors)\n\n### value\n\nType: `{message: string} | unknown`\n\n### options\n\nType: `object`\n\n#### maxDepth\n\nType: `number`\\\nDefault: `Number.POSITIVE_INFINITY`\n\nThe maximum depth of properties to preserve when serializing/deserializing.\n\n```js\nimport {serializeError} from 'serialize-error';\n\nconst error = new Error('????');\nerror.one = {two: {three: {}}};\n\nconsole.log(serializeError(error, {maxDepth: 1}));\n//=> {name: 'Error', message: '????', one: {}}\n\nconsole.log(serializeError(error, {maxDepth: 2}));\n//=> {name: 'Error', message: '????', one: { two: {}}}\n```\n\n#### useToJSON\n\nType: `boolean`\\\nDefault: `true`\n\nIndicate whether to use a `.toJSON()` method if encountered in the object. This is useful when a custom error implements [its own serialization logic via `.toJSON()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#tojson_behavior) but you prefer to not use it.\n\n### isErrorLike(value)\n\nPredicate to determine whether a value looks like an error, even if it's not an instance of `Error`. It must have at least the `name`, `message`, and `stack` properties.\n\n```js\nimport {isErrorLike} from 'serialize-error';\n\nconst error = new Error('????');\nerror.one = {two: {three: {}}};\n\nisErrorLike({\n\tname: 'DOMException',\n\tmessage: 'It happened',\n\tstack: 'at foo (index.js:2:9)',\n});\n//=> true\n\nisErrorLike(new Error('????'));\n//=> true\n\nisErrorLike(serializeError(new Error('????')));\n//=> true\n\nisErrorLike({\n\tname: 'Bluberricious pancakes',\n\tstack: 12,\n\tingredients: 'Blueberry',\n});\n//=> false\n```\n","_attachments":{},"homepage":"https://github.com/sindresorhus/serialize-error#readme","bugs":{"url":"https://github.com/sindresorhus/serialize-error/issues"},"license":"MIT"}