{"id":15675435,"url":"https://github.com/jonschlinkert/prettier-inspect","last_synced_at":"2025-05-07T00:23:04.815Z","repository":{"id":57330007,"uuid":"112789931","full_name":"jonschlinkert/prettier-inspect","owner":"jonschlinkert","description":"Better inspect formatting, using prettier for arrays, objects and functions, and util.inspect for everything else.","archived":false,"fork":false,"pushed_at":"2017-12-02T16:40:25.000Z","size":13,"stargazers_count":13,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-30T03:17:56.894Z","etag":null,"topics":["console","debug","format","inspect","javascript","node","nodejs","prettier","print","printer","util"],"latest_commit_sha":null,"homepage":"https://github.com/jonschlinkert","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/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-01T21:46:01.000Z","updated_at":"2021-02-27T19:07:34.000Z","dependencies_parsed_at":"2022-08-29T04:31:09.343Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/prettier-inspect","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fprettier-inspect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fprettier-inspect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fprettier-inspect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fprettier-inspect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/prettier-inspect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252789197,"owners_count":21804410,"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":["console","debug","format","inspect","javascript","node","nodejs","prettier","print","printer","util"],"created_at":"2024-10-03T16:00:09.370Z","updated_at":"2025-05-07T00:23:04.765Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prettier-inspect [![NPM version](https://img.shields.io/npm/v/prettier-inspect.svg?style=flat)](https://www.npmjs.com/package/prettier-inspect) [![NPM monthly downloads](https://img.shields.io/npm/dm/prettier-inspect.svg?style=flat)](https://npmjs.org/package/prettier-inspect) [![NPM total downloads](https://img.shields.io/npm/dt/prettier-inspect.svg?style=flat)](https://npmjs.org/package/prettier-inspect) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/prettier-inspect.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/prettier-inspect)\n\n\u003e Better inspect formatting, using prettier for arrays, objects and functions, and util.inspect for everything else.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Table of Contents\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eDetails\u003c/strong\u003e\u003c/summary\u003e\n\n- [Install](#install)\n- [Usage](#usage)\n- [Examples](#examples)\n  * [Arrays](#arrays)\n  * [Buffers](#buffers)\n  * [Dates](#dates)\n  * [Errors](#errors)\n  * [Functions](#functions)\n  * [Numbers](#numbers)\n  * [Objects](#objects)\n  * [Regular expressions](#regular-expressions)\n  * [Strings](#strings)\n  * [RegExp.exec and String.match arguments](#regexpexec-and-stringmatch-arguments)\n- [Release history](#release-history)\n- [About](#about)\n\n\u003c/details\u003e\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save prettier-inspect\n```\n\n## Usage\n\n```js\nvar inspect = require('prettier-inspect');\nconsole.log(inspect(value[, options]));\n```\n\n**Params**\n\n* `value` - any javascript value\n* `options` - options to pass to [prettier](https://prettier.io)\n\n## Examples\n\nThe following examples are based on the default options.\n\n### Arrays\n\n```js\nfunction fn( a, b ){return a + b}\nconsole.log(inspect([{a: 'b', c: 'd', e: 'f', fn: fn}]));\n```\n\nPrints:\n\n```js\n[\n  {\n    a: 'b',\n    c: 'd',\n    e: 'f',\n    fn: function fn(a, b) {\n      return a + b;\n    }\n  }\n];\n```\n\n### Buffers\n\n```js\nconsole.log(inspect(new Buffer('foo')));\n//=\u003e \u003cBuffer 66 6f 6f\u003e\n```\n\n### Dates\n\n```js\nconsole.log(inspect(new Date()));\n//=\u003e 2017-12-01T21:33:21.938Z\n```\n\n### Errors\n\n```js\nconsole.log(inspect(new Error('this is an error!')));\n```\n\nPrints:\n\n```\nError: this is an error!\n    at Object.\u003canonymous\u003e (/Users/foo/bar/examples.js:26:21)\n    at Module._compile (module.js:641:30)\n    at Object.Module._extensions..js (module.js:652:10)\n    at Module.load (module.js:560:32)\n    at tryModuleLoad (module.js:503:12)\n    at Function.Module._load (module.js:495:3)\n    at Function.Module.runMain (module.js:682:10)\n    at startup (bootstrap_node.js:191:16)\n    at bootstrap_node.js:613:3\n```\n\n### Functions\n\n```js\nfunction fn( a, b ){return a + b}\nconsole.log(inspect(fn));\n```\n\nPrints:\n\n```js\nfunction fn(a, b) {\n  return a + b;\n}\n```\n\n### Numbers\n\n```js\nconsole.log(inspect(9));\n//=\u003e 9\n```\n\n### Objects\n\n```js\nconsole.log(inspect({\n  obj: {\n  a: [ { foo: 'bar', baz: { qux: 'fez'}      }],\n  c: 'd', e: 'f',\n  g: function  (one, two){return one + two},\n  h: {a: 'b', c: 'd'},\n  regex: /^foo(?=bar)/g }\n}));\n```\n\nPrints:\n\n```js\n{\n  obj: {\n    a: [\n      {\n        foo: 'bar',\n        baz: { qux: 'fez' }\n      }\n    ],\n    c: 'd',\n    e: 'f',\n    g: function(one, two) {\n      return one + two;\n    },\n    h: {\n      a: 'b',\n      c: 'd'\n    },\n    regex: /^foo(?=bar)/g\n  }\n};\n```\n\n### Regular expressions\n\n```js\nconsole.log(inspect(/^foo$/));\n//=\u003e /^foo$/\n```\n\n### Strings\n\n```js\nconsole.log(inspect('foo\\nbar'));\n//=\u003e 'foo\\nbar'\n```\n\n### RegExp.exec and String.match arguments\n\n```js\nconsole.log(inspect(/foo/.exec('foo')));\n//=\u003e [ 'foo', index: 0, input: 'foo' ]\n```\n\n## Release history\n\nSee the [changelog](changelog.md) for updates.\n\n## About\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eContributing\u003c/strong\u003e\u003c/summary\u003e\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\nPlease read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eRunning Tests\u003c/strong\u003e\u003c/summary\u003e\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBuilding docs\u003c/strong\u003e\u003c/summary\u003e\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n\u003c/details\u003e\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object \"Returns true if an object was created by the `Object` constructor.\")\n* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of \"Get the native type of a value.\")\n\n### Author\n\n**Jon Schlinkert**\n\n* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert)\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 01, 2017._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fprettier-inspect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fprettier-inspect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fprettier-inspect/lists"}