{"id":18097,"library":"alive-server","title":"Alive Server","description":"Alive Server is a fork of live-server, a simple development HTTP server with live reload capability for front-end development. The latest stable version is 1.3.1 (released January 2023). It supports middleware injection, custom mime types, SPA mode, and HTTPS. Key differentiators from live-server include active maintenance, merged PRs, and support for config file (.alive-server.json). It is designed for local development only, not production deployment.","status":"active","version":"1.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/ljcp/alive-server","tags":["javascript","front-end","development","tool","server","http","cli"],"install":[{"cmd":"npm install alive-server","lang":"bash","label":"npm"},{"cmd":"yarn add alive-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add alive-server","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used to serve static files (required at runtime)","package":"send","optional":false}],"imports":[{"note":"The package is a CLI tool, but it can be used programmatically via CommonJS require. No default export; use require().","wrong":"const aliveServer = require('alive-server');","symbol":"programmatic API","correct":"import { default as aliveServer } from 'alive-server';"},{"note":"Only CommonJS require works; no named export 'liveServer'.","wrong":"import { liveServer } from 'alive-server';","symbol":"liveServer","correct":"const liveServer = require('alive-server'); exports the start function"},{"note":"The module exports a 'start' function via CommonJS. ESM import is not supported directly.","wrong":"import { start } from 'alive-server';","symbol":"start","correct":"const { start } = require('alive-server');"},{"note":"params is an object exported via module.exports, only accessible via require.","wrong":"import { params } from 'alive-server';","symbol":"params","correct":"const params = require('alive-server').params;"}],"quickstart":{"code":"// Install globally: npm install -g alive-server\n// Then serve current directory:\n// alive-server --port=3000 --open=/index.html --no-browser\n\n// Programmatic usage (CommonJS):\nconst liveServer = require('alive-server');\n\nconst params = {\n  port: 9000,\n  host: '0.0.0.0',\n  root: process.cwd(),\n  open: false,\n  ignore: '*.scss',\n  file: 'index.html',\n  wait: 100,\n  mount: [['/components', './node_modules']],\n  logLevel: 2,\n  middleware: [function(req, res, next) {\n    next();\n  }]\n};\n\nliveServer.start(params);","lang":"javascript","description":"Shows both CLI and programmatic usage of alive-server with custom port, ignored files, and middleware."},"warnings":[{"fix":"Rename .live-server.json to .alive-server.json","message":"The config file is named .alive-server.json, not .live-server.json (since v1.3.0). Using .live-server.json will be ignored.","severity":"gotcha","affected_versions":">=1.3.0"},{"fix":"Use --ignore instead of --ignorePattern","message":"The --ignorePattern flag is deprecated in favor of --ignore (anymatch patterns).","severity":"deprecated","affected_versions":">=1.2.8"},{"fix":"Ensure ignore and watch values in .alive-server.json are arrays (e.g., [\"*.scss\"])","message":"In v1.3.0, the ignore and watch fields in config file changed from string to array format. A single string will no longer be accepted.","severity":"breaking","affected_versions":">=1.3.0"},{"fix":"Use --https=PATH to a JS file exporting an HTTPS configuration object","message":"The option --https-module is replaced by --https pointing to a config module; the old flag may be removed.","severity":"deprecated","affected_versions":">=1.2.8"},{"fix":"Use require('alive-server') instead of import","message":"The package does not have a default export; requiring 'alive-server' returns an object with start and params. Using import will fail unless using a CommonJS interop.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install send' in your project or ensure alive-server is installed globally with all dependencies.","cause":"Missing dependency 'send' when using programmatic API without installing dependencies.","error":"Error: Cannot find module 'send'"},{"fix":"Use const liveServer = require('alive-server'); /* then liveServer.start(params) */","cause":"Trying to use ESM import (e.g., import liveServer from 'alive-server') which returns undefined.","error":"TypeError: liveServer.start is not a function"},{"fix":"Run 'npm install -g alive-server' and ensure npm global bin directory is in PATH.","cause":"alive-server is not installed globally or not in PATH.","error":"alive-server: command not found"},{"fix":"Use --port to specify a different port, or kill the process using the current port.","cause":"The specified port is occupied by another process.","error":"port is already in use"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}