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

bobr

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bobr

Update browser property in package.json for use bower components in browserify by their names.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

bobr

Update browser property in package.json for use bower components in browserify by their names.

Currently, browserify can resolves paths only packages installed via npm, to use components installed via bower, you should manually update browser property in package.json, or use relative paths in require(). Bobr updates browser property in package.json, allows you use bower modules by name in require().

// package.json
browser: [ // updated by bobr
  "jquery": "./bower_components/jquery/dist/jquery.js",
  ...
]

// in your module
var $ = require('jquery');

Install

npm i -D bobr

Usage

Bobr should be used in task runners, such as Gulp or Grunt. Below, the example of gulp task which run Bobr:

var gulp       = require('gulp');
var bobr       = require('bobr');
var browserify = require('browserify');

// Update browser property
gulp.task('bobr', function() {
  bobr.run({
    overrides: [
      {
        name: 'jquery'
        newName: 'jqueryModule'
      }
    ],
    browserExternalFile: './config/browser-external.json',
  });
});

// Browserify modules, will be run, after bobr will be finished
gulp.task('browserify', ['bobr'], function(cb) {
  // create bundles
}

Options

  • overrides - an array of objects to override module names. By default, module name is a js file name without extension, use this option to override this.
  • browserExternalFile - a path to a json file with your own modules, which you want to browserify. Bobr concatenate these modules with bower modules.

License

This code available under the MIT License. See License.md for details.

Authors

Alexander Mac (amatsibarov@gmail.com)

Keywords

FAQs

Package last updated on 20 Jan 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