{"_id":"@shigma/stringify-object","_rev":"1-0419492430b23cff7f8877c636a84012","name":"@shigma/stringify-object","dist-tags":{"latest":"3.3.0"},"versions":{"3.3.0":{"name":"@shigma/stringify-object","version":"3.3.0","description":"Stringify an object/array like JSON.stringify just without all the double-quotes","license":"BSD-2-Clause","repository":{"type":"git","url":"git+https://github.com/yeoman/stringify-object.git"},"author":{"name":"shigma","email":"1700011071@pku.edu.cn"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"keywords":["object","stringify","pretty","print","dump","format","type","json"],"dependencies":{"get-own-enumerable-property-symbols":"^3.0.0","is-obj":"^1.0.1","is-regexp":"^2.0.0"},"devDependencies":{"ava":"^0.25.0","xo":"^0.23.0"},"xo":{"ignores":["test/fixtures/*.js"]},"gitHead":"3a7b2174da44d665f94747c4543cefeac6a94bbb","bugs":{"url":"https://github.com/yeoman/stringify-object/issues"},"homepage":"https://github.com/yeoman/stringify-object#readme","_id":"@shigma/stringify-object@3.3.0","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"shigma","email":"1700011071@pku.edu.cn"},"dist":{"integrity":"sha512-tO5pn6RJp8m1ldYtqY3GEQA6+Nqp1cIZVrVx7iFVPx0YfhMqfplwrvyrQPP1cCwuyRoAyDr/BxVZYt+USm8LXQ==","shasum":"c6611dcdf650024a9f6397580f821accd3021be3","tarball":"https://registry.npmjs.org/@shigma/stringify-object/-/stringify-object-3.3.0.tgz","fileCount":4,"unpackedSize":8565,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJch6sBCRA9TVsSAnZWagAAGHAP/0GZi+qf71/sVJzLt7wj\ng3lMtwikm8F2k9VGAwm0l4C/M8o2isR6jM9ZxuxDfEY6Ik5U2vXPSFlhKQym\nUud7aYnarN3jDmuVQ7attkNSktTFA1/L0MUxuK+uq7Z87+NaLLp96LyLhe7D\ncLaVazFNDNZmODPhZAOkTCuUkrsHqCHIjRrpN5q6rKjdKh7f77ZH7zoyaiCh\nO9B4QQvzf3QZfur22CmBcrqEneDmzn7K7eVzYHllO9jqTySL4pDpqCwidzJV\n1wQFF+oS+n6KKlXcbB3gxa1x6T3bM3sNKtx618THoUgI+GeVH1Fhcld8Rp3A\n4N6AbsIwYea89ApF3ZGYxK1K+buu0OO66RDxjOrKkWFBVcP7kw9270ZxMYWl\nNgqh4NmuYxUVKpfkFBEjIXnuqRKSNUZo7MLRms0O9t+MjYhYlywrIgxScqA5\n02aBG847t8EeRz0edjgmb/pIiuIHdyp4m621R6XtyeqG/5KU4NLFtzE5lXRg\nSqe5KW9L/+F7fy9rzmnLP8kYia5s5vOiz+qZCPetfKL2Hasm+hLeHS0ZJPGx\nQWF4JE5Cvxh7lQS8GF42E8RRg5pWAWgVAjVypmCQJKqFb/MW42mj1WBSIAg+\nXzUkiqOKckACMknLTrHf1OiOOjLx5PpTfYimsrNKSXzV8vJgGDa3UujWJSrn\nwJtD\r\n=o4pr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdqNVkslZJkUjABEmXYXEeoQnjXssoBsngF3u9LkMdMQIgG+uushB5BWoPYFaOewrKPn6vu39fzLUghvorburInhY="}]},"maintainers":[{"name":"shigma","email":"1700011071@pku.edu.cn"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stringify-object_3.3.0_1552395009339_0.2705482809329054"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-12T12:50:09.147Z","3.3.0":"2019-03-12T12:50:09.448Z","modified":"2022-04-06T23:14:19.098Z"},"maintainers":[{"name":"shigma","email":"1700011071@pku.edu.cn"}],"description":"Stringify an object/array like JSON.stringify just without all the double-quotes","homepage":"https://github.com/yeoman/stringify-object#readme","keywords":["object","stringify","pretty","print","dump","format","type","json"],"repository":{"type":"git","url":"git+https://github.com/yeoman/stringify-object.git"},"author":{"name":"shigma","email":"1700011071@pku.edu.cn"},"bugs":{"url":"https://github.com/yeoman/stringify-object/issues"},"license":"BSD-2-Clause","readme":"# stringify-object\n\n**This is forked from [stringify-object](https://github.com/yeoman/stringify-object) to [fix wrong function interpretation](https://github.com/yeoman/stringify-object/pull/65).**\n\n> Stringify an object/array like JSON.stringify just without all the double-quotes\n\nUseful for when you want to get the string representation of an object in a formatted way.\n\nIt also handles circular references and lets you specify quote type.\n\n\n## Install\n\n```\n$ npm install stringify-object\n```\n\n\n## Usage\n\n```js\nconst stringifyObject = require('stringify-object');\n\nconst obj = {\n\tfoo: 'bar',\n\t'arr': [1, 2, 3],\n\tnested: {\n\t\thello: \"world\"\n\t}\n};\n\nconst pretty = stringifyObject(obj, {\n\tindent: '  ',\n\tsingleQuotes: false\n});\n\nconsole.log(pretty);\n/*\n{\n\tfoo: \"bar\",\n\tarr: [\n\t\t1,\n\t\t2,\n\t\t3\n\t],\n\tnested: {\n\t\thello: \"world\"\n\t}\n}\n*/\n```\n\n\n## API\n\n### stringifyObject(input, [options])\n\nCircular references will be replaced with `\"[Circular]\"`.\n\n#### input\n\nType: `Object` `Array`\n\n#### options\n\nType: `Object`\n\n##### indent\n\nType: `string`<br>\nDefault: `\\t`\n\nPreferred indentation.\n\n##### singleQuotes\n\nType: `boolean`<br>\nDefault: `true`\n\nSet to false to get double-quoted strings.\n\n##### filter(obj, prop)\n\nType: `Function`\n\nExpected to return a `boolean` of whether to include the property `prop` of the object `obj` in the output.\n\n##### transform(obj, prop, originalResult)\n\nType: `Function`<br>\nDefault: `undefined`\n\nExpected to return a `string` that transforms the string that resulted from stringifying `obj[prop]`. This can be used to detect special types of objects that need to be stringified in a particular way. The `transform` function might return an alternate string in this case, otherwise returning the `originalResult`.\n\nHere's an example that uses the `transform` option to mask fields named \"password\":\n\n```js\nconst stringifyObject = require('stringify-object');\n\nconst obj = {\n\tuser: 'becky',\n\tpassword: 'secret'\n};\n\nconst pretty = stringifyObject(obj, {\n\ttransform: (obj, prop, originalResult) => {\n\t\tif (prop === 'password') {\n\t\t\treturn originalResult.replace(/\\w/g, '*');\n\t\t}\n\n\t\treturn originalResult;\n\t}\n});\n\nconsole.log(pretty);\n/*\n{\n\tuser: 'becky',\n\tpassword: '******'\n}\n*/\n```\n\n\n##### inlineCharacterLimit\n\nType: `number`\n\nWhen set, will inline values up to `inlineCharacterLimit` length for the sake of more terse output.\n\nFor example, given the example at the top of the README:\n\n```js\nconst stringifyObject = require('stringify-object');\n\nconst obj = {\n\tfoo: 'bar',\n\t'arr': [1, 2, 3],\n\tnested: {\n\t\thello: \"world\"\n\t}\n};\n\nconst pretty = stringifyObject(obj, {\n\tindent: '  ',\n\tsingleQuotes: false,\n\tinlineCharacterLimit: 12\n});\n\nconsole.log(pretty);\n/*\n{\n\tfoo: \"bar\",\n\tarr: [1, 2, 3],\n\tnested: {\n\t\thello: \"world\"\n\t}\n}\n*/\n```\n\nAs you can see, `arr` was printed as a one-liner because its string was shorter than 12 characters.\n\n\n## License\n\nBSD-2-Clause © Yeoman team\n","readmeFilename":"readme.md"}