Socket
Socket
Sign inDemoInstall

bunk

Package Overview
Dependencies
3
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bunk

a decidedly featureless, low dependency http server to serve static resource files, with cli support


Version published
Maintainers
1
Install size
422 kB
Created

Readme

Source

bunk

a decidedly featureless, low dependency http server to serve static resource files, with cli support

Getting Started

Install it globally for use on the command line.

$ npm install -g bunk

CLI Usage

The most basic way to use bunk is to run on the terminal:

$ bunk

This will serve all static files within the current working directory at localhost:7070.

Options

For more "advanced" usage, include in the command:

  -d, --dir <dir>    directory of static files to serve, default: .
  -p, --port <port>  port to run http server on, default: 7070

For exmaple, to serve the directory build/production on port 1337, run on the terminal:

$ bunk -d build/production -p 1337

It is recommended, but not required, that you have an index.html within the root of the directory being served.

API Usage

Install it as a local dependency for use within another module.

$ npm install --save bunk
$ npm install --save-dev bunk

Then require and call bunk with or without options

var bunk = require('bunk');

bunk()
// => bunk: serving . on port 7070

bunk({dir:'build/production', port:1337})
// => bunk: serving build/production on port: 1337

Credits

This module was heavily inspired by an example usage of serve-static.

Keywords

FAQs

Last updated on 11 Apr 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc