# gulp-defmod

> convert nodejs package for front-end

Latest version **0.2.4** (published 2015-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-defmod
pnpm add gulp-defmod
yarn add gulp-defmod
bun add gulp-defmod
```

## 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.4 |
| Published | 2015-09-13 |
| First published | 2015-05-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | cosiner |
| Maintainers | cosiner |
| Keywords | gulpplugin |

## Links

- npm: https://www.npmjs.com/package/gulp-defmod
- Repository: https://github.com/cosiner/gulp-defmod
- Homepage: https://github.com/cosiner/gulp-defmod#readme
- Issues: https://github.com/cosiner/gulp-defmod/issues
- npm.io page: https://npm.io/package/gulp-defmod

## Dependencies (2)

- [through2](https://npm.io/package/through2.md) ^0.6.5
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.4

## Recent versions

- 0.2.4 (latest) — 2015-09-13
- 0.2.3 — 2015-06-13
- 0.2.2 — 2015-05-31
- 0.2.1 — 2015-05-31
- 0.2.0 — 2015-05-29
- 0.0.1 — 2015-05-27

## README

## Information

<table>
<tr>
<td>Package</td><td>gulp-defmod</td>
</tr>
<tr>
<td>Description</td>
<td>Convert nodejs package for front-end</td>
</tr>
<tr>
<td>Node Version</td>
<td>>= 0.10</td>
</tr>
</table>

## Usage

```js
var defmod = require('gulp-defmod');
var concat = require('gulp-concat');

gulp.task('scripts', function() {
  return gulp.src('package/*.js')
    .pipe(defmod({
        dir:'package',
        moduler:true
    }))
    .pipe(concat('dist.js'))
    .pipe(gulp.dest('.'));
});
```

This will wrap contents of each files with module defination like:
```javascript
define('module1', function(require, module, exports) {
// original file contents here
});
```
and also, replace all relative path exists in `require'.

## Options
```
{
 moduler:{bool|string}, whether use the default moduler loader/defination,
                        if true, will be the first file, string type
                        determin the file name to output,
 dir:{string}, package directory, use last directory as package name
 nopkg:(bool), don't add package name as prefix of module defination,
 onedir:(bool), output file to one directory,
 sep: if use onedir, the replacement of directory seperator
}
```

### LICENSE 
MIT.

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