{"id":16840741,"url":"https://github.com/nfischer/shelljs-plugin-inspect","last_synced_at":"2025-04-11T05:51:00.110Z","repository":{"id":10069490,"uuid":"64348354","full_name":"nfischer/shelljs-plugin-inspect","owner":"nfischer","description":":mag: Add a .inspect method to ShellJS objects for REPL use","archived":false,"fork":false,"pushed_at":"2025-03-09T00:19:47.000Z","size":88,"stargazers_count":5,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T03:51:10.420Z","etag":null,"topics":["shelljs","shelljs-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/nfischer.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":".github/SECURITY.md","support":null,"governance":null}},"created_at":"2016-07-27T23:26:52.000Z","updated_at":"2025-03-09T00:19:49.000Z","dependencies_parsed_at":"2023-12-07T09:37:10.639Z","dependency_job_id":null,"html_url":"https://github.com/nfischer/shelljs-plugin-inspect","commit_stats":{"total_commits":30,"total_committers":3,"mean_commits":10.0,"dds":"0.30000000000000004","last_synced_commit":"148be477fc192102693df28085b5cce626bfe5b9"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfischer%2Fshelljs-plugin-inspect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfischer%2Fshelljs-plugin-inspect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfischer%2Fshelljs-plugin-inspect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfischer%2Fshelljs-plugin-inspect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nfischer","download_url":"https://codeload.github.com/nfischer/shelljs-plugin-inspect/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248351425,"owners_count":21089271,"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":["shelljs","shelljs-plugin"],"created_at":"2024-10-13T12:37:54.979Z","updated_at":"2025-04-11T05:51:00.089Z","avatar_url":"https://github.com/nfischer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shelljs-plugin-inspect\n\n[![GitHub Actions](https://img.shields.io/github/actions/workflow/status/nfischer/shelljs-plugin-inspect/main.yml?style=flat-square\u0026logo=github)](https://github.com/nfischer/shelljs-plugin-inspect/actions/workflows/main.yml)\n[![npm](https://img.shields.io/npm/v/shelljs-plugin-inspect.svg?style=flat-square)](https://www.npmjs.com/package/shelljs-plugin-inspect)\n[![shelljs-plugin](https://img.shields.io/badge/shelljs-plugin-brightgreen.svg?style=flat-square)](https://github.com/shelljs/shelljs/wiki/Using-ShellJS-Plugins)\n\nA [ShellJS](https://github.com/shelljs/shelljs) plugin to add custom REPL\ninspection for ShellJS output. This turns hard-to-read `ShellString` objects\ninto nicely formatted text (resembling what the actual unix commands would\noutput).\n\n## Installation\n\n```bash\n$ npm install --save shelljs\n$ npm install --save shelljs-plugin-inspect\n```\n\n**Tip:** If you want to use this plugin (and more REPL goodies), check out my\nproject [n\\_shell](https://github.com/nfischer/n_shell) to get a REPL with\nShellJS loaded by default!\n\n## Usage\n\nHere's what ShellJS looks like by default in the REPL:\n\n```javascript\n\u003e // Before this plugin: hard-to-read ShellString objects\n\u003e shell.cat('file1.txt');\n{ [String: 'These are the file contents\\nAnd they\\'re printed out nicely!\\n']\n  stdout:'These are the file contents\\nAnd they\\'re printed out nicely!\\n',\n  stderr: null,\n  code: 0,\n  cat: [Function: bound ],\n  head: [Function: bound ],\n  tail: [Function: bound ],\n  to: [Function: bound ],\n  toEnd: [Function: bound ],\n  sed: [Function: bound ],\n  sort: [Function: bound ],\n  uniq: [Function: bound ],\n  grep: [Function: bound ],\n  exec: [Function: bound ] }\n```\n\nAfter:\n\n```\n\u003e // After this plugin: nicely formatted text!\n\u003e require('shelljs-plugin-inspect');\n\u003e shell.cat('file.txt');\nThese are the file contents\nAnd they're printed out nicely!\n\n\u003e shell.ls();\nfile.txt\notherfile.txt\n...\n\n\u003e shell.pwd();\npath/to/current/directory\n```\n\n## Writing ShellJS plugins\n\nIf you're interested in taking a look at the current state of the ShellJS plugin\nAPI, take a look at [index.js](index.js). This has helpful comments explaining\nthe necessary boilerplate for writing a plugin. For an example usage of the\nplugin, take a look at [test/test.js](test/test.js).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnfischer%2Fshelljs-plugin-inspect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnfischer%2Fshelljs-plugin-inspect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnfischer%2Fshelljs-plugin-inspect/lists"}