{"id":16751740,"url":"https://github.com/zcuric/sql-log-prettifier","last_synced_at":"2025-03-21T22:32:09.646Z","repository":{"id":35266208,"uuid":"216753616","full_name":"zcuric/sql-log-prettifier","owner":"zcuric","description":"A prettifier for your sql logs","archived":false,"fork":false,"pushed_at":"2023-01-06T02:14:19.000Z","size":842,"stargazers_count":13,"open_issues_count":14,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T05:51:14.589Z","etag":null,"topics":["logging","pino","query","sequelize","sql","winston"],"latest_commit_sha":null,"homepage":null,"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/zcuric.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":"2019-10-22T07:46:43.000Z","updated_at":"2023-02-26T16:09:53.000Z","dependencies_parsed_at":"2023-01-15T17:18:11.441Z","dependency_job_id":null,"html_url":"https://github.com/zcuric/sql-log-prettifier","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcuric%2Fsql-log-prettifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcuric%2Fsql-log-prettifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcuric%2Fsql-log-prettifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcuric%2Fsql-log-prettifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zcuric","download_url":"https://codeload.github.com/zcuric/sql-log-prettifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244880451,"owners_count":20525507,"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":["logging","pino","query","sequelize","sql","winston"],"created_at":"2024-10-13T02:44:46.791Z","updated_at":"2025-03-21T22:32:09.302Z","avatar_url":"https://github.com/zcuric.png","language":"TypeScript","readme":"# SQL log prettifier\n\nSQL query prettifier for your favorite logger\n\n## Usage \n\n```sh\nnpm install sql-log-prettifier\n# or\nyarn add sql-log-prettifier\n```\n\nIn your project require or import `sql-log-prettifier`\n```js\nconst { prettify } = require('sql-log-prettifier');\n// import { prettify } from 'sql-log-prettifier';\n\nconst unformattedAndUglySql = `SELECT * FROM custom_table WHERE id = 1 AND name = 'Test'`;\nconsole.log(prettify(unformattedAndUglySql));\n```\nOutput will look something like this: \n\n\u003cimg src=\"./carbon.png\"\u003e\u003c/img\u003e\n\n## Settings \n\n`prettify` function accepts `settings` as the second argument.\n\nDefault settings are: \n```js\nconst defaultSettings = {\n  format: true,\n  noColors: false,\n  settings: {\n    functions: {\n      color: '#ff5555',\n      modifiers: ['bold'],\n    },\n    keywords: {\n      color: '#ff5555',\n      modifiers: ['bold'],\n    },\n    operators: {\n      color: '#91B859',\n      modifiers: ['bold'],\n    },\n    strings: {\n      color: '#FFFFF',\n    },\n    numbers: {\n      color: '#50fa7b',\n    },\n  },\n};\n```\n\n### TODO: \n- Add examples for popular loggers (`pino`, `winston`)\n- Update README.md \n- Anything else that needs to be done :construction_worker:\n\n\n## Development\n\n`sql-log-prettifer` is built with [`tsdx`](https://github.com/jaredpalmer/tsdx).\n\n```\n# Running examples\nnpm run start\n\n# Running tests\nnpm run test\n\n# Running build\nnpm run build\n```\n\n## Contributing\n\nAll contributions are welcome.\n\n## License\n\nMIT @ Zdravko Ćurić [(zcuric)](https://github.com/zcuric)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzcuric%2Fsql-log-prettifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzcuric%2Fsql-log-prettifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzcuric%2Fsql-log-prettifier/lists"}