# require2web

> This utility combines multiple JavaScript files into a single .js file for use in the browser. It allows you to structure your Javascript library like a node.js application, and make require() calls to other modules.

Latest version **0.1.7** (published 2014-04-11) · MIT license · 0 weekly downloads

## Install

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

Provides the command `r2w`.

## 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.1.7 |
| Published | 2014-04-11 |
| First published | 2014-01-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Christopher Eaton |
| Maintainers | awesometacular |
| Keywords | r2w, require, client, client-side, merge, compile |

## Links

- npm: https://www.npmjs.com/package/require2web
- Repository: https://bitbucket.org/chriseaton/require2web
- Issues: https://bitbucket.org/chriseaton/require2web/issues
- npm.io page: https://npm.io/package/require2web

## Dependencies (1)

- [optimist](https://npm.io/package/optimist.md) 0.6.x

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.1.7 (latest) — 2014-04-11
- 0.1.6 — 2014-04-11
- 0.1.5 — 2014-04-11
- 0.1.4 — 2014-04-11
- 0.1.3 — 2014-02-19
- 0.1.2 — 2014-02-19
- 0.1.1 — 2014-02-19
- 0.0.10 — 2014-02-17
- 0.0.9 — 2014-02-10
- 0.0.8 — 2014-02-10
- 0.0.7 — 2014-02-10
- 0.0.6 — 2014-02-10
- 0.0.5 — 2014-02-09
- 0.0.4 — 2014-02-09
- 0.0.3 — 2014-01-30
- … 2 more at https://npm.io/package/require2web/versions

## README

#Require 2 Web
By *Christopher Eaton, Oregon USA*
- - -

##Description
Require2web (r2w) is a node.js command line utility that combines multiple JavaScript files into a single .js file for use in the browser.
It allows you to structure your Javascript library like a node.js application, and make require() calls to other modules.
When your project is compiled with require2web, and included on your website, you can continue to make require() calls to dynamically load modules.

##Installation
It's generally recommended to install r2w as a global library. Once this is done you can start it like any other command-line utility using the
command "r2w", as shown in the usage section below.

```sh
npm install -g require2web
```

##Usage
```sh
Usage: r2w {-c "<config file>"} {-p "<path>"} {-i "<path to ignore>"} -o <output.js>

*The path options (-p and -i) can be specified multiple times.

Options:
  -c, --config       Specify a project configuration file.                                                                               
  -g                 Output the default project configuration json. This can be copied to a configuration file for use with your project.
  -p, --paths        The files or directories (to scan recursively) to merge.                                                            
  -i, --ignorepaths  The files or directories that will be ignored.                                                                      
  -o, --output       The name of the output file containing the merged code.                                                             
  --package          Specifies the package.json file to find the main *.js file to begin the merge process.                              
  -h, --help         Show this help message.  
```

####Considerations
 - The output template defines a the require() function - if you are using another library that may conflict with this, you can modify the 
"output.template" file in the "templates" folder and simply rename the require method.
 - To generate a default r2w config file use "r2w -g > r2w.config" on any unix/linux machine.

---

##About this project & contributors
Repository is on [BitBucket](https://bitbucket.org/awesometacular/require2web)  
Report any problems [here](https://bitbucket.org/awesometacular/require2web/issues?status=new&status=open)  
Visit my blog at [awesometacular.com](http://www.thedevexpert.com)

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