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

loadify

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

loadify

Make browserify bundles loadable via different methods.

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Loadify

Middleware for browserify to make bundles loadable via AMD or script tag.

Getting Started

Install the module with: npm install loadify

Documentation

Loadify accepts an object with a couple keys:

  • module - The requireable module name.
  • name - (optional) If you're generating a script and it's included via a script tag, this will be the global variable under which your script exports will be available.

Examples

Package up a module.

var loadify = require('loadify');
var browserify = require('browserify');
var bundle = browserify({
	require: 'my_module'
});

bundle.use(loadify({
	module: 'my_module'
}));

// write your bundle to a file

Package up a script that uses other modules.

var loadify = require('loadify');
var browserify = require('browserify');
var bundle = browserify({
	entry: './my_script.js'
});

bundle.use(loadify({
	name: 'myModule', // global that will be available if loaded via script tag
	module: './my_script.js'
}));

// write your bundle to a file

Tests

To run tests in the browser, make sure you've got the devDependencies installed and browse to ./test/index.html. If you make changes, run node ./test/fixture/compile.js to recomplile the client javascript.

TODO

  • Automatically detect module name.
  • Add tests for loading via CommonJS loader.

License

Copyright (c) 2012 Chris Jaure
Licensed under the MIT license.

Keywords

FAQs

Package last updated on 14 Jul 2012

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