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

static-cling

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

static-cling

Static file server

  • 2.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.7K
decreased by-0.04%
Maintainers
1
Weekly downloads
 
Created
Source

Static Cling

Build Status npm version

This is a node.js module that allows you to spin up a static file server either from code or from the command line.

Installing

npm install static-cling

Don't forget to use the global flag (--g) if you want the command line option everywhere.

At the command line

static

Yeah, that's it. You have the option to pass in -p for port, otherwise it defaults to port 3000, -d for directory, if you want to specify a different directory than the one you are in, and lastly -f for the default html page, this defaults to index.html

In Code

Static Cling is available to be used as a module as well if you want to use node to host static files.

require('static-cling')();

Options

If using the module you can override the defaults by providing a config object

//defaults
var config = {
    root: '.',
    port: 3000,
    filename: 'index.html'
}
const cling = require('static-cling')
//overriding defaults
cling({ port: 3456, root : './other/', filename: 'test.html' });

Keywords

FAQs

Package last updated on 13 Mar 2019

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