# head-require

> Use head.js's script loader like require.js

Latest version **1.4.2** (published 2014-05-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install head-require
pnpm add head-require
yarn add head-require
bun add head-require
```

Provides the command `head-require`.

## 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 | 1.4.2 |
| Published | 2014-05-01 |
| First published | 2013-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | mach3 |
| Maintainers | mach3 |
| Keywords | head.js, require.js |

## Links

- npm: https://www.npmjs.com/package/head-require
- Repository: https://github.com/mach3/head-require
- Issues: https://github.com/mach3/head-require/issues
- npm.io page: https://npm.io/package/head-require

## Dependencies (2)

- [opts](https://npm.io/package/opts.md) ~1.2.2
- [uglify-js](https://npm.io/package/uglify-js.md) ~2.3.5

## Recent versions

- 1.4.2 (latest) — 2014-05-01
- 1.4.1 — 2013-07-12
- 1.4.0 — 2013-07-04
- 1.3.0 — 2013-06-20
- 1.2.1 — 2013-06-16
- 1.2.0 — 2013-05-31
- 1.1.0 — 2013-05-30
- 1.0.0 — 2013-03-19

## README

# HeadRequire.js

Extension for head.js to use resource loader like require.js

## Feature

- Set main.js in script element's data-main attribute
- Multiple main.js available now
- Use `head.require()` to load resources
- Grunt task to compile them to a file


## Basic Usage

### Resource Loader

```html
<script src="scripts/head.js"></script>
<script src="scripts/head-require.js" data-main="scripts/main.js"></script>
```
"scripts/main.js" like this : 

```javascript
head.require(
	"the/path/to/foojs",
	"the/path/to/bar.js",
	"the/path/to/baz.js"
	"the/path/to/initialize.js"
);
```
&raquo; [Learn more about head-require.js](doc/head-require.md)


### Grunt Task to Compile

Example :

```javascript
grunt.initConfig({
	headRequire : {
		dist : {
			options : {},
			files : { "the/path/to/dest.js" : "the/path/to/main.js" }
		}
	}
});
```

&raquo; [Learn more about Grunt task](doc/grunt-task.md)

### CHANGE LOG

&raquo; [Change Log](doc/changelog.md)

-----

## Author

mach3

- [Website](http://www.mach3.jp)
- [Blog](http://blog.mach3.jp)
- [Twitter](http://twitter.com/mach3ss)

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