{"id":17472810,"url":"https://github.com/shinnn/neat-stack","last_synced_at":"2025-07-14T01:13:02.536Z","repository":{"id":57320333,"uuid":"90733398","full_name":"shinnn/neat-stack","owner":"shinnn","description":"Make a color-coded stack trace from an error","archived":false,"fork":false,"pushed_at":"2019-04-05T10:10:32.000Z","size":92,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T00:51:20.024Z","etag":null,"topics":["beautify","colored","error","errors","javascript","log","nodejs","readability","stacktrace","terminal"],"latest_commit_sha":null,"homepage":"https://npm.runkit.com/neat-stack","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shinnn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-09T10:28:56.000Z","updated_at":"2021-11-03T04:39:25.000Z","dependencies_parsed_at":"2022-08-25T20:40:15.948Z","dependency_job_id":null,"html_url":"https://github.com/shinnn/neat-stack","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fneat-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fneat-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fneat-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fneat-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shinnn","download_url":"https://codeload.github.com/shinnn/neat-stack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247953105,"owners_count":21023946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beautify","colored","error","errors","javascript","log","nodejs","readability","stacktrace","terminal"],"created_at":"2024-10-18T17:37:32.311Z","updated_at":"2025-04-09T22:54:15.062Z","avatar_url":"https://github.com/shinnn.png","language":"JavaScript","readme":"# neat-stack\n\n[![npm version](https://img.shields.io/npm/v/neat-stack.svg)](https://www.npmjs.com/package/neat-stack)\n[![Build Status](https://travis-ci.com/shinnn/neat-stack.svg?branch=master)](https://travis-ci.com/shinnn/neat-stack)\n[![Coverage Status](https://img.shields.io/coveralls/shinnn/neat-stack.svg)](https://coveralls.io/github/shinnn/neat-stack?branch=master)\n\nMake a color-coded stack trace from an error\n\n```javascript\nconst neatStack = require('neat-stack');\nconst request = require('request');\n\nrequest('foo', err =\u003e console.error(neatStack(err)));\n```\n\n\u003cimg alt=\"example\" src=\"./screenshot.svg\" width=\"890\"\u003e\n\nUseful for CLI applications — stack traces are not very important for end users but needed for authors to receive meaningful bug reports.\n\n## Installation\n\n[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).\n\n```\nnpm install neat-stack\n```\n\n## API\n\n```javascript\nconst neatStack = require('neat-stack');\n```\n\n### neatStack(*error*)\n\n*error*: `Error`  \nReturn: `string`\n\nIt returns a refined [`Error#stack`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack):\n\n* Red-colored by [ANSI escape code](https://en.wikipedia.org/wiki/ANSI_escape_code).\n* Lines starting with `'    at'` are dimmed.\n* [Any lines from Node.js internals are omitted](https://github.com/sindresorhus/clean-stack).\n* Paths are simplified by [replacing a home directory with `~`](https://github.com/shinnn/tilde-path) on POSIX.\n\n```javascript\nconst error = new Error('Hi');\n\nerror.stack; /* =\u003e `Error: Hi\n    at Object.\u003canonymous\u003e (/Users/example/run.js:1:75)\n    at Module._compile (internal/modules/cjs/loader.js:654:30)\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)\n    at Module.load (internal/modules/cjs/loader.js:566:32)\n    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)\n    at Function.Module._load (internal/modules/cjs/loader.js:498:3)\n    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)\n    at startup (internal/bootstrap/node.js:201:19)\n    at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)` */\n\nneatStack(error); /* =\u003e `\\u001b[31mError: Hi\\u001b[2m\n    at Object.\u003canonymous\u003e (~/example/run.js:1:88)\\u001b[22m\\u001b[39m` */\n```\n\n## License\n\n[ISC License](./LICENSE) © 2017 - 2019 Shinnosuke Watanabe\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fneat-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshinnn%2Fneat-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fneat-stack/lists"}