# partialify

> require()-able HTML, CSS, and (potentially) more

Latest version **3.1.6** (published 2016-01-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install partialify
pnpm add partialify
yarn add partialify
bun add partialify
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.6 |
| Published | 2016-01-28 |
| First published | 2014-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 124 |
| Author | Ben Clinkinbeard |
| Maintainers | bclinkinbeard |
| Keywords | browser, browserify, browserify-transform, require, static, asset, bundle, partial |

## Links

- npm: https://www.npmjs.com/package/partialify
- Repository: https://github.com/bclinkinbeard/partialify
- Homepage: https://github.com/bclinkinbeard/partialify#readme
- Issues: https://github.com/bclinkinbeard/partialify/issues
- npm.io page: https://npm.io/package/partialify

## Dependencies (2)

- [through](https://npm.io/package/through.md) ^2.3.4
- [string-to-js](https://npm.io/package/string-to-js.md) 0.0.1

## 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

- 3.1.6 (latest) — 2016-01-28
- 3.1.5 — 2015-07-22
- 3.1.4 — 2015-07-21
- 3.1.3 — 2015-01-16
- 3.1.2 — 2014-12-16
- 3.1.1 — 2014-03-18
- 3.1.0 — 2014-03-04
- 3.0.0 — 2014-02-22
- 2.2.0 — 2014-02-18
- 2.1.0 — 2014-02-05
- 2.0.1 — 2014-01-27
- 1.0.0 — 2014-01-22

## README

partialify
==========

require() file contents of HTML, CSS and (potentially) more into a variable as a string.

Supports HTML and CSS out of the box, enabling code like this.
```js
var html = require('./some.html'),
	css = require('./some.css');
```

To use, specify as a Browserify transform in your `package.json` or programmatically like so:
```js
var b = require('browserify')(),
	fs = require('fs'),
	p = require('partialify');

b.add('./entry.js');
b.transform(p);
b.bundle().pipe(fs.createWriteStream('./bundle.js'));
```

To support other file types use the custom version. You can either augment the default supported file types or specify a completely custom list.

```js
var b = require('browserify')(),
	fs = require('fs'),
	p = require('partialify/custom');

b.add('./entry.js');

b.transform(p.alsoAllow('xml'));
// or
b.transform(p.alsoAllow(['xml', 'csv']));
// or
b.transform(p.onlyAllow(['xml', 'csv']));

b.bundle().pipe(fs.createWriteStream('./bundle.js'));
```

### Customizing from the CLI

`browserify index.js -t [ partialify --alsoAllow svg --alsoAllow xml ] -o bundle.js`

`browserify index.js -t [ partialify --onlyAllow svg --onlyAllow tsv ] -o bundle.js`

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