{"id":18861979,"url":"https://github.com/louisxie0830/pretty-log","last_synced_at":"2026-02-09T20:30:17.361Z","repository":{"id":246386213,"uuid":"820984743","full_name":"louisxie0830/pretty-log","owner":"louisxie0830","description":"A TypeScript library for enhancing and formatting log messages.","archived":false,"fork":false,"pushed_at":"2024-06-27T17:52:29.000Z","size":96,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-30T20:48:30.000Z","etag":null,"topics":["console-log","pretty","typescript"],"latest_commit_sha":null,"homepage":"","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/louisxie0830.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-27T15:13:50.000Z","updated_at":"2024-06-30T08:24:26.000Z","dependencies_parsed_at":"2024-06-27T18:39:25.231Z","dependency_job_id":"45136c50-f9d3-4f5c-872d-821ae21d53c7","html_url":"https://github.com/louisxie0830/pretty-log","commit_stats":null,"previous_names":["louisxie0830/pretty-log"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisxie0830%2Fpretty-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisxie0830%2Fpretty-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisxie0830%2Fpretty-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisxie0830%2Fpretty-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/louisxie0830","download_url":"https://codeload.github.com/louisxie0830/pretty-log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239802697,"owners_count":19699551,"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-log","pretty","typescript"],"created_at":"2024-11-08T04:32:54.146Z","updated_at":"2026-02-09T20:30:17.322Z","avatar_url":"https://github.com/louisxie0830.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pretty Log\n\nA TypeScript library for enhancing and formatting log messages.\n\n## Features\n\n- Pretty-print log messages in different styles.\n- Supports both CommonJS and ES modules.\n- Written in TypeScript with type definitions included.\n- Easy to use and integrate into any project.\n\n## Installation\n\nYou can install directly from GitHub:\n\n```bash\nnpm install git+https://github.com/louisxie0830/pretty-log.git\n```\n\n## Examples\n\nHere are examples of how to import and use this library in different projects:\n\n### CommonJS\n\n```javascript\nconst prettyLog = require('pretty-log').default;\n\nconst logger = prettyLog({ enabled: true });\nlogger.info('Hello, World!');\nlogger.error('Hello, World!');\nlogger.warn('Hello, World!');\nlogger.success('Hello, World!');\n```\n\n### ES Modules\n\n```javascript\nimport prettyLog from 'pretty-log';\n\nconst logger = prettyLog({ enabled: true });\nlogger.info('Hello, World!');\nlogger.error('Hello, World!');\nlogger.warn('Hello, World!');\nlogger.success('Hello, World!');\n```\n\n### TypeScript\n\n```typescript\nimport prettyLog from 'pretty-log';\n\nconst logger = prettyLog({ enabled: true });\nlogger.info('Hello, World!');\nlogger.error('Hello, World!');\nlogger.warn('Hello, World!');\nlogger.success('Hello, World!');\n```\n\n## API\n\n### `prettyLog(options)`\n\n- **options**: An object with the following properties:\n  - **enabled**: `boolean` - Enable or disable logging.\n\n#### Methods\n\n- **info(message: string, content?: string)**: Logs an informational message.\n- **error(message: string, content?: string)**: Logs an error message.\n- **warn(message: string, content?: string)**: Logs a warning message.\n- **success(message: string, content?: string)**: Logs a success message.\n- **setEnabled(enabled: boolean)**: Enables or disables logging.\n\n## Development\n\n### Building the Project\n\nTo build the project, run:\n\n```bash\nnpm run build\n```\n\nThis will generate the CommonJS and ES module versions of the library in the `dist` directory.\n\n### Running Tests\n\nTo run tests, use:\n\n```bash\nnpm test\n```\n\nThis will run the tests using Jest.\n\n### Linting and Formatting\n\nTo lint the code, use:\n\n```bash\nnpm run lint\n```\n\nTo format the code, use:\n\n```bash\nnpm run format\n```\n\n### Project Structure\n\n- `src/`: Source code files.\n- `tests/`: Test files.\n- `dist/`: Compiled output files.\n- `package.json`: Project metadata and dependencies.\n- `tsconfig.json`: TypeScript configuration.\n- `tsconfig.cjs.json`: TypeScript configuration for CommonJS modules.\n- `tsconfig.esm.json`: TypeScript configuration for ES modules.\n- `jest.config.js`: Jest configuration.\n- `.eslintrc.json`: ESLint configuration.\n- `.prettierrc`: Prettier configuration.\n- `.prettierignore`: Files ignored by Prettier.\n- `.eslintignore`: Files ignored by ESLint.\n- `.gitignore`: Files ignored by Git.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request for any changes.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contact\n\nAuthor: Nil Xie  \nEmail: bfgh2678@gmail.com  \nGitHub: [louisxie0830](https://github.com/louisxie0830)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouisxie0830%2Fpretty-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flouisxie0830%2Fpretty-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouisxie0830%2Fpretty-log/lists"}