diff --git a/README.md b/README.md index 05a69bc..f366982 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,31 @@ # Loggaby -The simple and light logger for Node.js +> 📝 A minimal and simplistic logger with no bloat. +Loggaby aims to be a simple, minimalistic and lightweight logger that doesn't bring useless dependencies and extra unneeded features. +It has 1 goal and strives for it well: Posting nice looking logs to your terminal (or perhaps a custom transport?!? See [the example](#example)for details). + +Oh, it looks like this: ![](https://modeus.is-inside.me/V6nRi6i6.png) ## Install `npm i loggaby` ## Example ```js -const Loggaby = require("loggaby") -const logger = new Loggaby() +const Loggaby = require('loggaby'); +const TerminalTransport = new Loggaby.TerminalTransport(); +const logger = new Loggaby({ + transports: [TerminalTransport] // NOTE: This is provided by default. There is no reason + // to import TerminalTransport unless adding your own extra transports. + // For an implementation example of a Transport, see `lib/transports/TerminalTransport.js` +}); -logger.log("Hello World!") +logger.log('Hello World!'); ``` #### new Loggaby(options) The Loggaby constructor, which creates a `logger` instance. - `options` {Object} - - `logFunction` {Function} The function to use to log. (Default: `console.log`) - - `color` {Boolean} Whether to use ANSI color codes for color. (Default: `true`) + - `transports` {Object[]} (An array of objects or specifically [transport instances](lib/transports/)) What transports to log to. An example is provided above. (Default: `[TerminalTransport]`) - `debug` {Boolean} Whether to print debug messages. (Default: `true`) ## Levels diff --git a/package-lock.json b/package-lock.json index 50dfa85..4a143e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,19 @@ { "name": "loggaby", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { - "ansiplace": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansiplace/-/ansiplace-1.1.0.tgz", - "integrity": "sha512-gOol2nPjehv13hf3f6AdHW3JVJwCGJICpbc9luf9+pTXyqWaF4Q3VlcVHCgILuQPTst/ZPB8wG2j6D6JV7t6Gw==" + "@luvella/eslint-config": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@luvella/eslint-config/-/eslint-config-1.0.2.tgz", + "integrity": "sha512-VZ1AWAEHYBkev/jTVo4r1vSpv1O9gNALj5WzzNXiRiy+yMny2wI4vtvZfksYq71QpRCCLbvv9N3lNjNM8RBsqw==", + "dev": true + }, + "ansikit": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/ansikit/-/ansikit-1.1.4.tgz", + "integrity": "sha512-jrbr47N5irbSSSwDQRP8F5YpcChSXBOCocx/CvKHtXGRfVUZtV0z7mpdnPiLTs6iaYCFzYeod7LI+owfdQWaJg==" } } } diff --git a/package.json b/package.json index 72f8350..82e7541 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,30 @@ { "name": "loggaby", - "version": "1.0.1", - "description": "The simple and light logger for Node.js", - "main": "index.js", + "version": "2.0.0", + "description": "📝 A minimal and simplistic logger with no bloat.", + "main": "lib/index.js", "scripts": { "test": "node test.js" }, "repository": { "type": "git", - "url": "git+https://github.com/Terminalfreaks/Loggaby.git" + "url": "git+https://github.com/Luvella/Loggaby.git" }, "keywords": [ "logger", "log", "terminal" ], - "author": "Terminalfreaks", + "author": "Luvella", "license": "MIT", "bugs": { - "url": "https://github.com/Terminalfreaks/Loggaby/issues" + "url": "https://github.com/Luvella/Loggaby/issues" }, - "homepage": "https://github.com/Terminalfreaks/Loggaby#readme", + "homepage": "https://github.com/Luvella/Loggaby#readme", "dependencies": { - "ansiplace": "^1.1.0" + "ansikit": "^1.1.4" + }, + "devDependencies": { + "@luvella/eslint-config": "^1.0.2" } }