{"id":17361197,"url":"https://github.com/richardeschloss/les","last_synced_at":"2025-08-19T20:11:13.951Z","repository":{"id":52913254,"uuid":"220712240","full_name":"richardeschloss/les","owner":"richardeschloss","description":"Lightweight Express-ish (Koa) Server - Type les not More!","archived":false,"fork":false,"pushed_at":"2021-04-14T06:29:32.000Z","size":938,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-24T18:50:31.884Z","etag":null,"topics":["cli","expressjs","koa","koajs","les","workspace"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/richardeschloss.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-11-09T22:34:17.000Z","updated_at":"2024-12-19T15:38:28.000Z","dependencies_parsed_at":"2022-08-23T22:30:54.643Z","dependency_job_id":null,"html_url":"https://github.com/richardeschloss/les","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/richardeschloss/les","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardeschloss%2Fles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardeschloss%2Fles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardeschloss%2Fles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardeschloss%2Fles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richardeschloss","download_url":"https://codeload.github.com/richardeschloss/les/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardeschloss%2Fles/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271215036,"owners_count":24720097,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","expressjs","koa","koajs","les","workspace"],"created_at":"2024-10-15T19:31:48.863Z","updated_at":"2025-08-19T20:11:13.911Z","avatar_url":"https://github.com/richardeschloss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/lesky)](https://www.npmjs.com/package/lesky)\n[![npm](https://img.shields.io/npm/dt/lesky)](https://www.npmjs.com/package/lesky)\n[![](https://gitlab.com/richardeschloss/les/badges/master/pipeline.svg)](https://gitlab.com/richardeschloss/les)\n[![](https://gitlab.com/richardeschloss/les/badges/master/coverage.svg)](https://gitlab.com/richardeschloss/les)\n[![NPM](https://img.shields.io/npm/l/lesky)](https://github.com/richardeschloss/les/blob/development/LICENSE)\n\n# Lightweight Express-ish (Koa) Server -- Type `les` not more!\n\nSuper configurable, easy-to-use lightweight Koa Server that lets you\n1. Statically serve any directory with `les` (not more). \n\n--\u003e If the directory contains a `.lesrc` config file, it will be used (FYI, the \"rc\" suffix stands for \"run commands\", a typical convention in Linux)\n\n--\u003e If CLI args are provided, those will be used\n\n--\u003e If both .lesrc and CLI args are provided, both will be used, but the CLI args will get priority. \n\n2. Init a Koa application in any directory with `les --init` (EASY)\n\n--\u003e The actual `server.js` boilerplate is kept separate from `app.js`, so you can focus more on your app and less on boilerplate! \n\n\n## Installation\n\n\u003e npm i -g lesky\n\n(I wanted les, but it was taken. No worries though...the \"k\" in the name makes it a little more accurate)\n(Global installation is recommended...install only once)\n\n## Usage\n\nMake sure the \"les\" binary is discoverable. I.e., your PATH env var should be set up to include `~/.npm-global/bin`:\n\n\u003e export PATH=~/.npm-global/bin:\\$PATH\n\nThen, from any folder launching a static server is simply:\n\n\u003e les\n\nWant to start it with even less pain (i.e., less \"ouch\"?)\n\n\u003e les -ow\n\nIf there is a default \"public\" folder in your current working directory, that will be served. The default server can be accessed at: http://localhost:8080\n\nWant to use lesky in YOUR native language? Now you can! (If the language set is in [locales](https://github.com/richardeschloss/les/tree/master/locales) folder, you can use it!). If your *system's language* includes the two-letter language code it will be used; most systems should have the env var \"LANG\" set. If LANG is not set, simply set it two the language you want to use:\n\n\u003e LANG=\"es\" les \n\nThis will respect options in Spanish and display console messages back in that language.\n\n## Customizing (CLI)\n\nThe latest CLI options can always be found in the help menu:\n\n\u003e les --help\n\n```\nusage: les [path] [options]\n\noptions:\n\t-h,\t--help\tPrint this help menu\n\t-i,\t--init\tInit lesky in workspace specified by path, defaults to cwd [[cwd]]\n\t-a,\t--host\tAddress to use [localhost]\n\t-p,\t--port\tPort to use [8080]\n\t\t--proto\tProtocol to use [http] ({ http, https, http2 })\n\t\t--range\tPort Range (in case port is taken) [8000,9000]\n\t\t--sslKey\tPath to SSL Key\n\t\t--sslCert\tPath to SSL Certificate\n\t-o,\t--open\tOpen browser [OS default]\n\t-w,\t--watch\tWatch for file changes in dir [staticDir]\n\n---End of Help---\n\n```\n\n\u003e LANG=\"es\" les --ayuda\n```\nel uso de: les [path] [options]\n\noptions:\n\t-h,\t--ayuda\tImprime este menú de ayuda\n\t-i,\t--init\tInit lesky en el espacio de trabajo especificado por la ruta por defecto cwd [[cwd]]\n\t-a,\t--host\tDirección [localhost]\n\t-p,\t--puerto\tEl puerto a utilizar [8080]\n\t\t--proto\tProtocolo para el uso de [http] ({ http, https, http2 })\n\t\t--range\tRango de puertos (en caso de que el puerto se toma). Formato de inicio-final [8000,9000]\n\t\t--sslKey\tRuta de acceso de la Clave SSL\n\t\t--sslCert\tRuta de acceso a los Certificados SSL\n\t-o,\t--abierto\tAbra el navegador. [OS default]\n\t-w,\t--reloj\tReloj para los cambios de los archivos en el directorio [staticDir]\n\n---Fin de Ayudar a---\n```\n\n\n## Customizing (.lesrc config file)\n\nIf a `.lesrc` config file is in the current working directory, it will be consumed. If CLI args are _also_ provided, those will override the entry in .lesrc that matches protocol used by the CLI. The config file is simply a JSON file, specifying an array of configurations to use. If a desired port is already taken, an attempt will be made to find a free port.\n\nExample `.lesrc` file:\n\n```\n[{\n  \"host\": \"localhost\",\n  \"proto\": \"http2\",\n\t\"port\": 8000,\n  \"sslKey\": \".ssl/server.key\",\n  \"sslCert\": \".ssl/server.crt\"\n},{\n  \"proto\": \"https\",\n  \"portRange\": [8000, 9000]\n}]\n```\n\nIf using a language different from English, you can *your* language for the options in the file. So \"port\" could be written as \"puerto\" if Spanish is being. English will always be the fallback.\n\n## Initializing a workspace to be a lesky app\n\nIf it is desired to initialize the current workspace as a lesky app, it's accomplished by:\n\n\u003e les [path] --init [options]\n\nWhere path defaults to the current working directory if not specified. The options passed in are the same as those passed to the CLI above. The only difference is that these options will be used to initialize the `.lesrc` config file that gets copied over, so that when you start the app, it will use your provided settings. \n\nSpecifically, running this command will initialize a `package.json` file in your workspace with useful scripts and dependencies (such as Koa). Then it will copy over several sample files, including `server.js` and `app.js` which will be the entry point. It will also automatically install the dependencies. \n\nProtections in place: if `package.json` or `.lesrc` already exist in the destination folder, they will not be overwritten.\n\nWhen initialization is done, the following should work:\n\n\u003e npm start \n\n\u003e npm run dev \n\n## TODO Items and Notes\n\n- I think some utils can still be transferred over to `les-utils`, where they'd be more reusable.\n\n- The `les.js` file has the i18n support while the others don't. I may want to carry over the translations to the other files, but I would like to do so gracefully. If someone runs `les --init` in a new workspace, it would have to copy over the preferred language set (I'll revisit someday)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichardeschloss%2Fles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichardeschloss%2Fles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichardeschloss%2Fles/lists"}