New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bff

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bff

Browserify Friend - it's as if browserify was built into the browser.

0.1.4
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Browserify Friend

Browserify Friend (BFF) - it is as if browserify was built into the browser.

Install

npm install bff -g

Development Server

In a directory run:

> bff server
Serving contents on port 3000.

This will start a static file web server on port 3000 except that Javascript files will automatically get browserified.

Build the Site

In the same directory run:

> bff build
Successfully browserified your site in 'build'.

Now your site has been browserified within the build directory and it can be served by a static web server.

Example

To try this out, start in a new empty directory. Let's install domify - a library to convert an html string into a DOM element

npm install domify

make an index.html file with just this

<body>
  <script src="index.js"></script>
</body>

Make an index.js

var domify = require('domify')
document.body.appendChild(domify('<h1>Hello World with Browserify!</h1>'))

Start the bff server

bff server

Navigate to http://localhost:3000 and see it work.

Now, if you want to generate the site so that it can be served via a static web server like Apache or Nginx, use the build command

bff build

Test it using the python web server

cd build
python -m SimpleHTTPServer

Navigate to http://localhost:8000 and see it work.

Requires

BFF configures Browserify to make all top level files requirable. This means you can do var domify = require('domify') in the development console. You can also require any .js file in your app using relative paths, e.g. var app = require('./app').

Keywords

browserify

FAQs

Package last updated on 13 Feb 2014

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