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

browserify-requireify

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browserify-requireify

Require any type of file when using browserify

  • 0.2.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
11
decreased by-26.67%
Maintainers
1
Weekly downloads
 
Created
Source

requireify

Build Status

A browserify transform for require()-ing non-JS files. Should work with browserify >= 5.x.x.

It accomplishes this by wrapping the contents of the file in a module.exports = '<contents>' block.

Installation

Install via NPM: npm install browserify-requireify

requireify is already taken :(

Usage

var browserify = require('browserify'),
    requireify = require('browserify-requireify');

var b = browserify([ 'my/files/and/stuff.js' ]);
b.transform(requireify({
    extensions: [ 'txt', 'html', 'css' ]
}));

b.bundle(function(err, buffer) {
    console.log(buffer.toString());
});

Options

extensions: An array of (case-insensitive) file extensions. requireify won't do anything if the file doesn't have an extension contained in this array.

Development

Run tests with npm test

Keywords

FAQs

Package last updated on 23 Feb 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