# browserify-requireify

> Require any type of file when using browserify

Latest version **0.2.0** (published 2015-02-23) · 0 weekly downloads

## Install

```sh
npm install browserify-requireify
pnpm add browserify-requireify
yarn add browserify-requireify
bun add browserify-requireify
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2015-02-23 |
| First published | 2014-08-29 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | tmont |
| Keywords | require, browserify |

## Links

- npm: https://www.npmjs.com/package/browserify-requireify
- Repository: git@github.com:tmont/requireify
- Homepage: https://github.com/tmont/requireify
- Issues: https://github.com/tmont/requireify/issues
- npm.io page: https://npm.io/package/browserify-requireify

## Dependencies (1)

- [through](https://npm.io/package/through.md) 2.3.6

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2015-02-23
- 0.1.1 — 2014-09-13
- 0.1.0 — 2014-08-29

## README

# requireify
[![Build Status](https://travis-ci.org/tmont/requireify.png)](https://travis-ci.org/tmont/requireify)

A [browserify](http://browserify.org/) 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
```javascript
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`

---
_Source: https://npm.io/package/browserify-requireify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
