{"id":18672978,"url":"https://github.com/vicanso/simple-stringify","last_synced_at":"2025-10-26T17:19:05.687Z","repository":{"id":57360953,"uuid":"71461220","full_name":"vicanso/simple-stringify","owner":"vicanso","description":"simple stringify json for node.js","archived":false,"fork":false,"pushed_at":"2018-06-08T13:20:02.000Z","size":42,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-28T01:04:51.536Z","etag":null,"topics":["log","stringify"],"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/vicanso.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":"2016-10-20T12:33:02.000Z","updated_at":"2022-06-09T09:07:36.000Z","dependencies_parsed_at":"2022-09-06T22:22:21.734Z","dependency_job_id":null,"html_url":"https://github.com/vicanso/simple-stringify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicanso%2Fsimple-stringify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicanso%2Fsimple-stringify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicanso%2Fsimple-stringify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicanso%2Fsimple-stringify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vicanso","download_url":"https://codeload.github.com/vicanso/simple-stringify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239513379,"owners_count":19651322,"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":["log","stringify"],"created_at":"2024-11-07T09:13:36.841Z","updated_at":"2025-10-26T17:19:05.599Z","avatar_url":"https://github.com/vicanso.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-stringify\n\n[![Build Status](https://travis-ci.org/vicanso/simple-stringify.svg?branch=master)](https://travis-ci.org/vicanso/simple-stringify)\n[![Coverage Status](https://img.shields.io/coveralls/vicanso/simple-stringify/master.svg?style=flat)](https://coveralls.io/r/vicanso/simple-stringify?branch=master)\n[![npm](http://img.shields.io/npm/v/simple-stringify.svg?style=flat-square)](https://www.npmjs.org/package/simple-stringify)\n[![Github Releases](https://img.shields.io/npm/dm/simple-stringify.svg?style=flat-square)](https://github.com/vicanso/simple-stringify)\n\nSimple way stringify json for log.\n\n## Installation\n\n```js\n$ npm install simple-stringify\n```\n\n## API\n\n```js\nconst stringify = require('simple-stringify');\nconst data = {\n  no: 123,\n  mobile: null,\n  addresss: undefined,\n  disabled: false,\n  name: 'tree.xie',\n  keywords: [\n    'koa',\n    'framework',\n    'albi',\n  ],\n  infos: {\n    url : 'https://github.com/vicanso/albi/issues',\n    email: 'vicansocanbico@gmail.com'\n  },\n};\n// no=123 mobile=null addresss=undefined disabled=false name=\"tree.xie\" keywords=[] infos={}\nstringify.json(data);\n```\n\n### divider\n\nThe divider for stringify, default is ' '.\n\n```js\nconst stringify = require('simple-stringify');\nstringify.divider = ',';\n```\n\n### isSecret\n\nDetermine if it is confidential by key. If return true, the value will be ***.\n\n```js\nconst stringify = require('simple-stringify');\nstringify.isSecret = key =\u003e key === 'password';\n// account=\"tree.xie\" password=\"***\"\nstringify.json({\n  password: '123456',\n});\n```\n\n\n### json\n\nStringify json data\n\n- `level` format level, default is stringify.maxLevel\n\n```js\nconst stringify = require('simple-stringify');\nconst data = {\n  no: 123,\n  mobile: null,\n  addresss: undefined,\n  disabled: false,\n  name: 'tree.xie',\n  keywords: [\n    'koa',\n    'framework',\n    'albi',\n  ],\n  infos: {\n    url : 'https://github.com/vicanso/albi/issues',\n    email: 'vicansocanbico@gmail.com'\n  },\n};\n// no=123 mobile=null addresss=undefined disabled=false name=\"tree.xie\" keywords=[] infos={}\nstringify.json(data);\n\n// no=123 mobile=null addresss=undefined disabled=false name=\"tree.xie\" keywords=[0=\"koa\" 1=\"framework\" 2=\"albi\"] infos={url=\"https://github.com/vicanso/albi/issues\" email=\"vicansocanbico@gmail.com\"}\nstringify.json(data, 2);\n```\n\n### maxLevel\n\nSet stringify max level, default is 1\n\n```js\nconst stringify = require('simple-stringify');\nstringify.maxLevel = 2;\nconst data = {\n  no: 123,\n  mobile: null,\n  addresss: undefined,\n  disabled: false,\n  name: 'tree.xie',\n  keywords: [\n    'koa',\n    'framework',\n    'albi',\n  ],\n  infos: {\n    url : 'https://github.com/vicanso/albi/issues',\n    email: 'vicansocanbico@gmail.com'\n  },\n};\n// no=123 mobile=null addresss=undefined disabled=false name=\"tree.xie\" keywords=[0=\"koa\" 1=\"framework\" 2=\"albi\"] infos={url=\"https://github.com/vicanso/albi/issues\" email=\"vicansocanbico@gmail.com\"}\nstringify.json(data);\n```\n\n## Benchmarks\n\n```\nJSON.stringify 1000000 times, use:2438ms\nsimple-stringify json 1000000 times, use:1684ms\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvicanso%2Fsimple-stringify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvicanso%2Fsimple-stringify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvicanso%2Fsimple-stringify/lists"}