{"id":22282894,"url":"https://github.com/leslitech/lesli-js","last_synced_at":"2025-10-26T02:43:49.087Z","repository":{"id":45331738,"uuid":"418734487","full_name":"LesliTech/lesli-js","owner":"LesliTech","description":"JavaScript utilities for JavaScript applications","archived":false,"fork":false,"pushed_at":"2022-04-20T14:05:01.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-30T17:38:34.111Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LesliTech.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":"2021-10-19T01:59:00.000Z","updated_at":"2023-12-13T03:13:29.000Z","dependencies_parsed_at":"2022-08-28T01:51:43.128Z","dependency_job_id":null,"html_url":"https://github.com/LesliTech/lesli-js","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/LesliTech%2Flesli-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LesliTech%2Flesli-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LesliTech%2Flesli-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LesliTech%2Flesli-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LesliTech","download_url":"https://codeload.github.com/LesliTech/lesli-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245534673,"owners_count":20631288,"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":[],"created_at":"2024-12-03T16:37:01.893Z","updated_at":"2025-10-26T02:43:44.056Z","avatar_url":"https://github.com/LesliTech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://www.lesli.tech\" target=\"_blank\"\u003e\n\t\t\u003cimg width=\"175\" alt=\"LesliTech logo\" src=\"./docs/lesli-js-logo.svg\" /\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003eJavaScript utilities for JavaScript applications\u003c/h3\u003e\n\n\u003chr/\u003e\n\nVersion 0.5.0 :octocat:    \n\n## Table of Contents\n- [Application Structure](#application-structure)\n- [Installation](#installation)\n- [Get Started](#get-started)\n- [Usage](#usage)\n     - [LesliJS Debug](#leslijs-debug)\n          - [Debug for NodeJS](#debug-for-nodejs)\n          - [Debug for Browsers](#debug-for-browsers)\n     - [LesliJS Color](#leslijs-color)\n          - [Palette](#palette)\n          - [Graph](#graph)\n- [License](#license)\n\n### Application Structure\n--------\n```text\nlesli-js  \n└── src/  \n     ├── debug/  \n     │    ├── browser.js  \n     │    ├── nodejs.js  \n     │    ├── utils.js  \n     │    └── index.js  \n     └── colors/  \n          ├── palette.js  \n          ├── graphs.js  \n          └── index.js  \n\n```\n\n\n### Installation\n\nLesliJS is available in the Node Package Manager, so, you can install it through [npm](https://www.npmjs.com/package/lesli-js).\n\n--------\n\n```console\nnpm install lesli-js --save\n```\n\n\n### Get Started\n\nFirst of all, you have to require the library in your JavaScript project. There are many ways to do this, it depends in the ECMAScript version your are using.\n\n--------\n\n_ECMAScript 5_\n\n```js\n// Import LesliJS\nconst LesliJS = require(\"lesli-js\")\n```   \n\n_ECMAScript 6_   \n\n```js\nimport LesliJS from \"lesli-js\"\n```\n\n### Usage\nLesliJS provides a bundle of features that are useful for JavaScript applications, either for Fronted or Backend.\nThese features are related with debugging and the color management of your app. Use them as you need.\n\n--------\n\n#### LesliJS Debug\nYou can use LesliJS debug in the way for printing messages in your terminal. Those messages have been customized according with type of message, `log`, `info`, `error`, `fatal`... The main difference is in the color that are printed.   \n\n--------\n\n#### Debug for Node.js\n\nSee the following example of a simple message.\n\n```js\n// Import LesliJS debug directly\nconst { debug } = require(\"lesli-js\")\n\n// This is a simple message using LesliJS debug\ndebug.nodejs.log(\"Simple Message\", \"cheese\")\n\n```\n\n```debug.nodejs.```\u003c**type_of_message**\u003e```(message: string, module?: string)```\n\nThe output should look like this.\n\n```console\n[12/17 17:47] [LOG] (cheese) - Simple message\n```\n\nAll the available debug messages in LesliJS debug have the following structure.\n\n```[``` **datetime** ```]``` ```[``` **type of message** ```]``` ```(```**module**```)``` ```-``` ```your message```\n\n- _datetime_ is generated by LesliJS debug.\n- _type of message_ method is declared when the user logs a new message (debug.nodejs.`log`, debug.nodejs.`error`, ...).\n- _module_ is optional, if you don't declare it, won't appear in the terminal, on the contrary you have to give a string.\n- _your message_ is required when the user logs a new message and we recommend to give a string.\n\n\n--------   \n\n**See all types of messages available.**    \n\n\n```js\nconst { debug } = require(\"lesli-js\")\n\n\n// print pretty yet useful debug messages\ndebug.nodejs.log(\"Simple message\")\ndebug.nodejs.msg(\"Standard message\")\ndebug.nodejs.info(\"Informative message\")\ndebug.nodejs.warn(\"Warning message\")\ndebug.nodejs.error(\"Error message\")\ndebug.nodejs.fatal(\"Fatal error message\")\n```\n\nThe output should look like this.\n\n![image](https://user-images.githubusercontent.com/62123356/146724702-42f19da9-8cbc-49f6-9a74-9da6c5cf677c.png)\n\n--------\n\n```js\nconst { debug } = require(\"lesli-js\")\n\ndebug.hr() // just a separator line\n```\n\nOutput.\n\n```console\n-·-     -·-     -·-     -·-     -·-     -·-     -·-     -·-     -·-     -·-\n```\n\n--------\n\nIf you just want to build the message structure, use the method `build`, which one returns a string.\n\n```js\nconst { debug } = require(\"lesli-js\")\n\nconst message = debug.nodejs.build(\"Message\", \"Module\", \"Level\")\n\nconsole.log(message)\n```\n\nOutput.\n\n```console\n[12/17 18:46] [LEVEL] (Module) - Message\n```\n\n--------\n\n```js\n// make Lesli debug messages globally in your app\nwindow.debug = leslijs.debug\n\nconsole.debug.log(\"Simple message\")\nconsole.debug.msg(\"Standard message\")\nconsole.debug.info(\"Informative message\")\nconsole.debug.warn(\"Warning message\")\nconsole.debug.error(\"Error message\")\nconsole.debug.fatal(\"Fatal error message\")\n```    \n\n\n#### Debug for Browsers\nLesliJS Debug Browser also offers pretty nice console messages for browsers, which ones are the same methods as the ones of [Debug for nodejs](#debug-for-nodejs), `log`, `info`, `error`, `fatal`... but with the main difference that are useful for Fronted web applications.   \n\n--------\n\nSee the following examples.\n\n```js\n\nimport { debug } from \"lesli-js\"\n\ndebug.browser.log(\"Standard message\", \"Module\") // Standard log message\ndebug.browser.msg(\"Simple message\", \"Module\") // Simple message\ndebug.browser.info(\"Informative message\", \"Module\") // Informative message\ndebug.browser.warn(\"Warning message\", \"Module\") // Warning message\ndebug.browser.error(\"Error message\", \"Module\") // Error message\ndebug.browser.fatal(\"Fatal message\", \"Module\") // Fatal message\n```\n\nThe output in the browser console should look like this.   \n\n![image](https://user-images.githubusercontent.com/62123356/146725103-8082abc7-e1e0-41ef-8074-c30009e4e7c1.png)\n\n\nThese methods have the same structure as the ones of [Debug for nodejs](#debug-for-nodejs).     \n\n```debug.browser.```\u003c**type_of_message**\u003e```(message: string, module?: string)```\n\nThe message shown in the browser console.\n\n```[``` **datetime** ```]``` ```[``` **type of message** ```]``` ```(```**module**```)``` ```-``` ```your message```\n\n- _datetime_ is generated by LesliJS debug.\n- _type of message_ method is declared when the user logs a new message (debug.nodejs.`log`, debug.nodejs.`error`, ...).\n- _module_ is optional, if you don't declare it, won't appear in the terminal, on the contrary you have to give a string.\n- _your message_ is required when the user logs a new message and we recommend to give a string.\n\n\n--------\n\nLesliJS Debug Browser also has another method called `message`, which logs a dedicated message and receives the params `title`, `message`, `more_information`, where the only one required is the `more_information` param.\n\nSee the following example.\n\n```js\nimport { debug } from \"lesli-js\"\n\n\ndebug.browser.message(\"Title\", [\"Messages1\", \"Message2\"], \"More information\")\n```\n\nThe output in the browser console should look like this.\n\n![image](https://user-images.githubusercontent.com/62123356/146725207-94ba5029-62b4-43f4-b3f2-844f7cd3e31f.png)\n\n\nMethod specification.   \n\n```debug.browser.message(title: string, messages: array or a simple string, more_information?: string)```\n\n\n\n\n\n#### LesliJS Color\nProvides colors (as string or JSON) based on the Lesli color palette, which ones are in hex code format.\n\n\n--------\n\n#### Palette\nThe LesliJS Color Palette has several methods to serve colors depending on the one you are interested in.\n\nSee the following examples.\n\n\n```js\nimport { color } from \"lesli-js\"\n\n\n// Work with the entire color palette as JSON\ncolor.pallete\n\n// Get palette of a specific color as JSON\ncolor.pallete.blue\n\n// Get standard colors (returns a string with hex code format)\n// By default the variant used is 500 in all colors\ncolor.blue()\n\n// Get color with a specific variant\n// Returns a string with hex code format\ncolor.blue(500)\n\n// Or you can get the color directly from the palette\n// Returns a string with hex code format\ncolor.palette.blue['500']\n\n```\n\nAll available colors.    \n\n| Colors |\n| ----- |\n| bubble |\n| grape |\n| lime |\n| orange |\n| berry |\n| cocoa |\n| banana |\n| slate |\n| mint |\n| black |\n| silver |\n| solid |\n\nAll available variant of colors.    \n\n| Variants |\n| -------- |\n| 100 |\n| 300 |\n| 500 |\n| 700 |\n| 900 |     \n\n\n\n\n#### Graph\nThe LesliJS Color Graph provides the graph of a color palette given, and returns an array with all colors.\n\n\n--------\n\nSee the following examples.\n\n```js\nimport { color } from \"lesli-js\"\n\n// Get the graph of the blue color\n// Returns an array with colors in hex code format\ncolor.graph(\"blue\")\n```\n\nAll available graphs.\n\n| Graphs |\n| ------ |\n| blue |      \n\n\n\n\n\n\n\n### License  \n------\nSoftware developed in [Guatemala](http://visitguatemala.com/) distributed under the *General Public License v 3.0* you can read the full license [here](http://www.gnu.org/licenses/gpl-3.0.html)\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://www.lesli.tech\" target=\"_blank\"\u003e\n\t\t\u003cimg alt=\"LesliTech logo\" width=\"150\" src=\"https://cdn.lesli.tech/leslitech/brand/leslitech-logo.svg\" /\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleslitech%2Flesli-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleslitech%2Flesli-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleslitech%2Flesli-js/lists"}