{"id":18416,"library":"hfs","title":"HFS: HTTP File Server","description":"HFS (HTTP File Server) is a file-sharing server that turns your computer into a file-sharing hub with unlimited space and bandwidth. Current stable version is 3.1.1 (December 2024), with active development and frequent releases (multiple minor versions per year). Key differentiators include a virtual file system, instant ZIP downloads for large folders, real-time activity monitoring, bandwidth throttling, and a plugin system. It supports HTTPS, WebDAV (since 3.1.0), IPv6, and runs on Windows, Linux, macOS, FreeBSD, and Android. Compared to alternatives like FileZilla or Samba, HFS is lightweight, zero-configuration, and designed for temporary or permanent file sharing over HTTP/HTTPS with a web-based admin interface. It requires Node.js >=18.15.0 and is available as a binary or via npx.","status":"active","version":"3.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/rejetto/hfs","tags":["javascript","file server","http server"],"install":[{"cmd":"npm install hfs","lang":"bash","label":"npm"},{"cmd":"yarn add hfs","lang":"bash","label":"yarn"},{"cmd":"pnpm add hfs","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"HFS v3 is ESM-only. CommonJS require() will fail. The start function is the primary entry point to launch the server programmatically.","wrong":"const hfs = require('hfs'); hfs.start()","symbol":"start","correct":"import { start } from 'hfs'"},{"note":"Hfs is a named export, not default. In v3, there is no default export.","wrong":"import Hfs from 'hfs'","symbol":"Hfs","correct":"import { Hfs } from 'hfs'"},{"note":"Config type/interface for programmatic configuration. Requires TypeScript or JSDoc type imports.","wrong":"const Config = require('hfs').Config","symbol":"Config","correct":"import { Config } from 'hfs'"}],"quickstart":{"code":"import { start } from 'hfs';\n\nconst config = {\n  port: 8080,\n  host: '0.0.0.0',\n  root: './shared',\n  admin: {\n    password: process.env.HFS_ADMIN_PASSWORD ?? 'temp123'\n  }\n};\n\nconst server = await start(config);\nconsole.log('HFS server running on http://localhost:' + config.port);\n\n// To stop: await server.close();","lang":"javascript","description":"Programmatically start an HFS server with custom port, root directory, and admin password using the ESM import."},"warnings":[{"fix":"Update Node.js to version 18.15.0 or later, or use HFS v2.x which supports older Node versions.","message":"HFS v3 requires Node.js >= 18.15.0","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use ESM imports (import { start } from 'hfs') or switch to dynamic import() inside CommonJS modules.","message":"HFS v3 is ESM-only; CommonJS require() will throw an error","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Replace 'vfs' with 'virtualFileSystem' in the config object.","message":"The 'vfs' option in config is deprecated in favor of 'virtualFileSystem'","severity":"deprecated","affected_versions":">=3.1.0"},{"fix":"Run 'config localhost_admin false' in the console or set 'localhostAdmin: false' in config to require authentication from localhost.","message":"Admin panel does not require a password for localhost by default (localhost_admin defaults to true)","severity":"gotcha","affected_versions":"<3.1.0"},{"fix":"Add exception for the HFS binary in your antivirus, or verify the checksum from GitHub releases.","message":"Windows antivirus may flag the HFS binary as a false positive","severity":"gotcha","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'18.15.0':121 '2024':36 '3.1.0':77 '3.1.1':34 'activ':38,64 'admin':116 'altern':90 'android':87 'avail':124 'bandwidth':29,66 'base':115 'binari':127 'compar':88 'comput':18 'configur':100 'current':30 'decemb':35 'design':102 'develop':39 'differenti':49 'download':57 'file':3,7,12,22,53,107,132 'file-shar':11,21 'filezilla':92 'folder':60 'freebsd':85 'frequent':41 'hfs':1,5,95 'http':2,6,134 'http/https':110 'https':74 'hub':24 'includ':50 'instant':55 'interfac':117 'ipv6':78 'javascript':131 'key':48 'larg':59 'lightweight':97 'like':91 'linux':83 'maco':84 'minor':44 'monitor':65 'multipl':43 'node.js':120 'npx':130 'per':46 'perman':106 'plugin':70 'real':62 'real-tim':61 'releas':42 'requir':119 'run':80 'samba':94 'server':4,8,14,133,135 'share':13,23,108 'sinc':76 'space':27 'stabl':31 'support':73 'system':54,71 'temporari':104 'throttl':67 'time':63 'turn':16 'unlimit':26 'version':32,45 'via':129 'virtual':52 'web':114 'web-bas':113 'webdav':75 'window':82 'year':47 'zero':99 'zero-configur':98 'zip':56","created_at":"2026-04-25T07:38:07.389332+00:00","updated_at":"2026-04-25T07:38:07.389332+00:00","problems":[{"fix":"Change your file extension to .mjs or use dynamic import(): const { start } = await import('hfs')","cause":"Using CommonJS require() on an ESM-only package (HFS v3)","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/hfs/index.js from /path/to/your/file.js not supported"},{"fix":"Use named import: import { start } from 'hfs'","cause":"Incorrect import: used default import (import hfs from 'hfs') but start is a named export","error":"TypeError: hfs.start is not a function"},{"fix":"Either kill the process using port 8080, or specify a different port in config (e.g., port: 3000)","cause":"Port 8080 is already in use by another process","error":"Error: listen EADDRINUSE :::8080"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.6.0","cli_name":"hfs","cli_version":null,"type":"library","homepage":"https://rejetto.com/hfs/","github":"https://github.com/rejetto/hfs","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/hfs","openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}