{"id":18792147,"url":"https://github.com/khatastroffik/npm-preview-package","last_synced_at":"2026-05-04T13:31:22.704Z","repository":{"id":40764120,"uuid":"272943358","full_name":"khatastroffik/npm-preview-package","owner":"khatastroffik","description":"The CLI utility \"npm-previewpkg\" generates an overview of the files and directories, which would be part of an npm package when published: a package content preview.","archived":false,"fork":false,"pushed_at":"2023-01-06T09:15:04.000Z","size":160,"stargazers_count":2,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-21T15:14:17.511Z","etag":null,"topics":["documentation","documentation-tool","npm","npm-packages","npm-packlist","package","package-content","packlist","pre-publish","prepublish","preview","qa","tree","treeview","ts","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khatastroffik.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-06-17T10:19:56.000Z","updated_at":"2023-11-28T01:58:29.000Z","dependencies_parsed_at":"2023-02-05T18:30:35.075Z","dependency_job_id":null,"html_url":"https://github.com/khatastroffik/npm-preview-package","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/khatastroffik/npm-preview-package","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khatastroffik%2Fnpm-preview-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khatastroffik%2Fnpm-preview-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khatastroffik%2Fnpm-preview-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khatastroffik%2Fnpm-preview-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khatastroffik","download_url":"https://codeload.github.com/khatastroffik/npm-preview-package/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khatastroffik%2Fnpm-preview-package/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32609355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["documentation","documentation-tool","npm","npm-packages","npm-packlist","package","package-content","packlist","pre-publish","prepublish","preview","qa","tree","treeview","ts","typescript"],"created_at":"2024-11-07T21:18:37.605Z","updated_at":"2026-05-04T13:31:22.687Z","avatar_url":"https://github.com/khatastroffik.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# npm-preview-package\n\nThe \"**npm-previewpkg**\" CLI application generates an overview of the files and directories, which would be part of an npm package when published:\na **package content preview**.\n\nTo be more precise, the utility displays the result provided by `npm-packlist` in a user friendly way.\n\n## features\n\nThe CLI application implements the following:\n\n- [x] preview as \"tree\" (default)\n- [x] preview as \"list\"\n- [x] sorted output (\"file explorer\" like)\n- [x] colored output\n- [ ] stats on files size\n- [ ] verbose (preview date, header generated out of the package.json content etc.) ???\n- [ ] TBD: template output (%previewdate%, %title%, %filelist% etc.) ???\n\nExample output (showing usage of custom colors):\n\n![example output](doc/screenshot-output.png)\n\n## requirements\n\n- **node.js** (circa version \u003e= 8.x)  is required to run the application.\n- **npm** (circa version \u003e= 6.x) is used to install the application.\n- alternatives to npm (untested): **yarn** etc.\n\n## installation\n\nEither **globally** (accessible from everywhere in the shell):\n\n```shell\n\u003e npm install -g @khatastroffik/npm-preview-package\n```\n\nor **locally** (as a \"development dependency\"):\n\n```shell\n\u003e npm install --save-dev @khatastroffik/npm-preview-package\n```\n\n## usage\n\nYou may call the application according to the following schema:\n\n- if installed globally\n\n  ```shell\n  \u003e npm-previewpkg [options] [path-to-the-package]\n  ```\n\n- if installed locally\n\n  ```shell\n  \u003e npx npm-previewpkg [options] [path-to-the-package]\n  ```\n\n### options and parameter\n\n| argument | type | description |\n|---|---|---|\n`-l`, `--list`| option | return a flat list instead of a treeview\n`-v`, `--version`| option | output the version of this application\n`-h`, `--help` | option | display the help message describing the CLI usage\n`-d, --dark-colors` | option | use dark colors (preset) for displaying the treeview\n`-b, --bright-colors` | option | use bright colors (preset) for displaying the treeview\n`-c, --custom-colors` | option | use custom colors for displaying the treeview\n`-tc, --text-color \u003ccolor\u003e` | option | define the custom color of the text. See \"extended help\"\n`-bc, --branch-color \u003ccolor\u003e` | option | define the custom color of the tree branches. See \"extended help\"\n`-eh, --extended-help` | option | display extended help on \"custom colors\" and \"Usage Examples\"\n`[path-to-the-package]` | parameter | the path for which a content preview should be displayed.\n\nAll arguments are optional i.e. may be omitted. If the path parameter is not specified, then the current directory will be scanned instead i.e. the path default to `./`.\n\n### Custom colors\n\nAll custom colors must match a standard CSS color name as defined by the W3C: [W3C color names](https://www.w3.org/wiki/CSS/Properties/color/keywords)\n\nThe custom colors may be (pre-) defined as `ENV` (environment) variables like so (e.g.):\n\n```shell\n\u003e set TreeifierTextColor=orange\n\u003e set TreeifierBranchColor=red\n```\n\nHence, the allowed environment variables are:\n\n- `TreeifierTextColor` for a custom text color\n- `TreeifierBranchColor` for a custom color of the tree branches\n\nIn case any ENV variable is set prior to calling the application, then the option `--custom-colors` may be used without requiring that the text and/or branch colors are explicitly set in the call.\n\nIf the custom colors are not explicitly set in the call, then they default to their corresponding ENV values (if defined) or to the default color \"*lightgray*\".\n\n### Example calls:\n\n- scan the current directory i.e. `./` (default)\n`$ npm-previewpkg`\n\n- scan a specific directory (absolute or relative paths are permitted)\n`$ npm-previewpkg ../some-other-app-directory`\n\n- scan the current directory and display the result as an ordered list\n`$ npm-previewpkg --list`\n\n- display the preview using dark color mode\n`$ npm-previewpkg --dark`\n\n- display the preview using custom colors\n`$ npm-previewpkg --text-color orange --branch-color red`\n\n- display the preview using custom colors as defined per ENV variables (see above)\n`$ npm-previewpkg --custom-colors`\n\n## CI/CD\n\nThis tool could be used to *document a package publication* e.g. as part of a CI/CD workflow.\n\nThe CLI would not break the workflow, since it's only generating some text output in the command line (console). The output may be reused/redirected, though.\n\nExample:\n\n  ```shell\n  \u003e npm-previewpkg --list \u003e pre-publish-package-content.txt\n  ```\n\n## license and repositories\n\n- **License**: MIT - Copyright (c) 2020 Loïs Bégué\n\n- **Code Repository**: The source code of this utility can be found in the following repository: [GitHub :: npm-preview-package](https://github.com/khatastroffik/npm-preview-package)\n\n- **Package Repository**: The installable package containing the utility and the library is available at: [NPM :: npm-preview-package](https://www.npmjs.com/package/@khatastroffik/npm-preview-package)\n\nNote: To conform to the *SoC principle* (Separation of Concerns), the Github repository does not contain the build artifacts and the NPM repository does not contain the sources.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhatastroffik%2Fnpm-preview-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhatastroffik%2Fnpm-preview-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhatastroffik%2Fnpm-preview-package/lists"}