Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

create-serve

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-serve

🍛 Ultralight http server with live reload. [CLI + API]

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.7K
decreased by-11.92%
Maintainers
1
Weekly downloads
 
Created
Source

Serve 🍛

Ultralight http server with live reload.
CLI + API


Simple CLI and API

With live reload

Light and modern

No dependencies


One command

npm init serve

Or one function

import serve from 'create-serve';

serve.start();

To start 🍛


CLI

By default, it serves public if the folder exists, otherwise root /.
Or you can specify a different folder.

npm init serve [folder]

API

import serve from 'create-serve';

serve.start({
    port: 7000,
    root: '.',
    live: true
});

Live reload

serve.update();

Use any file watcher


Chokidar

import serve from 'create-serve';
import chokidar from 'chokidar';

serve.start();

chokidar.watch('.').on('change', () => {
    serve.update();
});

esbuild

Use the official wrapper for esbuild's watch   →   esbuild-serve


Log

Import the util functions to log updates with colours.

import serve, { error, log } from 'create-serve';

serve.update();

hasError
    ? error('× Failed') // Red
    : log('✓ Updated'); // Green



Native Web

Keywords

FAQs

Package last updated on 13 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc