{"id":25599285,"url":"https://github.com/kaysting/cyberfiles-lite","last_synced_at":"2026-04-22T15:30:19.857Z","repository":{"id":64209048,"uuid":"573796743","full_name":"CyberGen49/cyberfiles-lite","owner":"CyberGen49","description":"A (not-so) bare-bones file index built to work with Node.js Express and look like GitHub's file browser.","archived":false,"fork":false,"pushed_at":"2023-09-21T02:46:10.000Z","size":842,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-14T00:05:36.603Z","etag":null,"topics":["express","file","github","highlight","images","index","markdown","nodejs","preview","syntax","video"],"latest_commit_sha":null,"homepage":"","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/CyberGen49.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":"2022-12-03T13:14:26.000Z","updated_at":"2024-11-28T11:36:29.000Z","dependencies_parsed_at":"2024-10-29T17:28:39.151Z","dependency_job_id":null,"html_url":"https://github.com/CyberGen49/cyberfiles-lite","commit_stats":{"total_commits":114,"total_committers":1,"mean_commits":114.0,"dds":0.0,"last_synced_commit":"a03b549cdde9aafc8bcb838ddb20fd26a6527eb2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberGen49%2Fcyberfiles-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberGen49%2Fcyberfiles-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberGen49%2Fcyberfiles-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberGen49%2Fcyberfiles-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CyberGen49","download_url":"https://codeload.github.com/CyberGen49/cyberfiles-lite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240031983,"owners_count":19737046,"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":["express","file","github","highlight","images","index","markdown","nodejs","preview","syntax","video"],"created_at":"2025-02-21T14:33:27.260Z","updated_at":"2026-04-22T15:30:19.808Z","avatar_url":"https://github.com/CyberGen49.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# CyberFiles Lite\nA (not-so) bare-bones file index built to work with Node.js Express and look like GitHub's file browser.\n\n![CyberFiles Light promotional image](/promo.png)\n\n## Features\n* Easy and portable setup\n* A minimalistic, modern, and responsive design\n* Customizable themes with several built-in options\n* Choose the root of your file index\n* Use RegEx to hide (and prevent access to) certain files and directories\n* Serve directory index files (like `index.html`) automatically\n* Render a directory's README.md file below the file list\n    * The contents of the README are also shown in that directory's link preview when sent on platforms like Discord\n* View text files, images, videos, and audio files without leaving your browser\n    * Text files of [certain formats](/prism-lang-exts.json) are syntax-highlighted\n    * Videos and audio files use embedded players provided by [@CyberGen49/web-resources](https://github.com/CyberGen49/web-resources) (undocumented)\n* Use the automatically-generated table of contents button to quickly jump to headings in markdown files\n* Conveniently move between files in the file viewer using the next/previous arrows\n* Change the sort order of a directory\n* Filter files in a directory just by pressing Ctrl + F\n* View the file extension breakdown of a directory in the **File info** pane\n* Quickly download whole directories as zip files\n* See image previews before clicking with thumbnails\n* Get a better look at your files with tile view\n    * Directories where more than 50% of the contents have thumbnails will use tile view automatically (see [auto_view](#boolean-auto_view) and [auto_view_threshold](#number-auto_view_threshold))\n* Add to your existing [ExpressJS](https://github.com/expressjs/express) projects\n\n## Running CyberFiles Lite standalone\nIf your main goal is to get a simple file index up and running, a standalone CyberFiles Lite installation is the way to go!\n\n### Preparation\nFirst, install [git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/en/download/) (tested and working on `v18.12.1`).\n\nNext, create or choose a directory where the files you want to serve are stored. Open your terminal, and `cd` into it:\n\n```bash\ncd /path/to/my/files\n```\n\n### Installation\n\nNow, we'll download CyberFiles Lite. The easiest way to do this is to clone the repository. This will place all of the code into a new folder.\n\n```bash\ngit clone https://github.com/CyberGen49/cyberfiles-lite.git\n```\n\nOnce git has finished cloning the repo, we'll rename the folder, adding an underscore at the beginning. This will hide the folder by default on the website, preventing users from entering it. After renaming, we'll `cd` into it.\n\n```bash\nmv ./cyberfiles-lite ./_cyberfiles\ncd ./_cyberfiles\n```\n\nNext, we'll install all of CyberFiles Lite's dependencies from `npm`:\n\n```bash\nnpm i\n```\n\nWith everything set up, we can make sure it all works by starting the server:\n\n```bash\nnpm start\n```\n\nAt this point, assuming no errors occurred during any of the previous steps, you should be able to view your files by visiting http://localhost:8080.\n\n### Configuration\n\nFrom this point, you can edit `server-config.yml` to change various settings for the server and CyberFiles Lite. The server configuration file is split into two sections:\n\n```json\n{\n    \"cyberfiles\": {\n        \"...\": \"...\"\n    },\n    \"server\": {\n        \"...\": \"...\"\n    }\n}\n```\n\nThe `cyberfiles` section contains options for CyberFiles Lite itself. Descriptions of these options can be found [below](#options).\n\nThe `server` section contains options specific to the standalone server:\n\n#### Number `port`\nThe port on which to host the server. Note that ports below 1000 may require root/administrator permissions.\n\nDefault: `8080`\n\n#### String `ip_header`\nThe HTTP header containing the client's IP address, used only for logging to the console.\n\nDefault: `req.socket.remoteAddress`\n\n**Don't forget to restart your server after changing any of these settings.**\n\n## Adding CyberFiles Lite to an existing project\nIf you have an existing ExpressJS project, you can add CyberFiles lite to it so your users can see directory listings on pages that don't have index files. \n\n### Installation\nStart by installing the package with `npm`:\n\n```bash\nnpm i cyberfiles-lite\n```\n\nThen, require it in your project:\n\n```js\nconst cyberfiles = require('cyberfiles-lite');\n```\n\nThe module exports a single, default function. This function only takes an optional `opts` parameter, which is an object containing any number of the options listed [below](#options), and returns an Express request handler.\n\n### Setup\nAdd CyberFiles Lite as an Express middleware by `use`ing it:\n\n```js\n// Where express is initialized and set to `srv`\nsrv.use(cyberfiles());\n```\n\nWithout any options, the root of the file index will be set to the current directory (see the [root](#string-root) option). CyberFiles will serve static file URLs as expected, so additional handlers (like `express.static()`) aren't necessary, assuming the files aren't hidden by one of your configured [hide_patterns](#string-or-regexp-hide_patterns).\n\nBy default, CyberFiles will respond with a directory's `index.html` file if it exists (see the [index_files](#string-index_files) option).\n\n### Example\nThis is about the simplest your server needs to be to get things working:\n\n```js\nconst express = require('express');\nconst cyberfiles = require('cyberfiles-lite');\n\nconst port = 8080;\nconst srv = express();\nsrv.use(cyberfiles());\nsrv.listen(port, () =\u003e console.log(`Listening on port ${port}`));\n```\n\n## Options\nThese are all the configuration options for CyberFiles Lite.\n\n### string `root`\nA directory path to serve as the root of your file index.\n\nDefaults to the directory of the parent module.\n\nRelative paths are relative to the directory of the parent module.\n\n### string `data_dir`\nA separate directory where thumbnails should be stored to prevent them from being deleted when updating. A `thumbs` directory will be created inside this directory.\n\nDefaults to where `cyberfiles-lite` is installed.\n\nRelative paths are relative to `cyberfiles-lite`'s installation directory.\n\n### string `site_name`\nThe name of this file index, used in various places around the site.\n\nDefaults to `\"CyberFiles Lite\"`.\n\n### string `icon`\nA URL to use as the tab icon for the file index.\n\nDefaults to one of the built-in themed icons: `?asset=icons/icon-\u003ctheme\u003e.svg`\n\n### string `theme`\nA theme to use for the file index. This value must be the same as one of the keys in `themes.json`.\n\nDefaults to `\"darkmuted\"`.\n\n### string[] `index_files`\nAn array of file names to checked for and sent when a directory is accessed. If one of these files exist in a directory, they'll be sent instead of the file index.\n\nDefaults to `[ \"index.html\" ]`.\n\n### string[] `hide_patterns`\nAn array of RegEx strings to be checked against the absolute file/directory path of each request. If the pattern matches, the file/directory will be hidden from view.\n\nDefaults to `[ /\\/(\\.|_).*?(\\/|$)/ ]`, which will hide all files and directories whose paths contain a node/segment starting with `.` or `_`.\n\nWhen storing these options in JSON, be sure to escape backslashes when escaping other characters.\n\n### boolean `handle_404`\nIf `true`, CyberFiles Lite will handle requests for nonexistent paths (error 404s) and show the user an error page. If `false`, `next()` will be called, passing control to the next middleware.\n\nDefaults to `false`.\n\n### boolean `get_dir_sizes`\nIf `true`, the index will recurse through directories to get and display their total sizes. This will impact performance with lots of files.\n\nDefaults to `false`.\n\n### boolean `make_thumbs`\nIf `true`, thumbnails to show in the index will be generated for image and video files. `ffmpeg` needs to be installed for video thumbnail generation.\n\nDefaults to `false`.\n\n### boolean `auto_view`\nIf this and `make_thumbs` are `true`, and if more than 50% (or the value of `auto_view_threshold`) of the files in a directory have thumbnails, the directory will automatically be switched to `tiles` view.\n\nDefaults to `true`.\n\n### number `auto_view_threshold`\nA float between 0 and 1, representing the percentage of files in a directory that need to have thumbnails for the directory to be switched to `tiles` view.\n\nDefaults to `0.5`.\n\n### boolean `show_path_subfolders`\nIf `true`, you'll be able to view the subfolders of a directory when you right-click on it in the path bar. This might affect performance in large directories.\n\nDefaults to `true`.\n\n### boolean `debug`\nIf `true`, debug messages will be logged to the console.\n\nDefaults to `false`.\n\n## Other projects that make this one possible\nCyberFiles Lite wouldn't be here without these amazing projects:\n* [Express](https://github.com/expressjs/express)\n* [EJS](https://ejs.co/)\n* [Marked](https://marked.js.org/)\n* [Day.js](https://day.js.org/)\n* [Prism](https://prismjs.com/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaysting%2Fcyberfiles-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaysting%2Fcyberfiles-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaysting%2Fcyberfiles-lite/lists"}