Registry / http-networking / hfs
library0.6.0jsnpmunverified

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.

npm install hfs
INSTALL
IMPORT
SIG · HFS
H
hfs
http-networkingjavascriptv0.6.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

start
import { start } from 'hfs'
const hfs = require('hfs'); hfs.start()
HFS v3 is ESM-only. CommonJS require() will fail. The start function is the primary entry point to launch the server programmatically.
Hfs
import { Hfs } from 'hfs'
import Hfs from 'hfs'
Hfs is a named export, not default. In v3, there is no default export.
Config
import { Config } from 'hfs'
const Config = require('hfs').Config
Config type/interface for programmatic configuration. Requires TypeScript or JSDoc type imports.

Programmatically start an HFS server with custom port, root directory, and admin password using the ESM import.

import { start } from 'hfs'; const config = { port: 8080, host: '0.0.0.0', root: './shared', admin: { password: process.env.HFS_ADMIN_PASSWORD ?? 'temp123' } }; const server = await start(config); console.log('HFS server running on http://localhost:' + config.port); // To stop: await server.close();
hfs --version
Debug
Known issues
breakingHFS v3 requires Node.js >= 18.15.0
fix
Update Node.js to version 18.15.0 or later, or use HFS v2.x which supports older Node versions.
affects: >=3.0.0
breakingHFS v3 is ESM-only; CommonJS require() will throw an error
fix
Use ESM imports (import { start } from 'hfs') or switch to dynamic import() inside CommonJS modules.
affects: >=3.0.0
deprecatedThe 'vfs' option in config is deprecated in favor of 'virtualFileSystem'
fix
Replace 'vfs' with 'virtualFileSystem' in the config object.
affects: >=3.1.0
gotchaAdmin panel does not require a password for localhost by default (localhost_admin defaults to true)
fix
Run 'config localhost_admin false' in the console or set 'localhostAdmin: false' in config to require authentication from localhost.
affects: <3.1.0
gotchaWindows antivirus may flag the HFS binary as a false positive
fix
Add exception for the HFS binary in your antivirus, or verify the checksum from GitHub releases.
affects: >=3.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/hfs/index.js from /path/to/your/file.js not supported
Using CommonJS require() on an ESM-only package (HFS v3)
fix
Change your file extension to .mjs or use dynamic import(): const { start } = await import('hfs')
TypeError: hfs.start is not a function
Incorrect import: used default import (import hfs from 'hfs') but start is a named export
fix
Use named import: import { start } from 'hfs'
Error: listen EADDRINUSE :::8080
Port 8080 is already in use by another process
fix
Either kill the process using port 8080, or specify a different port in config (e.g., port: 3000)
Upgrade
Version history
0.6.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
hfs — npm install hfs · libregistry