{"id":22409,"library":"static-cling","title":"Static Cling","description":"A minimal static file server for Node.js, version 2.0.3, providing both a command-line interface and programmatic usage. It serves files from a directory with optional custom port, root path, and default filename. Last updated in 2019, it has low maintenance cadence. Differentiators: extremely simple setup with no dependencies (pure Node.js http module), suitable for quick local development or demonstrations. Alternatives like http-server or serve offer more features and active maintenance.","status":"maintenance","version":"2.0.3","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/Kevnz/Static-Cling","tags":["javascript","webserver","fileserver"],"install":[{"cmd":"npm install static-cling","lang":"bash","label":"npm"},{"cmd":"yarn add static-cling","lang":"bash","label":"yarn"},{"cmd":"pnpm add static-cling","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package uses CommonJS, not ESM. Use require.","wrong":"import cling from 'static-cling';","symbol":"default","correct":"const cling = require('static-cling'); cling();"},{"note":"Directly call the returned function with options. No named export.","wrong":"require('static-cling').serve({ port: 8080 });","symbol":"default with options","correct":"require('static-cling')({ port: 8080, root: './public' });"},{"note":"CLI installed globally via npm i -g static-cling. Use flags only; positional args ignored.","wrong":"npx static","symbol":"CLI usage","correct":"static -p 4000 -d ./dist"}],"quickstart":{"code":"const cling = require('static-cling');\ncling({ port: process.env.PORT || 3000, root: './public', filename: 'index.html' });","lang":"javascript","description":"Shows how to start a static file server programmatically with custom port, root, and default file."},"warnings":[{"fix":"Use --global flag during npm install; check for conflicting binaries with 'which static'.","message":"CLI command is just 'static', which may conflict with other tools. Ensure global install and no name collision.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider alternatives like 'http-server' or 'serve' for active support.","message":"Package last updated in 2019; no maintenance or security patches.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Use reverse proxy (e.g., nginx) or switch to a feature-rich server.","message":"Does not support HTTPS, caching, or directory listing by default.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2.0.3':11 '2019':40 'activ':75 'altern':64 'cadenc':45 'cling':2 'command':16 'command-lin':15 'custom':30 'default':35 'demonstr':63 'depend':52 'develop':61 'differenti':46 'directori':27 'extrem':47 'featur':73 'file':6,24 'filenam':36 'fileserv':79 'http':55,67 'http-server':66 'interfac':18 'javascript':77 'last':37 'like':65 'line':17 'local':60 'low':43 'mainten':44,76 'minim':4 'modul':56 'node.js':9,54 'offer':71 'option':29 'path':33 'port':31 'programmat':20 'provid':12 'pure':53 'quick':59 'root':32 'serv':23,70 'server':7,68 'setup':49 'simpl':48 'static':1,5 'suitabl':57 'updat':38 'usag':21 'version':10 'webserv':78","created_at":"2026-04-27T17:05:01.739838+00:00","updated_at":"2026-04-27T17:05:01.739838+00:00","problems":[{"fix":"npm install static-cling --save","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'static-cling'"},{"fix":"npm install -g static-cling","cause":"Package not installed globally or PATH issue.","error":"static: command not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"static-cling","cli_version":null,"type":"library","homepage":"http://kevinisom.info/Static-Cling/","github":"https://github.com/Kevnz/Static-Cling","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/static-cling","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-18","next_check":"2026-07-26","install_tag":null}}