# grunt-embed-require

> build js and embed required.

Latest version **0.0.0** (published 2013-06-18) · BSD license · 0 weekly downloads

## Install

```sh
npm install grunt-embed-require
pnpm add grunt-embed-require
yarn add grunt-embed-require
bun add grunt-embed-require
```

## 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.0.0 |
| Published | 2013-06-18 |
| First published | 2013-06-18 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Fujisawa Shin |
| Maintainers | fnobi |
| Keywords | gruntplugin |

## Links

- npm: https://www.npmjs.com/package/grunt-embed-require
- Repository: https://github.com/fnobi/grunt-embed-require
- npm.io page: https://npm.io/package/grunt-embed-require

## Dependencies (2)

- [ejs](https://npm.io/package/ejs.md) ~0.8.4
- [underscore](https://npm.io/package/underscore.md) ~1.4.4

## Recent versions

- 0.0.0 (latest) — 2013-06-18

## README

grunt-embed-require
===================

build js and embed required.

## example

```javascript
// Gruntfile.js

module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        embed_require: {
            dev: {
                src: 'src/js',
                dest: 'js'
            }
        }
    });

    grunt.loadNpmTasks('grunt-embed-require');

    grunt.registerTask('build', ['embed_require:dev']);

    grunt.registerTask('default', ['build']);
};
```

```javascript
// src/js/main.js

var MyModule = require('MyModule'),
    $ = require('lib/jquery');

$(function () {
    new MyModule('hoge');
});
```

```javascript
// src/js/MyModule.js

var MyModule = function (name) {
    this.name = name;
};

MyModule.prototype.hello = function () {
    return this.name;
};

module.exports = MyModule;
```

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