# stubbify

> Stubbify files so that some code isn't included.

Latest version **0.1.2** (published 2015-01-24) · MIT license · 0 weekly downloads

## Install

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

Provides the command `stubbify`.

## 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.2 |
| Published | 2015-01-24 |
| First published | 2014-12-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Ian Sibner |
| Maintainers | isibner |
| Keywords | stubbify, CIS197 |

## Links

- npm: https://www.npmjs.com/package/stubbify
- Repository: https://github.com/isibner/stubbify
- Issues: https://github.com/isibner/stubbify/issues
- npm.io page: https://npm.io/package/stubbify

## Dependencies (5)

- [glob](https://npm.io/package/glob.md) 4.3.2
- [mkdirp](https://npm.io/package/mkdirp.md) 0.5.0
- [highland](https://npm.io/package/highland.md) 2.3.0
- [commander](https://npm.io/package/commander.md) 2.5.1
- [istextorbinary](https://npm.io/package/istextorbinary.md) 1.0.2

## Alternatives

- [pagerjs](https://npm.io/package/pagerjs.md) — 60 weekly downloads
- [whistle.savefor-mock](https://npm.io/package/whistle.savefor-mock.md) — 4 weekly downloads
- [facebook-ads-library-api](https://npm.io/package/facebook-ads-library-api.md) — 0 weekly downloads
- [@comp-markdown/wireframe](https://npm.io/package/@comp-markdown/wireframe.md) — 0 weekly downloads
- [generador-datos-mx](https://npm.io/package/generador-datos-mx.md) — 0 weekly downloads

## Recent versions

- 0.1.2 (latest) — 2015-01-24
- 0.1.1 — 2014-12-30
- 0.1.0 — 2014-12-30
- 0.0.6 — 2014-12-28
- 0.0.5 — 2014-12-26
- 0.0.4 — 2014-12-21
- 0.0.3 — 2014-12-21
- 0.0.2 — 2014-12-21
- 0.0.1 — 2014-12-21

## README

# Stubbify - the File Stubbing Helper

  [![NPM Version][npm-image]][npm-url]
  [![Build Status][travis-image]][travis-url]

## Installation
```
npm install -g stubbify
```

## Usage

```
Usage: stubbify [file ...] [targetDir]

Options:

  -h, --help                 output usage information
  -V, --version              output the version number
  -b, --begin-stub [string]  RegEx string (JS-style) for stub begin delimiter (case-insensitive)
  -e, --end-stub [string]    RegEx string (JS-style) for stub end delimiter (case-insensitive)
  -s, --silent               Suppress printing of stubbified file paths
```

See also the [Grunt](http://gruntjs.com/) plugin, [grunt-stubbify](https://github.com/isibner/grunt-stubbify).

## About

Stubbify was created for [CIS 197](http://www.seas.upenn.edu/~cis197) to easily create homework boilerplate (for students to complete) from existing homework solutions. If we run `stubbify homework.js studentHW`, with the following `homework.js`:

```javascript
var add = function (a, b) {
  // add the two input integers together
  // STUB
  return a + b;
  // ENDSTUB
}
```

Then the stubs will be removed, leaving the following in `studentHW/homework.js`:
```javascript
var add = function (a, b) {
  // add the two input integers together
}
```

The default delimiters are `// STUB` and `// ENDSTUB`, but these can be changed with the `--begin-stub` and `--end-stub` options to support other languages or preferences.

Any number of files can be provided, and file arguments can also be glob patterns (like `**/*.js`). Glob patterns must be passed as strings, and the last argument must always be the target directory.

Stubbify preserves the relative paths of the stubbed-out files, so `foo/bar/baz/quux.js` will be copied into `targetDir/foo/bar/baz/quux.js`. This is so you can easily use stubbify as part of your build process for a student homework directory:
```
$ stubbify js/homeworkFile1.js js/homeworkFile2.js js/util/homeworkUtil.js student-homework
$ stubbify "js/**/*.js" student-homework # equivalent with glob pattern
$ tree .
.
├── js
│   ├── homeworkFile1.js
│   ├── homeworkFile2.js
│   └── util
│       └── homeworkUtil.js
└── student-homework
    └── js
        ├── homeworkFile1.js
        ├── homeworkFile2.js
        └── util
            └── homeworkUtil.js
```

[npm-image]: https://img.shields.io/npm/v/stubbify.svg?style=flat
[npm-url]: https://www.npmjs.com/package/stubbify
[travis-image]: https://img.shields.io/travis/isibner/stubbify.svg?style=flat
[travis-url]: https://travis-ci.org/isibner/stubbify

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