{"_id":"@bnguyensn/logger","_rev":"3-7a23813aedfd85224969ca3f938d3201","name":"@bnguyensn/logger","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@bnguyensn/logger","version":"0.1.0","description":"A basic logger","main":"index.js","author":{"name":"@bnguyensn"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bnguyensn/logger.git"},"private":false,"devDependencies":{"prettier":"^1.18.2"},"dependencies":{"chalk":"^2.4.2"},"gitHead":"3280ee4e555703b8030a7a5dd6e1c1cafb7433c4","bugs":{"url":"https://github.com/bnguyensn/logger/issues"},"homepage":"https://github.com/bnguyensn/logger#readme","_id":"@bnguyensn/logger@0.1.0","_nodeVersion":"10.16.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-CidTazmhCAMDH3Aa5WJc8l1BiJKx6UIJJmxWaXVMC46D3tFDE/LR6zixjpr30nfw4y1sVOwedNrNQxgS/79hVg==","shasum":"e23ce068598ddb38ac96d24df95a6cc3559c7b50","tarball":"https://registry.npmjs.org/@bnguyensn/logger/-/logger-0.1.0.tgz","fileCount":6,"unpackedSize":3398,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdt2vmCRA9TVsSAnZWagAAMygP/1yGVIbEHAQ2rJbatQts\nSuqGvolNego3R+5hdALn2ZR7Iu09dA5qw3kdFjIjDZOp+PcgTEYhEQRqT7Da\n5ufd+y4Ytl77aLpr9jM7/7GxY1eB3iPs3/2IwdtiUDH5SFrx8LYu3CK+UTp+\nTEhFfP0b6TVhadzxZ3gRUQKnqA8aZ5CePgXZWHHaDbJ95DynAh2GVvyMPg2d\nsNoatSjieb8/jZhlvZBN4At/IXlJiIDC66B+DHD7TKYGJMmbFHde97Aqzz9n\nQ9RkGIS+VQWcnm6XlHc6C3D5ik6y6WOOtI9GWvA+MfGnF0V4/cXjc5wYdz6o\nbdPiLlBxQpH4lSJbi45xkTCPN1a5KYhi2WkOsOXeLz9+34zje/4x6/YjAa5C\nkiZeDGWFRc7+2pRRc3NLNVhVFJV1iHJVbz16DqUeuviwyy9coH1Di/nuEicf\nl7OMADJ6MwGMerO3IdJlVTBkcbcj2WsUe2W59xawWW+lMsOBVgWt+ZwBiIqt\na2fOIRK0LjUX5lW75N6knvqkoExdStscA6CTh6i5t1dQKTvPm7Cus2WTbUHx\ntBD6oqPEAyWgkdplYUgCVdcmHrWTyMQ1j04PdKcIPKmwh+GoVsM03z7ABVYF\nNSAufWyqw49jb7cy4Qn1Dpd4EsYnDOGsfm8BhGT7gjgtedDc+/vzcfCGESqS\ntCmm\r\n=l15M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHO62IR8lJD4ToCkpfzftrRxD9uCl9HGr9knRRJF4PHiAiAkIYJPYQupR4i/C+57pdP5HxmK2IZ4V5M4LkoxuxSz+g=="}]},"maintainers":[{"name":"bnguyensn","email":"b.nguyen.sn@gmail.com"}],"_npmUser":{"name":"bnguyensn","email":"b.nguyen.sn@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/logger_0.1.0_1572301797909_0.24769568180841084"},"_hasShrinkwrap":false},"0.2.0":{"name":"@bnguyensn/logger","version":"0.2.0","description":"A basic logger","main":"index.js","author":{"name":"@bnguyensn"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bnguyensn/logger.git"},"private":false,"scripts":{"test":"node tests/index.js","lint":"eslint **/*.js"},"devDependencies":{"eslint":"^6.6.0","eslint-config-prettier":"^6.5.0","prettier":"^1.18.2"},"dependencies":{"chalk":"^2.4.2"},"gitHead":"7b4d2d655b3f40ccd19086895c80a33afd33e494","bugs":{"url":"https://github.com/bnguyensn/logger/issues"},"homepage":"https://github.com/bnguyensn/logger#readme","_id":"@bnguyensn/logger@0.2.0","_nodeVersion":"10.16.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-yqL9ETNq9oouIKESHQtFy/avPTubRGfLXUGSxdNVi1zLk9FjF5kYRxORlCbIfgyY2h6pSxcCxZP9WNotLetL5Q==","shasum":"a32ee532aae11812f7364464df5747d12b32b084","tarball":"https://registry.npmjs.org/@bnguyensn/logger/-/logger-0.2.0.tgz","fileCount":10,"unpackedSize":8849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJduMgOCRA9TVsSAnZWagAAivMP/RfwmDgJ9LECg39Q+TAk\n4Lhn+bq3k4aDwf6exZhEnBXmfmlTyTQmJLQVS/8TAhBdGVh+Yn7U1Nxr+cnm\nxzprJx3Ff57FYC23HAO5UW9WMtHLkSpi4P9j3d1JpBN5rNReNZ+Cvq23HPlc\nUdBnkkaml11/N4re8lbN7uxept5FErX9ppwfmWhUk/3aqsiZUYOj2B+Q5sYw\nb+z+W8eWMux7csLOHq83EB2nHgy1nP974tvf0e0/DSft9F5TvbNJgSD1to6/\n8DURmjE5aPw72Ly/9ZJFrFKnMJF3HpUDtsU9XxD36mGG620uKW3iIC1BqJlY\n7eq50xCCsW2UkIro8BGY/2zTngXrFV5KX8N5AGrny0U+Aj2eLHxpOoEt/RrL\niGX/MridAA4zqV6V1WjqxvJgRL+KiT9C4/n7dc2/r6Gg1V56gYXGJi7q1ayM\nX3kImy86zoTC+4mS1ADGSuZ12U+mDlgSQykbeEYHNhlKbrkM1nBm2rPB/YMQ\nsXjBe5WA0EGC66ky4eA6KgLYd6slaJWabcC2TPTZ1VJBcVxskUgykNMk/0Qe\nquyp0JiEHYiSx6BIJRtSzOHiwZegF+d7cRIbKJDA7vuyyJ/I7vuXKaGUiq87\n3NmkLEb8XnpsloT45/4iYnrRRAO0Z9WV1uf/uJsiCvFCa4VZeOaMonM0VeHo\nw94I\r\n=2jq1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6oUfupyL1dmKk+v4JEk3Wh4yOHipHxl7mznERk8eHnwIgRr361aKVTNK/uXLHdlqoTIDTXTb7JXg1xruMsXhszts="}]},"maintainers":[{"name":"bnguyensn","email":"b.nguyen.sn@gmail.com"}],"_npmUser":{"name":"bnguyensn","email":"b.nguyen.sn@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/logger_0.2.0_1572390926180_0.2233580096268124"},"_hasShrinkwrap":false},"0.3.0":{"name":"@bnguyensn/logger","version":"0.3.0","description":"A basic logger","main":"index.js","author":{"name":"@bnguyensn"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bnguyensn/logger.git"},"private":false,"scripts":{"test":"node tests/index.js","lint":"eslint **/*.js","preversion":"yarn lint && yarn test","postversion":"git push origin master && git push --tags && npm publish"},"devDependencies":{"eslint":"^6.6.0","eslint-config-prettier":"^6.5.0","prettier":"^1.18.2"},"dependencies":{"chalk":"^2.4.2"},"gitHead":"d89d218a44602518964824e82b1218785eb9bf5b","bugs":{"url":"https://github.com/bnguyensn/logger/issues"},"homepage":"https://github.com/bnguyensn/logger#readme","_id":"@bnguyensn/logger@0.3.0","_nodeVersion":"12.13.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-W75bldqLCPrTJdLIf0hmnBj3Wo7ExQ2mu1Y3nM1KwxDoGLKukYvWEaECYuprXfGPWaXA8Nknjg/Rj8XOXjoHpQ==","shasum":"0e0962deae3a060ce14f6f5e712d014ca9a40e0f","tarball":"https://registry.npmjs.org/@bnguyensn/logger/-/logger-0.3.0.tgz","fileCount":10,"unpackedSize":8699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdwLQ4CRA9TVsSAnZWagAAYD8P/RB3iI6eY2gv6HWRFsY3\ncXkPw0/4b4jDarwewo4PKsT15JT+s6nsnyScWtP535OdqlaR8npAz1FieZnz\nf8WFxQlNmaTHqkPGzVCtHn55Rv8YU0L71PBOKOI6E0KFxKdrkX7l35DJtnCU\ncqBlt/PBAqVlC4ImPEYSvYhsBEh7OthgPKx2RliSlpwTFYHWKLeFdymA2eUi\n95QedBFukHFnAH53YsxFgdG47o2Fsh4PCG8yqzrb2hxtgaQA0c47s+pvEq7F\n19D3rfcAHUjoLg+x8kL4OS7CzNY8xNlgTHAKVoM08f2sMRqLDXbxfUq+5/H2\nFRxLekC2ufTn3ILG4kXxd4t2cDyJLOxoni8is0VSLLjIKu4/CPPAMtDOh/3S\nJomujohTT0Oe8aW7Fv1L98DxcSxGB//g4DphpkjE2WRT7nblLBXhBPzXchb2\npF9dncUVvqxCBKHsveIQ8En5rk6CIA6c7MalNeT8pnEDFYXtaRLZe1KpRRZr\nxF+TpMwoZMlNIVgY12oflRHeWuxuvABT1O7Gz703A7kMJ3SJy/pkpvckIeQ1\nYxL8Hnag7iqrcn9M6RThrv0Y7c2qBh+b181f7KQ/mieHvSjW7PaEBtH7rACi\n+1pUfX5efC5Gb6QIFJAHVGNYZoYvpXD6JDpunJQHR7zJ5pLzZ1r9X73FSy2X\nTrvr\r\n=5yEE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCi9iqG42jrU3tqMwvUgllU/9k7jQpepS3FHDdIFJqCMAIhAMiEgGvs8e6HEov1c7mV5YBXf0yXYtMrh3vC+7Bb1uuO"}]},"maintainers":[{"name":"bnguyensn","email":"b.nguyen.sn@gmail.com"}],"_npmUser":{"name":"bnguyensn","email":"b.nguyen.sn@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/logger_0.3.0_1572910135432_0.7674935143867156"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-28T22:29:57.697Z","0.1.0":"2019-10-28T22:29:58.034Z","modified":"2022-04-04T19:53:39.673Z","0.2.0":"2019-10-29T23:15:26.298Z","0.3.0":"2019-11-04T23:28:55.551Z"},"maintainers":[{"name":"bnguyensn","email":"b.nguyen.sn@gmail.com"}],"description":"A basic logger","homepage":"https://github.com/bnguyensn/logger#readme","repository":{"type":"git","url":"git+https://github.com/bnguyensn/logger.git"},"author":{"name":"@bnguyensn"},"bugs":{"url":"https://github.com/bnguyensn/logger/issues"},"license":"MIT","readme":"# Logger 📝\r\n\r\nProvides basic logging functionality. Built on top of the wonderful [chalk](https://github.com/chalk/chalk).\r\n\r\nOpinionated for my own usage.\r\n\r\n## Install\r\n\r\nUsing npm:\r\n```\r\n$ npm install -D @bnguyensn/logger\r\n```\r\n\r\nUsing yarn:\r\n```\r\n$ yarn add -D @bnguyensn/logger\r\n```\r\n\r\n## Usage\r\n\r\nBasic usage:\r\n\r\n```javascript\r\nconst logger = require('@bnguyensn/logger')();\r\n\r\nlogger.info('I am blue');\r\nlogger.success('I am green');\r\nlogger.warn('I am yellow');\r\nlogger.error('I am red');\r\n```\r\n\r\nWith a base prefix and timestamp:\r\n\r\n```javascript\r\nconst logger = require('@bnguyensn/logger')({ base: 'LOG', timestamp: true });\r\n\r\nlogger.info(\"I will have 'LOG' prepended and also have a timestamp\");\r\n```\r\n\r\n## API\r\n\r\n### `createLogger(config)`\r\n\r\nThis is the function exported by the module. You get this from calling\r\n`require('@bnguyensn/logger')`.\r\n\r\n`createLogger()`, when called, will return a [`Logger`](#Logger) instance.\r\n\r\nThe `config` object by default is `undefined`.\r\n\r\n#### `config`\r\n\r\n|Property|Type|Description|\r\n|:---:|:---:|---|\r\n|`base`|`string`|A string to be prepended to each logging message.\r\n|`timestamp`|`boolean`|If `true`, will add a timestamp to each logging message.\r\n|`timestampOptions`|`object`|See below.\r\n\r\n#### `timestampOptions`\r\n\r\nThis object describes how the timestamp for each logging message should look like. We use Node's `toLocaleDateString()` under the hood.\r\n\r\nProperty|Type|Description\r\n:---:|:---:|---\r\n`locale`|`string \\| undefined`|See [`toLocaleDateString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString)'s `locales` parameter. If `undefined`, will attempt to use the system's locale.\r\n`localeOptions`|`object`|See [`toLocaleDateString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString)'s `options` parameter.\r\n`custom`|`boolean`|If `true`, will ignore both the `locale` and `localeOptions` above and use a custom date format. If Node's `toLocaleDateString()` is not supported, we will fall back to this custom date format.\r\n\r\n### `Logger`\r\n\r\nAn instance of `Logger` is returned from calling [`createLogger()`](#createLoggerconfig).\r\n\r\nThis `Logger` instance can then be used to log stuff to the terminal.\r\n\r\nEach `Logger` has the following methods:\r\n\r\n|Method|Description|\r\n|:---:|---|\r\n|`info(msg)`|Log the provided `msg` in the color blue.\r\n|`infoEOL(msg)`|Log the provided `msg` in the color blue and append a new line at the end.\r\n|`success(msg)`|Log the provided `msg` in the color green.\r\n|`successEOL(msg)`|Log the provided `msg` in the color green and append a new line at the end.\r\n|`warn(msg)`|Log the provided `msg` in the color yellow.\r\n|`warnEOL(msg)`|Log the provided `msg` in the color yellow and append a new line at the end.\r\n|`error(msg)`|Log the provided `msg` in the color red.\r\n|`errorEOL(msg)`|Log the provided `msg` in the color red and append a new line at the end.\r\n","readmeFilename":"README.md"}