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

hapi-browserify

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

hapi-browserify

Browserify plugin for hapi

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

hapi-browserify

npm Dependency Status

Browserify handler for hapi (inspired by browserify-middleware).

Table of Contents

Installation and Configuration

npm install hapi-browserify --save
server.register({
  register: require('hapi-browserify'),
  options: {
    ...
  }
});
Options

Configures the default options for routes.

  • path - path to bundle file.
  • cache - boolean, configures the handlers caching strategy. This does not set cache headers on the response - you should still use hapi for that.
  • minify - enable uglify, only recommended if cache is true.
  • precompile - precompile bundles where possible. Only works if cache is true.
  • bundle - browserify options, plus options for require, exclude, external, transform

Example Usages

See options for all available options.

# Fixed path

server.route({
  method: 'GET',
  path: '/my-script.js',
  handler: {
    browserify: {
      path: './scripts/my-script.js'
    }
  }
});

# Dynamic path

server.route({
  method: 'GET',
  path: '/script/{param*}',
  handler: {
    browserify: {
      bundle: {
        basedir: './script/'
      }
    }
  }
});

FAQs

Package last updated on 28 Jun 2015

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